<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
<WarningLevel>EnableAllWarnings</WarningLevel>\r
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CompileAs>CompileAsC</CompileAs>\r
- <DisableSpecificWarnings>4061;4062;4127;4244;4255;4668;4710;4820;4996;4774;5045;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+ <CompileAs>CompileAsCpp</CompileAs>\r
+ <DisableSpecificWarnings>4061;4062;4127;4244;4255;4365;4514;4668;4710;4820;4996;4774;5045;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
<ConformanceMode>true</ConformanceMode>\r
<MultiProcessorCompilation>true</MultiProcessorCompilation>\r
<AdditionalIncludeDirectories>..\..\src;curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <LanguageStandard>stdcpplatest</LanguageStandard>\r
+ <ExceptionHandling>SyncCThrow</ExceptionHandling>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
<WarningLevel>Level4</WarningLevel>\r
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CompileAs>CompileAsC</CompileAs>\r
+ <CompileAs>CompileAsCpp</CompileAs>\r
<DisableSpecificWarnings>4127;4996;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
<MultiProcessorCompilation>true</MultiProcessorCompilation>\r
<AdditionalIncludeDirectories>..\..\src;curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <ExceptionHandling>SyncCThrow</ExceptionHandling>\r
+ <LanguageStandard>stdcpplatest</LanguageStandard>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<DebugInformationFormat>None</DebugInformationFormat>\r
<IntrinsicFunctions>true</IntrinsicFunctions>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
- <CompileAs>CompileAsC</CompileAs>\r
+ <CompileAs>CompileAsCpp</CompileAs>\r
+ <ExceptionHandling>SyncCThrow</ExceptionHandling>\r
+ <LanguageStandard>stdcpplatest</LanguageStandard>\r
</ClCompile>\r
<Link>\r
<TargetMachine>MachineX86</TargetMachine>\r
<DisableSpecificWarnings>4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
<MultiProcessorCompilation>true</MultiProcessorCompilation>\r
<AdditionalIncludeDirectories>..\..\src;curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <ExceptionHandling>SyncCThrow</ExceptionHandling>\r
+ <LanguageStandard>stdcpplatest</LanguageStandard>\r
+ <CompileAs>CompileAsCpp</CompileAs>\r
</ClCompile>\r
<Link>\r
<AdditionalDependencies>winmm.lib;Ws2_32.lib;Wldap32.lib;Crypt32.lib;Normaliz.lib;curl\x86 Release\libcurl_a.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
}
if ((stormbringer && (randint1(1000) > 666)) || (creature_ptr->pclass == CLASS_BERSERKER)) {
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
can_move = FALSE;
} else if (monster_can_cross_terrain(creature_ptr, floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0)) {
do_past = TRUE;
can_move = FALSE;
}
} else {
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
can_move = FALSE;
}
}
#include "system/angband.h"
-typedef enum racial_level_check_result {
+enum racial_level_check_result {
RACIAL_SUCCESS = 1,
RACIAL_FAILURE = -1,
RACIAL_CANCEL = 0,
-} racial_level_check_result;
+};
typedef struct rpi_type rpi_type;
PERCENTAGE racial_chance(player_type *creature_ptr, rpi_type *rpi_ptr);
#pragma once
-typedef enum fixed_artifact_type {
+enum fixed_artifact_type {
ART_JUDGE = 3,
ART_POWER = 13,
ART_CRIMSON = 16,
ART_ROBINTON = 251,
ART_ICINGDEATH = 259,
ART_TWINKLE = 260
-} fixed_artifact_type;
+};
#pragma once
-typedef enum random_art_bias_type {
+enum random_art_bias_type {
BIAS_NONE = 0,
BIAS_ELEC = 1, /*!< ランダムアーティファクトバイアス:電撃 */
BIAS_POIS = 2, /*!< ランダムアーティファクトバイアス:毒 */
BIAS_WARRIOR = 18, /*!< ランダムアーティファクトバイアス:戦士系 */
BIAS_RANGER = 19, /*!< ランダムアーティファクトバイアス:レンジャー系 */
MAX_BIAS = 20, /*!< ランダムアーティファクトバイアス:最大数 */
-} random_art_bias_type;
+};
#pragma once
-typedef enum random_art_activation_type {
+enum random_art_activation_type {
ACT_SUNLIGHT = 1,
ACT_BO_MISS_1 = 2,
ACT_BA_POIS_1 = 3,
ACT_BLOODY_MOON = 254,
ACT_CRIMSON = 255,
ACT_MAX = 255, /* ダミー、最大値と合わせること / Dummy. Please match the value as max value */
-} random_art_activation_type;
+};
#include "autopick/autopick-util.h"
/*! APE means AutoPickEditor*/
-typedef enum ape_quittance {
+enum ape_quittance {
APE_QUIT = 0,
APE_QUIT_WITHOUT_SAVE = 1,
APE_QUIT_AND_SAVE = 2
-} ape_quittance;
+};
ape_quittance do_editor_command(player_type *player_ptr, text_body_type *tb, int com_id);
concptr q = _("どのアイテムを登録しますか? ", "Enter which item? ");
concptr s = _("アイテムを持っていない。", "You have nothing to enter.");
object_type *o_ptr;
- o_ptr = choose_object(player_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
+ o_ptr = choose_object(player_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, TV_NONE);
if (!o_ptr)
return FALSE;
concptr q = _("どのアイテムを検索しますか? ", "Enter which item? ");
concptr s = _("アイテムを持っていない。", "You have nothing to enter.");
object_type *o_ptr;
- o_ptr = choose_object(player_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
+ o_ptr = choose_object(player_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, TV_NONE);
if (!o_ptr)
return FALSE;
if (!select_class(creature_ptr, cur, sym, &k))
return FALSE;
- creature_ptr->pclass = (byte)k;
+ creature_ptr->pclass = static_cast<player_class_type>(k);
cp_ptr = &class_info[creature_ptr->pclass];
mp_ptr = &m_info[creature_ptr->pclass];
c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15);
if (!select_race(creature_ptr, sym, &k))
return FALSE;
- creature_ptr->prace = (byte)k;
+ creature_ptr->prace = static_cast<player_race_type>(k);
rp_ptr = &race_info[creature_ptr->prace];
c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15);
return TRUE;
#include "system/angband.h"
-typedef enum birth_kind
+enum birth_kind
{
BK_REALM,
BK_RACE,
BK_CLASS,
BK_PERSONALITY,
BK_AUTO_ROLLER,
-} birth_kind;
+};
void birth_quit(void);
void show_help(player_type* creature_ptr, concptr helpfile);
static bool let_player_select_race(player_type *creature_ptr)
{
clear_from(10);
- creature_ptr->prace = 0;
+ creature_ptr->prace = RACE_HUMAN;
while (TRUE) {
char temp[80 * 10];
if (!get_player_race(creature_ptr))
static bool let_player_select_class(player_type *creature_ptr)
{
clear_from(10);
- creature_ptr->pclass = 0;
+ creature_ptr->pclass = CLASS_WARRIOR;
while (TRUE) {
char temp[80 * 9];
if (!get_player_class(creature_ptr))
static bool let_player_select_personality(player_type *creature_ptr)
{
- creature_ptr->pseikaku = 0;
+ creature_ptr->pseikaku = PERSONALITY_ORDINARY;
while (TRUE) {
char temp[80 * 8];
if (!get_player_personality(creature_ptr))
q_ptr->pval = (PARAMETER_VALUE)rand_range(25, 30);
add_outfit(creature_ptr, q_ptr);
} else if (creature_ptr->pclass == CLASS_SORCERER) {
- tval_type book_tval;
- for (book_tval = TV_LIFE_BOOK; book_tval <= TV_LIFE_BOOK + MAX_MAGIC - 1; book_tval++) {
- object_prep(creature_ptr, q_ptr, lookup_kind(book_tval, 0));
+ int book_tval;
+ for (book_tval = TV_LIFE_BOOK; book_tval <= TV_LIFE_BOOK + static_cast<int>(MAX_MAGIC) - 1; book_tval++) {
+ object_prep(creature_ptr, q_ptr, lookup_kind(static_cast<tval_type>(book_tval), 0));
q_ptr->number = 1;
add_outfit(creature_ptr, q_ptr);
}
}
for (int i = 0; i < 3; i++) {
- tval_type tv = player_init[creature_ptr->pclass][i][0];
+ int tv = player_init[creature_ptr->pclass][i][0];
OBJECT_SUBTYPE_VALUE sv = player_init[creature_ptr->pclass][i][1];
if ((creature_ptr->prace == RACE_ANDROID) && ((tv == TV_SOFT_ARMOR) || (tv == TV_HARD_ARMOR)))
continue;
}
q_ptr = &forge;
- object_prep(creature_ptr, q_ptr, lookup_kind(tv, sv));
+ object_prep(creature_ptr, q_ptr, lookup_kind(static_cast<tval_type>(tv), sv));
if ((tv == TV_SWORD || tv == TV_HAFTED)
&& (creature_ptr->pclass == CLASS_ROGUE && creature_ptr->realm1 == REALM_DEATH)) /* Only assassins get a poisoned weapon */
q_ptr->name2 = EGO_BRAND_POIS;
#include "system/angband.h"
-typedef enum blue_magic_type blue_magic_type;
+enum blue_magic_type : int;
bool monster_spell_is_learnable(int monspell);
void learn_spell(player_type *learner_ptr, int monspell);
{
msg_print(_("援軍を召喚した。", "You summon one of your kin."));
for (int k = 0; k < 1; k++) {
- if (summon_kin_player(caster_ptr, bmc_ptr->summon_lev, caster_ptr->y, caster_ptr->x, (bmc_ptr->pet ? PM_FORCE_PET : 0L))) {
+ if (summon_kin_player(caster_ptr, bmc_ptr->summon_lev, caster_ptr->y, caster_ptr->x, (bmc_ptr->pet ? PM_FORCE_PET : PM_NONE))) {
if (!bmc_ptr->pet)
msg_print(_("召喚された仲間は怒っている!", "The summoned companion is angry!"));
} else {
{
msg_print(_("仲間を召喚した。", "You summon help."));
for (int k = 0; k < 1; k++) {
- if (summon_specific(caster_ptr, (bmc_ptr->pet ? -1 : 0), caster_ptr->y, caster_ptr->x, bmc_ptr->summon_lev, 0, bmc_ptr->p_mode)) {
+ if (summon_specific(caster_ptr, (bmc_ptr->pet ? -1 : 0), caster_ptr->y, caster_ptr->x, bmc_ptr->summon_lev, SUMMON_NONE, bmc_ptr->p_mode)) {
if (!bmc_ptr->pet)
msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!"));
} else {
{
msg_print(_("モンスターを召喚した!", "You summon monsters!"));
for (int k = 0; k < bmc_ptr->plev / 15 + 2; k++) {
- if (summon_specific(caster_ptr, (bmc_ptr->pet ? -1 : 0), caster_ptr->y, caster_ptr->x, bmc_ptr->summon_lev, 0, (bmc_ptr->p_mode | bmc_ptr->u_mode))) {
+ if (summon_specific(caster_ptr, (bmc_ptr->pet ? -1 : 0), caster_ptr->y, caster_ptr->x, bmc_ptr->summon_lev, SUMMON_NONE, (bmc_ptr->p_mode | bmc_ptr->u_mode))) {
if (!bmc_ptr->pet)
msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!"));
} else {
* @param power モンスター魔法のID
* @return なし
*/
-void learnt_info(player_type *learner_ptr, char *p, int power)
+void learnt_info(player_type *learner_ptr, char *p, monster_spell_type power)
{
PLAYER_LEVEL plev = get_pseudo_monstetr_level(learner_ptr);
#include "system/angband.h"
+enum monster_spell_type : int;
+
PLAYER_LEVEL get_pseudo_monstetr_level(player_type *caster_ptr);
-void learnt_info(player_type *learner_ptr, char *p, int power);
+void learnt_info(player_type *learner_ptr, char *p, monster_spell_type power);
static bool sweep_learnt_spells(player_type *caster_ptr, learnt_magic_type *lm_ptr)
{
- set_rf_masks(&lm_ptr->f4, &lm_ptr->f5, &lm_ptr->f6, lm_ptr->mode);
+ set_rf_masks(&lm_ptr->f4, &lm_ptr->f5, &lm_ptr->f6, static_cast<blue_magic_type>(lm_ptr->mode));
for (lm_ptr->blue_magic_num = 0, lm_ptr->count = 0; lm_ptr->blue_magic_num < 32; lm_ptr->blue_magic_num++)
if ((0x00000001U << lm_ptr->blue_magic_num) & lm_ptr->f4)
lm_ptr->blue_magics[lm_ptr->count++] = lm_ptr->blue_magic_num;
lm_ptr->spell = monster_powers[lm_ptr->blue_magics[lm_ptr->blue_magic_num]];
calculate_blue_magic_success_probability(caster_ptr, lm_ptr);
- learnt_info(caster_ptr, lm_ptr->comment, lm_ptr->blue_magics[lm_ptr->blue_magic_num]);
+ learnt_info(caster_ptr, lm_ptr->comment, static_cast<monster_spell_type>(lm_ptr->blue_magics[lm_ptr->blue_magic_num]));
close_blue_magic_name(lm_ptr);
strcat(lm_ptr->psi_desc, format(" %-26s %3d %3d%%%s", lm_ptr->spell.name, lm_ptr->need_mana, lm_ptr->chance, lm_ptr->comment));
prt(lm_ptr->psi_desc, lm_ptr->y + lm_ptr->blue_magic_num + 1, lm_ptr->x);
msg_format(_("%sを%sで攻撃した。", "You hit %s with your %s."), m_name, atk_desc);
HIT_POINT k = damroll(dice_num, dice_side);
- k = critical_norm(attacker_ptr, n_weight, bonus, k, (s16b)bonus, 0);
+ k = critical_norm(attacker_ptr, n_weight, bonus, k, (s16b)bonus, HISSATSU_NONE);
k += attacker_ptr->to_d_m;
if (k < 0)
k = 0;
return FALSE;
msg_print(_("仲間を召喚した。", "You summon help."));
for (k = 0; k < 1; k++)
- summon_specific(caster_ptr, -1, target_row, target_col, plev, 0, (mode | u_mode));
+ summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_NONE, (mode | u_mode));
break;
}
case MS_S_MONSTERS: {
return FALSE;
msg_print(_("モンスターを召喚した!", "You summon monsters!"));
for (k = 0; k < 6; k++)
- summon_specific(caster_ptr, -1, target_row, target_col, plev, 0, (mode | u_mode));
+ summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_NONE, (mode | u_mode));
break;
}
case MS_S_ANT: {
{
switch (cm_ptr->use_mind) {
case MIND_MINDCRAFTER:
- cm_ptr->cast = cast_mindcrafter_spell(caster_ptr, cm_ptr->n);
+ cm_ptr->cast = cast_mindcrafter_spell(caster_ptr, static_cast<mind_mindcrafter_type>(cm_ptr->n));
return TRUE;
case MIND_KI:
- cm_ptr->cast = cast_force_spell(caster_ptr, cm_ptr->n);
+ cm_ptr->cast = cast_force_spell(caster_ptr, static_cast<mind_force_trainer_type>(cm_ptr->n));
return TRUE;
case MIND_BERSERKER:
- cm_ptr->cast = cast_berserk_spell(caster_ptr, cm_ptr->n);
+ cm_ptr->cast = cast_berserk_spell(caster_ptr, static_cast<mind_berserker_type>(cm_ptr->n));
return TRUE;
case MIND_MIRROR_MASTER:
if (is_mirror_grid(&caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x]))
cm_ptr->on_mirror = TRUE;
- cm_ptr->cast = cast_mirror_spell(caster_ptr, cm_ptr->n);
+ cm_ptr->cast = cast_mirror_spell(caster_ptr, static_cast<mind_mirror_master_type>(cm_ptr->n));
return TRUE;
case MIND_NINJUTSU:
- cm_ptr->cast = cast_ninja_spell(caster_ptr, cm_ptr->n);
+ cm_ptr->cast = cast_ninja_spell(caster_ptr, static_cast<mind_ninja_type>(cm_ptr->n));
return TRUE;
default:
msg_format(_("謎の能力:%d, %d", "Mystery power:%d, %d"), cm_ptr->use_mind, cm_ptr->n);
break;
}
}
-}
\ No newline at end of file
+}
} else if (g_ptr->m_idx && creature_ptr->riding != g_ptr->m_idx) {
take_turn(creature_ptr, 100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
} else if (o_idx) {
more = exe_open_chest(creature_ptr, y, x, o_idx);
} else {
} else if (g_ptr->m_idx) {
take_turn(creature_ptr, 100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
} else {
more = exe_close(creature_ptr, y, x);
}
msg_print(_("そこには解除するものが見当たらない。", "You see nothing there to disarm."));
} else if (g_ptr->m_idx && creature_ptr->riding != g_ptr->m_idx) {
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
} else if (o_idx) {
more = exe_disarm_chest(creature_ptr, y, x, o_idx);
} else {
} else if (g_ptr->m_idx) {
take_turn(creature_ptr, 100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
} else {
more = exe_bash(creature_ptr, y, x, dir);
}
} else if (g_ptr->m_idx) {
take_turn(creature_ptr, 100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
} else {
take_turn(creature_ptr, 100);
msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
f_ptr = &f_info[feat];
take_turn(creature_ptr, 100);
if (g_ptr->m_idx) {
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
return FALSE;
}
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
return FALSE;
}
break;
}
}
-}
\ No newline at end of file
+}
concptr q = _("どれを撃ちますか? ", "Fire which item? ");
concptr s = _("発射されるアイテムがありません。", "You have nothing to fire.");
- ammo_ptr = choose_object(creature_ptr, &item, q, s, USE_INVEN | USE_FLOOR, creature_ptr->tval_ammo);
+ ammo_ptr = choose_object(creature_ptr, &item, q, s, USE_INVEN | USE_FLOOR, static_cast<tval_type>(creature_ptr->tval_ammo));
if (!ammo_ptr) {
flush();
return;
object_type *o_ptr;
concptr q, s;
- tval_type tval = 0;
+ tval_type tval = TV_NONE;
/* Warriors are illiterate */
if (!(caster_ptr->realm1 || caster_ptr->realm2) && (caster_ptr->pclass != CLASS_SORCERER) && (caster_ptr->pclass != CLASS_RED_MAGE)) {
* @param next_realm 変更先の魔法領域ID
* @return なし
*/
-static void change_realm2(player_type *caster_ptr, player_personality_type next_realm)
+static void change_realm2(player_type *caster_ptr, REALM_IDX next_realm)
{
int i, j = 0;
char tmp[80];
concptr p = spell_category_name(mp_ptr->spell_book);
object_type *o_ptr;
concptr q, s;
- tval_type tval = 0;
+ tval_type tval = TV_NONE;
if (!caster_ptr->realm1) {
msg_print(_("本を読むことができない!", "You cannot read books!"));
else if (g_ptr->m_idx) {
take_turn(creature_ptr, 100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
} else
more = exe_tunnel(creature_ptr, y, x);
/* Do nothing */
break;
case BACT_RESEARCH_ITEM:
- paid = identify_fully(player_ptr, FALSE, 0);
+ paid = identify_fully(player_ptr, FALSE, TV_NONE);
break;
case BACT_TOWN_HISTORY:
town_history(player_ptr);
break;
case BACT_ENCHANT_WEAPON:
item_tester_hook = object_allow_enchant_melee_weapon;
- enchant_item(player_ptr, bcost, 1, 1, 0, 0);
+ enchant_item(player_ptr, bcost, 1, 1, 0, TV_NONE);
break;
case BACT_ENCHANT_ARMOR:
item_tester_hook = object_is_armour;
- enchant_item(player_ptr, bcost, 0, 0, 1, 0);
+ enchant_item(player_ptr, bcost, 0, 0, 1, TV_NONE);
break;
case BACT_RECHARGE:
building_recharge(player_ptr);
paid = TRUE;
break;
case BACT_IDENT_ONE:
- paid = ident_spell(player_ptr, FALSE, 0);
+ paid = ident_spell(player_ptr, FALSE, TV_NONE);
break;
case BACT_LEARN:
do_cmd_study(player_ptr);
break;
case BACT_ENCHANT_ARROWS:
item_tester_hook = item_tester_hook_ammo;
- enchant_item(player_ptr, bcost, 1, 1, 0, 0);
+ enchant_item(player_ptr, bcost, 1, 1, 0, TV_NONE);
break;
case BACT_ENCHANT_BOW:
enchant_item(player_ptr, bcost, 1, 1, 0, TV_BOW);
{
concptr q = _("どのアイテムを壊しますか? ", "Destroy which item? ");
concptr s = _("壊せるアイテムを持っていない。", "You have nothing to destroy.");
- destroy_ptr->o_ptr = choose_object(creature_ptr, &destroy_ptr->item, q, s, USE_INVEN | USE_FLOOR, 0);
+ destroy_ptr->o_ptr = choose_object(creature_ptr, &destroy_ptr->item, q, s, USE_INVEN | USE_FLOOR, TV_NONE);
if (destroy_ptr->o_ptr == NULL)
return FALSE;
q = _("どれを食べますか? ", "Eat which item? ");
s = _("食べ物がない。", "You have nothing to eat.");
- if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0))
+ if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE))
return;
exe_eat_food(creature_ptr, item);
command_wrk = USE_EQUIP;
screen_save();
- (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
+ (void)show_equipment(creature_ptr, 0, USE_FULL, TV_NONE);
WEIGHT weight = calc_inventory_weight(creature_ptr);
WEIGHT weight_lim = calc_weight_limit(creature_ptr);
#ifdef JP
item_tester_hook = item_tester_hook_wear;
concptr q = _("どれを装備しますか? ", "Wear/Wield which item? ");
concptr s = _("装備可能なアイテムがない。", "You have nothing you can wear or wield.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr)
return;
item_tester_hook = item_tester_hook_melee_weapon;
q = _("どちらの武器と取り替えますか?", "Replace which weapon? ");
s = _("おっと。", "Oops.");
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), TV_NONE))
return;
if (slot == INVEN_MAIN_HAND)
item_tester_hook = item_tester_hook_mochikae;
q = _("どちらの手に装備しますか?", "Equip which hand? ");
s = _("おっと。", "Oops.");
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), 0))
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), TV_NONE))
return;
}
item_tester_hook = item_tester_hook_mochikae;
q = _("どちらの手に装備しますか?", "Equip which hand? ");
s = _("おっと。", "Oops.");
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), 0))
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP), TV_NONE))
return;
if ((slot == INVEN_SUB_HAND) && !has_melee_weapon(creature_ptr, INVEN_MAIN_HAND))
s = _("おっと。", "Oops.");
creature_ptr->select_ring_slot = TRUE;
- if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) {
+ if (!choose_object(creature_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), TV_NONE)) {
creature_ptr->select_ring_slot = FALSE;
return;
}
concptr q = _("どれを装備からはずしますか? ", "Take off which item? ");
concptr s = _("はずせる装備がない。", "You are not wearing anything to take off.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
command_wrk = USE_INVEN;
screen_save();
- (void)show_inventory(creature_ptr, 0, USE_FULL, 0);
+ (void)show_inventory(creature_ptr, 0, USE_FULL, TV_NONE);
WEIGHT weight = calc_inventory_weight(creature_ptr);
WEIGHT weight_lim = calc_weight_limit(creature_ptr);
#ifdef JP
concptr q = _("どのアイテムを落としますか? ", "Drop which item? ");
concptr s = _("落とせるアイテムを持っていない。", "You have nothing to drop.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
GAME_TEXT o_name[MAX_NLEN];
concptr q = _("どのアイテムを調べますか? ", "Examine which item? ");
concptr s = _("調べられるアイテムがない。", "You have nothing to examine.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
object_type *o_ptr;
concptr q = _("どのアイテムの銘を消しますか? ", "Un-inscribe which item? ");
concptr s = _("銘を消せるアイテムがない。", "You have nothing to un-inscribe.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
char out_val[80];
concptr q = _("どのアイテムに銘を刻みますか? ", "Inscribe which item? ");
concptr s = _("銘を刻めるアイテムがない。", "You have nothing to inscribe.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
item_tester_hook = item_tester_hook_use;
concptr q = _("どれを使いますか?", "Use which item? ");
concptr s = _("使えるものがありません。", "You have nothing to use.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
concptr q = _("どのアイテムを始動させますか? ", "Activate which item? ");
concptr s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
- if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
+ if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), TV_NONE))
return;
exe_activate(user_ptr, item);
OBJECT_SUBTYPE_VALUE ext = 0;
char choice;
bool flag, request_list;
- tval_type tval = 0;
+ tval_type tval = TV_NONE;
int ask = TRUE;
OBJECT_SUBTYPE_VALUE i = 0;
char out_val[160];
concptr s = _("飲める薬がない。", "You have no potions to quaff.");
OBJECT_IDX item;
- if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0))
+ if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE))
return;
exe_quaff_potion(creature_ptr, item);
concptr s = _("読める巻物がない。", "You have no scrolls to read.");
object_type *o_ptr;
OBJECT_IDX item;
- o_ptr = choose_object(creature_ptr, &item, q, s, USE_INVEN | USE_FLOOR, 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, USE_INVEN | USE_FLOOR, TV_NONE);
if (!o_ptr)
return;
item_tester_hook = item_tester_refill_lantern;
concptr q = _("どの油つぼから注ぎますか? ", "Refill with which flask? ");
concptr s = _("油つぼがない。", "You have no flasks of oil.");
- o_ptr = choose_object(user_ptr, &item, q, s, USE_INVEN | USE_FLOOR, 0);
+ o_ptr = choose_object(user_ptr, &item, q, s, USE_INVEN | USE_FLOOR, TV_NONE);
if (!o_ptr)
return;
item_tester_hook = object_can_refill_torch;
concptr q = _("どの松明で明かりを強めますか? ", "Refuel with which torch? ");
concptr s = _("他に松明がない。", "You have no extra torches.");
- o_ptr = choose_object(user_ptr, &item, q, s, USE_INVEN | USE_FLOOR, 0);
+ o_ptr = choose_object(user_ptr, &item, q, s, USE_INVEN | USE_FLOOR, TV_NONE);
if (!o_ptr)
return;
q = _("どのアイテムから抽出しますか?", "Extract from which item? ");
s = _("抽出できるアイテムがありません。", "You have nothing you can extract from.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return;
int use_essence;
essence_type *es_ptr;
bool able[22] = { 0 };
- tval_type tval = 0;
+ tval_type tval = TV_NONE;
int menu_line = (use_menu ? 1 : 0);
for (i = 0; essence_info[i].add_name; i++) {
q = _("どのアイテムのエッセンスを消去しますか?", "Remove from which item? ");
s = _("エッセンスを付加したアイテムがありません。", "You have nothing with added essence to remove.");
- o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr)
return;
item_tester_hook = item_tester_hook_boomerang;
*q = _("どの武器を投げますか? ", "Throw which item? ");
*s = _("投げる武器がない。", "You have nothing to throw.");
- it_ptr->o_ptr = choose_object(creature_ptr, &it_ptr->item, *q, *s, USE_EQUIP, 0);
+ it_ptr->o_ptr = choose_object(creature_ptr, &it_ptr->item, *q, *s, USE_EQUIP, TV_NONE);
if (!it_ptr->o_ptr) {
flush();
return FALSE;
q = _("どのアイテムを投げますか? ", "Throw which item? ");
s = _("投げるアイテムがない。", "You have nothing to throw.");
- it_ptr->o_ptr = choose_object(creature_ptr, &it_ptr->item, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
+ it_ptr->o_ptr = choose_object(creature_ptr, &it_ptr->item, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, TV_NONE);
if (!it_ptr->o_ptr) {
flush();
return FALSE;
int ds = it_ptr->q_ptr->ds;
torch_dice(it_ptr->q_ptr, &dd, &ds);
it_ptr->tdam = damroll(dd, ds);
- it_ptr->tdam = calc_attack_damage_with_slay(creature_ptr, it_ptr->q_ptr, it_ptr->tdam, it_ptr->m_ptr, 0, TRUE);
+ it_ptr->tdam = calc_attack_damage_with_slay(creature_ptr, it_ptr->q_ptr, it_ptr->tdam, it_ptr->m_ptr, HISSATSU_NONE, TRUE);
it_ptr->tdam = critical_shot(creature_ptr, it_ptr->q_ptr->weight, it_ptr->q_ptr->to_h, 0, it_ptr->tdam);
if (it_ptr->q_ptr->to_d > 0)
it_ptr->tdam += it_ptr->q_ptr->to_d;
return;
it_ptr->corruption_possibility = 100;
- if (!(summon_named_creature(creature_ptr, 0, it_ptr->y, it_ptr->x, it_ptr->q_ptr->pval, !(object_is_cursed(it_ptr->q_ptr)) ? PM_FORCE_PET : 0L))) {
+ if (!(summon_named_creature(creature_ptr, 0, it_ptr->y, it_ptr->x, it_ptr->q_ptr->pval, !(object_is_cursed(it_ptr->q_ptr)) ? PM_FORCE_PET : PM_NONE))) {
msg_print(_("人形は捻じ曲がり砕け散ってしまった!", "The Figurine writhes and then shatters."));
return;
}
process_boomerang_back(creature_ptr, it_ptr);
drop_thrown_item(creature_ptr, it_ptr);
return TRUE;
-}
\ No newline at end of file
+}
int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known)
{
int k;
- int ident = FALSE;
+ bool ident = FALSE;
PLAYER_LEVEL lev = powerful ? creature_ptr->lev * 2 : creature_ptr->lev;
POSITION detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
case SV_STAFF_SUMMONING: {
const int times = randint1(powerful ? 8 : 4);
for (k = 0; k < times; k++) {
- if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0,
+ if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_NONE,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) {
ident = TRUE;
}
case SV_STAFF_IDENTIFY: {
if (powerful) {
- if (!identify_fully(creature_ptr, FALSE, 0))
+ if (!identify_fully(creature_ptr, FALSE, TV_NONE))
*use_charge = FALSE;
} else {
- if (!ident_spell(creature_ptr, FALSE, 0))
+ if (!ident_spell(creature_ptr, FALSE, TV_NONE))
*use_charge = FALSE;
}
ident = TRUE;
}
case SV_STAFF_REMOVE_CURSE: {
- bool result = powerful ? remove_all_curse(creature_ptr) : remove_curse(creature_ptr);
+ bool result = (powerful ? remove_all_curse(creature_ptr) : remove_curse(creature_ptr)) != 0;
if (result) {
ident = TRUE;
}
case SV_ROD_IDENTIFY: {
if (powerful) {
- if (!identify_fully(creature_ptr, FALSE, 0))
+ if (!identify_fully(creature_ptr, FALSE, TV_NONE))
*use_charge = FALSE;
} else {
- if (!ident_spell(creature_ptr, FALSE, 0))
+ if (!ident_spell(creature_ptr, FALSE, TV_NONE))
*use_charge = FALSE;
}
ident = TRUE;
#pragma once
-typedef enum combat_options {
+enum combat_options {
HISSATSU_NONE = 0,
HISSATSU_2 = 1,
HISSATSU_3WAY = 2,
HISSATSU_3DAN = 29,
HISSATSU_100NIN = 30,
HISSATSU_IAI = 100,
-} combat_options;
+};
#pragma once
-typedef enum player_redraw_type {
+enum player_redraw_type {
PR_MISC = 0x00000001L, /*!< 再描画フラグ: 種族と職業 / Display Race/Class */
PR_TITLE = 0x00000002L, /*!< 再描画フラグ: 称号 / Display Title */
PR_LEV = 0x00000004L, /*!< 再描画フラグ: レベル / Display Level */
PR_BASIC = 0x02000000L, /*!< 再描画フラグ: 基本ステータス全体 / Display Basic Info */
PR_MAP = 0x04000000L, /*!< 再描画フラグ: ゲームマップ / Display Map */
PR_WIPE = 0x08000000L, /*!< 再描画フラグ: 画面消去 / Hack -- Total Redraw */
-} player_redraw_type;
+};
#pragma once
-typedef enum player_update_type {
+enum player_update_type {
PU_BONUS = 0x00000001L, /*!< ステータス更新フラグ: 能力値修正 / Calculate bonuses */
PU_TORCH = 0x00000002L, /*!< ステータス更新フラグ: 光源半径 / Calculate torch radius */
PU_HP = 0x00000010L, /*!< ステータス更新フラグ: HP / Calculate chp and mhp */
PU_MONSTERS = 0x01000000L, /*!< ステータス更新フラグ: モンスターのステータス / Update monsters */
PU_DISTANCE = 0x02000000L, /*!< ステータス更新フラグ: プレイヤーとモンスターの距離 / Update distances */
PU_FLOW = 0x10000000L, /*!< ステータス更新フラグ: プレイヤーから各マスへの到達距離 / Update flow */
-} player_update_type;
+};
errr top_twenty(player_type *current_player_ptr)
{
high_score the_score;
+ char buf[32];
(void)WIPE(&the_score, high_score);
/* Save the version */
/* Save the player info */
sprintf(the_score.uid, "%7u", current_player_ptr->player_uid);
sprintf(the_score.sex, "%c", (current_player_ptr->psex ? 'm' : 'f'));
- sprintf(the_score.p_r, "%2d", MIN(current_player_ptr->prace, MAX_RACES));
- sprintf(the_score.p_c, "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
- sprintf(the_score.p_a, "%2d", MIN(current_player_ptr->pseikaku, MAX_PERSONALITIES));
+ snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->prace, MAX_RACES));
+ memcpy(the_score.p_r, buf, 3);
+ snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
+ memcpy(the_score.p_c, buf, 3);
+ snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pseikaku, MAX_PERSONALITIES));
+ memcpy(the_score.p_r, buf, 3);
/* Save the level and such */
sprintf(the_score.cur_lev, "%3d", MIN((u16b)current_player_ptr->lev, 999));
errr predict_score(player_type *current_player_ptr)
{
high_score the_score;
+ char buf[32];
/* No score file */
if (highscore_fd < 0)
/* Save the player info */
sprintf(the_score.uid, "%7u", current_player_ptr->player_uid);
sprintf(the_score.sex, "%c", (current_player_ptr->psex ? 'm' : 'f'));
- sprintf(the_score.p_r, "%2d", MIN(current_player_ptr->prace, MAX_RACES));
- sprintf(the_score.p_c, "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
- sprintf(the_score.p_a, "%2d", MIN(current_player_ptr->pseikaku, MAX_PERSONALITIES));
+ snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->prace, MAX_RACES));
+ memcpy(the_score.p_r, buf, 3);
+ snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
+ memcpy(the_score.p_c, buf, 3);
+ snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pseikaku, MAX_PERSONALITIES));
+ memcpy(the_score.p_a, buf, 3);
/* Save the level and such */
sprintf(the_score.cur_lev, "%3d", MIN((u16b)current_player_ptr->lev, 999));
*/
void race_score(player_type *current_player_ptr, int race_num)
{
- register int i = 0, j, m = 0;
+ int i = 0, j, m = 0;
int pr, clev, lastlev;
high_score the_score;
char buf[1024], out_val[256], tmp_str[80];
int k = str[7] - 'A';
menu = TRUE;
if ((str[8] == ']') && (str[9] == ' ')) {
- strncpy(hook[k], str + 10, 31);
+ memcpy(hook[k], str + 10, 31);
hook[k][31] = '\0';
}
r_ptr->x_char = r_ptr->d_char;
}
- char *pref_file = use_graphics ? "graf.prf" : "font.prf";
- char *base_name = use_graphics ? "graf-%s.prf" : "font-%s.prf";
+ concptr pref_file = use_graphics ? "graf.prf" : "font.prf";
+ concptr base_name = use_graphics ? "graf-%s.prf" : "font-%s.prf";
char buf[1024];
process_pref_file(owner_ptr, pref_file, process_autopick_file_command);
sprintf(buf, base_name, owner_ptr->base_name);
if (window_flags & (PW_INVEN)) {
player_ptr->window_flags &= ~(PW_INVEN);
- fix_inventory(player_ptr, 0); // TODO:2.2.2 まともなtval参照手段を確保
+ fix_inventory(player_ptr, TV_NONE); // TODO:2.2.2 まともなtval参照手段を確保
}
if (window_flags & (PW_EQUIP)) {
player_ptr->window_flags &= ~(PW_EQUIP);
- fix_equip(player_ptr, 0); // TODO:2.2.2 まともなtval参照手段を確保
+ fix_equip(player_ptr, TV_NONE); // TODO:2.2.2 まともなtval参照手段を確保
}
if (window_flags & (PW_SPELL)) {
#include "system/angband.h"
-typedef enum window_redraw_type {
+enum window_redraw_type {
PW_INVEN = 0x00000001L, /*!<サブウィンドウ描画フラグ: 所持品-装備品 / Display inven/equip */
PW_EQUIP = 0x00000002L, /*!<サブウィンドウ描画フラグ: 装備品-所持品 / Display equip/inven */
PW_SPELL = 0x00000004L, /*!<サブウィンドウ描画フラグ: 魔法一覧 / Display spell list */
PW_SNAPSHOT = 0x00000800L, /*!<サブウィンドウ描画フラグ: 記念写真 / Display snap-shot */
PW_ALL = (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER_LIST | PW_MESSAGE | PW_OVERHEAD | PW_MONSTER | PW_OBJECT | PW_DUNGEON | PW_SNAPSHOT),
-} window_redraw_type;
+};
void redraw_window(void);
void window_stuff(player_type *player_ptr);
#pragma once
-typedef enum dungeon_flag_type {
+enum dungeon_flag_type {
DF1_WINNER = 0x00000001L,
DF1_MAZE = 0x00000002L,
DF1_SMALLEST = 0x00000004L,
DF1_DARKNESS = 0x20000000L,
DF1_ACID_RIVER = 0x40000000L,
DF1_POISONOUS_RIVER = 0x80000000L,
-} dungeon_flag_type;
+};
#define DF1_LAKE_MASK (DF1_LAKE_WATER | DF1_LAKE_LAVA | DF1_LAKE_RUBBLE | DF1_LAKE_TREE | DF1_LAKE_POISONOUS | DF1_LAKE_ACID)
health_track(player_ptr, 0);
disturb(player_ptr, TRUE, TRUE);
- int quest_num = quest_num = quest_number(player_ptr, floor_ptr->dun_level);
+ int quest_num = quest_number(player_ptr, floor_ptr->dun_level);
if (quest_num) {
r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
}
/*
* project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
*/
-typedef enum effect_characteristics {
+enum effect_characteristics {
PROJECT_NONE = 0x0000,
PROJECT_JUMP = 0x0001, /*!< 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */
PROJECT_BEAM = 0x0002, /*!< ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */
PROJECT_PATH = 0x2000, /*!< 軌跡の表示 / Only used for printing project path */
PROJECT_FAST = 0x4000, /*!< 炸裂するまで画面上に表示しない / Hide "visual" of flying bolts until blast */
PROJECT_LOS = 0x8000 /*!< 視線が通っているか(?) / Line of sight */
-} effect_characteristics;
+};
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_charm(player_type *caster_ptr, effect_monster_type *em_ptr);
process_result effect_monster_control_undead(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_curse_1(effect_monster_type *em_ptr);
process_result effect_monster_curse_2(effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_away_undead(player_type *caster_ptr, effect_monster_type *em_ptr);
process_result effect_monster_away_evil(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_lite_weak(player_type *caster_ptr, effect_monster_type *em_ptr);
process_result effect_monster_lite(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_old_poly(effect_monster_type *em_ptr);
process_result effect_monster_old_clone(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_psi(player_type *caster_ptr, effect_monster_type *em_ptr);
process_result effect_monster_psi_drain(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_void(effect_monster_type *em_ptr);
process_result effect_monster_acid(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result effect_monster_drain_mana(player_type *caster_ptr, effect_monster_type *em_ptr);
process_result effect_monster_mind_blast(player_type *caster_ptr, effect_monster_type *em_ptr);
case GF_CAPTURE:
return effect_monster_capture(caster_ptr, em_ptr);
case GF_ATTACK:
- return (process_result)do_cmd_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
+ return (process_result)do_cmd_attack(caster_ptr, em_ptr->y, em_ptr->x, static_cast<combat_options>(em_ptr->dam));
case GF_ENGETSU:
return effect_monster_engetsu(caster_ptr, em_ptr);
case GF_GENOCIDE:
return PROCESS_CONTINUE;
}
}
-}
\ No newline at end of file
+}
#include "system/angband.h"
-typedef enum process_result process_resut;
+enum process_result;
typedef struct effect_monster_type effect_monster_type;
process_result switch_effects_monster(player_type *caster_ptr, effect_monster_type *em_ptr);
if (!em_ptr->who)
chg_virtue(caster_ptr, V_VALOUR, -1);
- teleport_away(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_dist, (!em_ptr->who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
+ teleport_flags tflag = static_cast<teleport_flags>((!em_ptr->who ? TELEPORT_DEC_VALOUR : TELEPORT_SPONTANEOUS) | TELEPORT_PASSIVE);
+ teleport_away(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_dist, tflag);
em_ptr->y = em_ptr->m_ptr->fy;
em_ptr->x = em_ptr->m_ptr->fx;
postprocess_spell(caster_ptr, em_ptr);
return em_ptr->obvious;
-}
\ No newline at end of file
+}
"", // GF_WOUNDS = 116, /*!< 魔法効果: 創傷*/
};
-typedef enum effect_player_check_result {
+enum ep_check_result {
EP_CHECK_FALSE = 0,
EP_CHECK_TRUE = 1,
EP_CHECK_CONTINUE = 2,
-} ep_check_result;
+};
/*!
* @brief effect_player_type構造体を初期化する
effect_player_type *ep_ptr = initialize_effect_player(&tmp_effect, who, dam, effect_type, flag, monspell);
ep_check_result check_result = check_continue_player_effect(target_ptr, ep_ptr, y, x, project);
if (check_result != EP_CHECK_CONTINUE)
- return check_result;
+ return (bool)check_result;
if (ep_ptr->dam > 1600)
ep_ptr->dam = 1600;
#pragma once
-typedef enum object_description_type {
+enum object_description_type {
OD_NAME_ONLY = 0x00000001, /* Omit values, pval, inscription */
OD_NAME_AND_ENCHANT = 0x00000002, /* Omit pval, inscription */
OD_OMIT_INSCRIPTION = 0x00000004, /* Omit inscription */
OD_NO_FLAVOR = 0x00000040, /* Allow to hidden flavor */
OD_FORCE_FLAVOR = 0x00000080, /* Get un-shuffled flavor name */
OD_DEBUG = 0x10000000, /* Print for DEBUG */
-} object_description_type;
+};
#include "system/angband.h"
-typedef enum feature_flag_type feature_flag_type;
+enum feature_flag_type : int;
typedef struct grid_type grid_type;
bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x);
bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x);
artifact_type *a_ptr;
if (num < 9)
- return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+ return TRUE;
q_ptr->type = (QUEST_TYPE)atoi(zz[2]);
q_ptr->num_mon = (MONSTER_NUMBER)atoi(zz[3]);
return PARSE_ERROR_NONE;
}
- parse_error_type parse_result_Q = parse_qtw_Q(qtwg_ptr, zz);
+ parse_error_type parse_result_Q = static_cast<parse_error_type>(parse_qtw_Q(qtwg_ptr, zz));
if (parse_result_Q != PARSE_CONTINUE)
return parse_result_Q;
return PARSE_ERROR_NONE;
return PARSE_ERROR_GENERIC;
-}
\ No newline at end of file
+}
int *x;
} qtwg_type;
-typedef errr (*process_dungeon_file_pf)(player_type *, concptr, int, int, int, int);
+typedef parse_error_type (*process_dungeon_file_pf)(player_type *, concptr, int, int, int, int);
qtwg_type *initialize_quest_generator_type(qtwg_type *qg_ptr, char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x);
parse_error_type generate_fixed_map_floor(player_type *player_ptr, qtwg_type *qg_ptr, process_dungeon_file_pf parse_fixed_map);
#pragma once
/* Dungeon allocation "places" */
-typedef enum dap_type {
+enum dap_type : int {
ALLOC_SET_CORR = 1, /* Hallway */
ALLOC_SET_ROOM = 2, /* Room */
ALLOC_SET_BOTH = 3, /* Anywhere */
-} dap_type;
+};
/* Dungeon allocation "types" */
-typedef enum dungeon_allocation_type {
+enum dungeon_allocation_type {
ALLOC_TYP_RUBBLE = 1, /* Rubble */
ALLOC_TYP_TRAP = 3, /* Trap */
ALLOC_TYP_GOLD = 4, /* Gold */
ALLOC_TYP_OBJECT = 5, /* Object */
ALLOC_TYP_INVIS = 6, /* Invisible wall */
-} dungeon_allocation_type;
+};
assert(cap > 0);
Vec vec = { .len = 0, .cap = cap, .data = NULL };
- vec.data = malloc(sizeof(int) * cap);
+ vec.data = static_cast<int*>(malloc(sizeof(int) * cap));
if (!vec.data)
rpanic(cap);
// 容量不足になったら容量を拡張する。
if (vec->len == vec->cap) {
vec->cap = vec->cap > 0 ? 2 * vec->cap : 1;
- vec->data = realloc(vec->data, sizeof(int) * vec->cap);
+ vec->data = static_cast<int*>(realloc(vec->data, sizeof(int) * vec->cap));
if (!vec->data)
rpanic(vec->cap);
}
#include "system/angband.h"
// Change Floor Mode.
-typedef enum cfm_type {
+enum cfm_type {
CFM_UP = 0x0001, /* Move up */
CFM_DOWN = 0x0002, /* Move down */
CFM_LONG_STAIRS = 0x0004, /* Randomly occurred long stairs/shaft */
CFM_SAVE_FLOORS = 0x0080, /* Save floors */
CFM_NO_RETURN = 0x0100, /* Flee from random quest etc... */
CFM_FIRST_FLOOR = 0x0200, /* Create exit from the dungeon */
-} cfm_type;
+};
void prepare_change_floor_mode(player_type *creature_ptr, BIT_FLAGS mode);
#include "system/angband.h"
-typedef enum dap_type dap_type;
+enum dap_type : int;
bool alloc_stairs(player_type *owner_ptr, FEAT_IDX feat, int num, int walls);
void alloc_object(player_type *owner_ptr, dap_type set, EFFECT_ID typ, int num);
/*!
* @brief scan_floor_items() の動作を指定するフラグたち。
*/
-typedef enum scan_floor_mode {
+enum scan_floor_mode {
SCAN_FLOOR_ITEM_TESTER = 1U << 0, /*!< item_tester_hook によるフィルタリングを適用する */
SCAN_FLOOR_ONLY_MARKED = 1U << 1, /*!< マークされたアイテムのみを対象とする */
SCAN_FLOOR_AT_MOST_ONE = 1U << 2, /*!< 高々1つのアイテムしか取得しない */
-} scan_floor_mode;
+};
ITEM_NUMBER scan_floor_items(player_type *owner_ptr, OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode, tval_type item_tester_tval);
COMMAND_CODE show_floor_items(player_type *owner_ptr, int target_item, POSITION y, POSITION x, TERM_LEN *min_width, tval_type item_tester_tval);
floor_ptr->object_level = floor_ptr->base_level;
if (player_ptr->town_num) {
init_buildings();
- if (border | corner)
- init_flags = INIT_CREATE_DUNGEON | INIT_ONLY_FEATURES;
+ if (border || corner)
+ init_flags = static_cast<init_flags_type>(INIT_CREATE_DUNGEON | INIT_ONLY_FEATURES);
else
init_flags = INIT_CREATE_DUNGEON;
* @param x 広域マップの幅を返す参照ポインタ
* @return なし
*/
-errr parse_line_wilderness(player_type *creature_ptr, char *buf, int xmin, int xmax, int *y, int *x)
+parse_error_type parse_line_wilderness(player_type *creature_ptr, char *buf, int xmin, int xmax, int *y, int *x)
{
if (!(buf[0] == 'W'))
return (PARSE_ERROR_GENERIC);
/* Process "W:F:<letter>:<terrain>:<town>:<road>:<name> */
#ifdef JP
case 'E':
- return 0;
+ return PARSE_ERROR_NONE;
case 'F':
case 'J':
#else
case 'J':
- return 0;
+ return PARSE_ERROR_NONE;
case 'F':
case 'E':
#endif
int index = zz[0][0];
if (num > 1)
- w_letter[index].terrain = atoi(zz[1]);
+ w_letter[index].terrain = static_cast<wt_type>(atoi(zz[1]));
else
- w_letter[index].terrain = 0;
+ w_letter[index].terrain = TERRAIN_EDGE;
if (num > 2)
w_letter[index].level = (s16b)atoi(zz[2]);
}
}
- return 0;
+ return PARSE_ERROR_NONE;
}
/*!
#define NO_TOWN 6
#define SECRET_TOWN 5
+enum parse_error_type : int;
+
/* Wilderness Terrains */
-typedef enum wt_type {
+enum wt_type {
TERRAIN_EDGE = 0, /* Edge of the World */
TERRAIN_TOWN = 1, /* Town */
TERRAIN_DEEP_WATER = 2, /* Deep water */
TERRAIN_DEEP_LAVA = 10, /* Deep lava */
TERRAIN_MOUNTAIN = 11, /* Mountain */
MAX_WILDERNESS = 12, /* Maximum wilderness index */
-} wt_type;
+};
void set_floor_and_wall(DUNGEON_IDX type);
void wilderness_gen(player_type *creature_ptr);
errr init_wilderness(void);
void init_wilderness_terrains(void);
void seed_wilderness(void);
-errr parse_line_wilderness(player_type *creature_ptr, char *buf, int xmin, int xmax, int *y, int *x);
+parse_error_type parse_line_wilderness(player_type *creature_ptr, char *buf, int xmin, int xmax, int *y, int *x);
bool change_wild_mode(player_type *creature_ptr, bool encount);
/*
#pragma once
-typedef enum cheat_type {
+enum cheat_type {
CHEAT_OBJECT = 0,
CHEAT_MONSTER = 1,
CHEAT_DUNGEON = 2,
CHEAT_MISC = 3,
-} cheat_type;
+};
#pragma once
-typedef enum keymap_mode {
+enum keymap_mode {
KEYMAP_MODE_ORIG = 0, /*!< オリジナルキー配置 / Mode for original keyset commands */
KEYMAP_MODE_ROGUE = 1, /*!< ローグライクキー配置 / Mode for roguelike keyset commands */
KEYMAP_MODES = 2, /*!< キー配置の数 / Number of keymap modes */
-} keymap_mode;
+};
int get_keymap_dir(char ch);
* Originally from UnAngband, and modified into TR-like style in Hengband
*/
-typedef enum feature_flag_type {
+enum feature_flag_type : int {
FF_LOS = 0, /*!< 視界が通る地形である */
FF_PROJECT = 1, /*!< 飛び道具が通過できる地形である */
FF_MOVE = 2, /*!< 移動可能な地形である */
FF_CONVERT = 111, /*!< 地形生成処理中の疑似フラグ */
FF_GLASS = 112, /*!< ガラス製の地形である */
FF_FLAG_MAX = 113
-} feature_flag_type;
+};
#define FF_FLAG_SIZE (1 + ((FF_FLAG_MAX - 1) / 32))
extern bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode);
extern bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, teleport_flags mode);
-typedef enum grid_bold_type
+enum grid_bold_type
{
GB_FLOOR,
GB_EXTRA,
GB_SOLID,
GB_SOLID_PERM,
GB_SOLID_NOPERM
-} grid_bold_type;
+};
void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type pg_type);
bool darkened_grid(player_type *player_ptr, grid_type *g_ptr);
msg_print(_("何かがピカッと光った!", "There is a flash of shimmering light!"));
num = 2 + randint1(3);
for (i = 0; i < num; i++) {
- (void)summon_specific(trapped_ptr, 0, y, x, trapped_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(trapped_ptr, 0, y, x, trapped_ptr->current_floor_ptr->dun_level, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
if (trapped_ptr->current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
cave_alter_feat(trapped_ptr, y, x, FF_DISARM);
msg_print(_("トラップを粉砕した。", "You destroyed the trap."));
}
-}
\ No newline at end of file
+}
* @param xmax 詳細不明
* @return エラーコード
*/
-errr parse_fixed_map(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax)
+parse_error_type parse_fixed_map(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax)
{
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, name);
FILE *fp = angband_fopen(buf, "r");
if (fp == NULL)
- return -1;
+ return PARSE_ERROR_GENERIC;
int num = -1;
parse_error_type err = PARSE_ERROR_NONE;
#include "info-reader/info-reader-util.h"
#include "info-reader/parse-error-types.h"
-errr parse_fixed_map(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax);
+parse_error_type parse_fixed_map(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax);
* @param buf 解析文字列
* @return エラーコード
*/
-errr parse_line_feature(floor_type *floor_ptr, char *buf)
+parse_error_type parse_line_feature(floor_type *floor_ptr, char *buf)
{
if (init_flags & INIT_ONLY_BUILDINGS)
- return 0;
+ return PARSE_ERROR_NONE;
char *zz[9];
int num = tokenize(buf + 2, 9, zz, 0);
if (num <= 1)
- return 1;
+ return PARSE_ERROR_GENERIC;
int index = zz[0][0];
letter[index].feature = feat_none;
break;
}
- return 0;
+ return PARSE_ERROR_NONE;
}
/*!
* @param buf 解析文字列
* @return エラーコード
*/
-errr parse_line_building(char *buf)
+parse_error_type parse_line_building(char *buf)
{
char *zz[1000];
char *s;
#ifdef JP
if (buf[2] == '$')
- return 0;
+ return PARSE_ERROR_NONE;
s = buf + 2;
#else
if (buf[2] != '$')
- return 0;
+ return PARSE_ERROR_NONE;
s = buf + 3;
#endif
int index = atoi(s);
s = angband_strchr(s, ':');
if (!s)
- return 1;
+ return PARSE_ERROR_GENERIC;
*s++ = '\0';
if (!*s)
- return 1;
+ return PARSE_ERROR_GENERIC;
switch (s[0]) {
case 'N': {
int n;
n = tokenize(s + 2, MAX_CLASS, zz, 0);
for (int i = 0; i < MAX_CLASS; i++) {
- building[index].member_class[i] = ((i < n) ? (player_class_type)atoi(zz[i]) : 1);
+ building[index].member_class[i] = static_cast<player_class_type>((i < n) ? atoi(zz[i]) : 1);
}
break;
int n;
n = tokenize(s + 2, MAX_RACES, zz, 0);
for (int i = 0; i < MAX_RACES; i++) {
- building[index].member_race[i] = ((i < n) ? (player_race_type)atoi(zz[i]) : 1);
+ building[index].member_race[i] = static_cast<player_race_type>((i < n) ? atoi(zz[i]) : 1);
}
break;
}
}
- return 0;
+ return PARSE_ERROR_NONE;
}
#include "system/angband.h"
+enum parse_error_type : int;
+
typedef struct dungeon_grid {
FEAT_IDX feature; /* Terrain feature */
MONSTER_IDX monster; /* Monster */
typedef struct angband_header angband_header;
typedef errr (*parse_info_txt_func)(char *buf, angband_header *head);
errr init_info_txt(FILE *fp, char *buf, angband_header *head, parse_info_txt_func parse_info_txt_line);
-errr parse_line_feature(floor_type *floor_ptr, char *buf);
-errr parse_line_building(char *buf);
+parse_error_type parse_line_feature(floor_type *floor_ptr, char *buf);
+parse_error_type parse_line_building(char *buf);
else if (streq(book, "HISSATSU"))
m_ptr->spell_book = TV_HISSATSU_BOOK;
else if (streq(book, "NONE"))
- m_ptr->spell_book = 0;
+ m_ptr->spell_book = TV_NONE;
else
return 5;
#pragma once
-typedef enum parse_error_type {
+enum parse_error_type : int {
PARSE_ERROR_NONE = 0,
PARSE_ERROR_GENERIC = 1,
PARSE_ERROR_ABSOLETE_FILE = 2,
PARSE_ERROR_TOO_FEW_ARGUMENTS = 9,
PARSE_ERROR_UNDEFINED_TERRAIN_TAG = 10,
PARSE_ERROR_MAX = 11,
-} parse_error_type;
+};
#pragma once
/* Random dungeon grid effects */
-typedef enum rdge_type {
+enum rdge_type {
RANDOM_NONE = 0x00000000,
RANDOM_FEATURE = 0x00000001,
RANDOM_MONSTER = 0x00000002,
RANDOM_EGO = 0x00000008,
RANDOM_ARTIFACT = 0x00000010,
RANDOM_TRAP = 0x00000020,
-} rdge_type;
+};
= scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, fis_ptr->tval);
if (get_tag_floor(owner_ptr->current_floor_ptr, &fis_ptr->k, *prev_tag, fis_ptr->floor_list, fis_ptr->floor_num)) {
*fis_ptr->cp = 0 - fis_ptr->floor_list[fis_ptr->k];
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
if (!item_tester_okay(owner_ptr, &owner_ptr->current_floor_ptr->o_list[0 - (*fis_ptr->cp)], fis_ptr->tval) && ((fis_ptr->mode & USE_FULL) == 0))
return FALSE;
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
return get_floor_item_tag_inventory(owner_ptr, fis_ptr, prev_tag);
if (get_item_okay(owner_ptr, *fis_ptr->cp, fis_ptr->tval)) {
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
return FALSE;
if (fis_ptr->force && (*fis_ptr->cp == INVEN_FORCE)) {
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
if (!use_menu)
return;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
if (owner_ptr->select_ring_slot ? is_ring_slot(i)
: item_tester_okay(owner_ptr, &owner_ptr->inventory_list[i], fis_ptr->tval) || (fis_ptr->mode & USE_FULL))
fis_ptr->max_equip++;
command_see = FALSE;
}
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
if (fis_ptr->toggle)
toggle_inventory_equipment(owner_ptr);
if (!is_specific_curse(flag))
return;
- tr_type cf = 0;
+ tr_type cf = TR_STR;
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(creature_ptr, o_ptr, flgs);
switch (flag) {
if (!(creature_ptr->cursed & flag))
return NULL;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
if (o_ptr->curse_flags & flag) {
choices[number] = i;
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
int i_keep = 0, count = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
#pragma once
-typedef enum inventory_slot_type {
+enum inventory_slot_type {
INVEN_PACK = 23, /*!< アイテムスロット…所持品(0~) */
INVEN_MAIN_HAND = 24, /*!< アイテムスロット…利手 */
INVEN_SUB_HAND = 25, /*!< アイテムスロット…逆手 */
INVEN_TOTAL = 36, /*!< Total number of inventory_list slots (hard-coded). */
INVEN_NONE = 1000, /*!< アイテムスロット非選択状態 */
INVEN_FORCE = 1111, /*!< inventory_list slot for selecting force (hard-coded). */
-} inventory_slot_type;
+};
if (!item_tester_okay(owner_ptr, o_ptr, item_selection_ptr->tval) && ((item_selection_ptr->mode & USE_FULL) == 0))
return FALSE;
- item_selection_ptr->tval = 0;
+ item_selection_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
}
*item_selection_ptr->cp = item_selection_ptr->k;
- item_selection_ptr->tval = 0;
+ item_selection_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
if (!get_item_okay(owner_ptr, *item_selection_ptr->cp, item_selection_ptr->tval))
return FALSE;
- item_selection_ptr->tval = 0;
+ item_selection_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
return FALSE;
if (item_selection_ptr->mode & USE_FORCE && (*item_selection_ptr->cp == INVEN_FORCE)) {
- item_selection_ptr->tval = 0;
+ item_selection_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
command_see = FALSE;
}
- item_selection_ptr->tval = 0;
+ item_selection_ptr->tval = TV_NONE;
item_tester_hook = NULL;
if (item_selection_ptr->toggle)
toggle_inventory_equipment(owner_ptr);
item_tester_hook = check_store_item_to_inventory;
concptr q = _("どれを拾いますか?", "Get which item? ");
concptr s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
- if (choose_object(owner_ptr, &item, q, s, (USE_FLOOR), 0))
+ if (choose_object(owner_ptr, &item, q, s, (USE_FLOOR), TV_NONE))
this_o_idx = 0 - item;
else
return FALSE;
GAME_TEXT o_name[MAX_NLEN];
if (creature_ptr->equip_cnt) {
fprintf(fff, _(" [キャラクタの装備]\n\n", " [Character Equipment]\n\n"));
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
describe_flavor(creature_ptr, o_name, &creature_ptr->inventory_list[i], 0);
if ((((i == INVEN_MAIN_HAND) && can_attack_with_sub_hand(creature_ptr)) || ((i == INVEN_SUB_HAND) && can_attack_with_main_hand(creature_ptr)))
&& has_two_handed_weapons(creature_ptr))
sprintf(buf, "Random artifacts list.\r");
spoiler_underline(buf);
for (int j = 0; group_artifact[j].tval; j++) {
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
q_ptr = &creature_ptr->inventory_list[i];
spoil_random_artifact_aux(creature_ptr, q_ptr, j);
}
fprintf(fff, _("\n\n [取り込んだ魔法道具]\n", "\n\n [Magic devices eaten]\n"));
for (int ext = 0; ext < 3; ext++) {
- tval_type tval = 0;
+ tval_type tval = TV_NONE;
switch (ext) {
case 0:
tval = TV_STAFF;
for (int spell_type = 1; spell_type < 6; spell_type++) {
col++;
learnt_spell_table learnt_magic;
- add_monster_spell_type(p, col, spell_type, &learnt_magic);
+ add_monster_spell_type(p, col, static_cast<blue_magic_type>(spell_type), &learnt_magic);
int num = 0;
for (int i = 0; i < 32; i++) {
/* 文字列の長さを調べ、必要なメモリを確保 */
len = strlen(s);
- proxy = malloc(len + 1);
+ proxy = static_cast<char*>(malloc(len + 1));
/* ポート番号があるかどうかを調べ、あればproxy_portに設定。 */
--len;
}
max_num = i;
- kisuu = max_num % 2;
+ kisuu = (max_num % 2) == 1;
put_str(_("》", "> "), basey + 1 + num / 2, basex + 2 + (num % 2) * 24);
move_cursor_relative(player_ptr->y, player_ptr->x);
caretcmd = command_cmd;
#endif
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &player_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
}
prt("", 0, 0);
-}
\ No newline at end of file
+}
fresh_queue.next = fresh_queue.tail = 0;
ring.wptr = ring.rptr = ring.inlen = 0;
fresh_queue.time[0] = 0;
- ring.buf = malloc(RINGBUF_SIZE);
+ ring.buf = static_cast<char*>(malloc(RINGBUF_SIZE));
if (ring.buf == NULL)
return -1;
static BUF *buf_new(void)
{
BUF *p;
- p = malloc(sizeof(BUF));
+ p = static_cast<BUF*>(malloc(sizeof(BUF)));
if (!p)
return NULL;
p->size = 0;
p->max_size = BUFSIZE;
- p->data = malloc(BUFSIZE);
+ p->data = static_cast<char*>(malloc(BUFSIZE));
if (!p->data) {
free(p);
return NULL;
{
while (buf->size + size > buf->max_size) {
char *tmp;
- if ((tmp = malloc(buf->max_size * 2)) == NULL)
+ if ((tmp = static_cast<char*>(malloc(buf->max_size * 2))) == NULL)
return -1;
memcpy(tmp, buf->data, buf->max_size);
size_t read_callback(char *buffer, size_t size, size_t nitems, void *userdata)
{
- BUF *buf = userdata;
+ BUF *buf = static_cast<BUF*>(userdata);
const size_t remain = buf->size - buf->read_head;
const size_t copy_size = MIN(size * nitems, remain);
{
char where[32];
strcpy(where, _("装", "E "));
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
if (!check_item_knowledge(o_ptr, tval))
continue;
fprintf(fff, "%s\n", inven_res_label);
int label_number = 0;
- for (tval_type tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++) {
+ for (int tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++) {
reset_label_number(&label_number, fff);
- show_wearing_equipment_resistances(creature_ptr, tval, &label_number, fff);
- show_holding_equipment_resistances(creature_ptr, tval, &label_number, fff);
- show_home_equipment_resistances(creature_ptr, tval, &label_number, fff);
+ show_wearing_equipment_resistances(creature_ptr, static_cast<tval_type>(tval), &label_number, fff);
+ show_holding_equipment_resistances(creature_ptr, static_cast<tval_type>(tval), &label_number, fff);
+ show_home_equipment_resistances(creature_ptr, static_cast<tval_type>(tval), &label_number, fff);
}
angband_fclose(fff);
continue;
#ifdef JP
- char *number_of_kills = angband_strchr("pt", r_ptr->d_char) ? "人" : "体";
+ concptr number_of_kills = angband_strchr("pt", r_ptr->d_char) ? "人" : "体";
fprintf(fff, " %3d %sの %s\n", (int)this_monster, number_of_kills, r_name + r_ptr->name);
#else
if (this_monster < 2) {
/* Type/Subtype */
rd_byte(&tmp8u);
- o_ptr->tval = tmp8u;
+ o_ptr->tval = static_cast<tval_type>(tmp8u);
rd_byte(&tmp8u);
o_ptr->sval = tmp8u;
#include "system/monster-type-definition.h"
// TODO: 更に分割する可能性が中程度あるのでヘッダに置いておく
-typedef enum old_monster_resistance_type {
+enum old_monster_resistance_type {
RF3_IM_ACID = 0x00010000, /* Resist acid a lot */
RF3_IM_ELEC = 0x00020000, /* Resist elec a lot */
RF3_IM_FIRE = 0x00040000, /* Resist fire a lot */
RF3_RES_NEXU = 0x02000000, /* Resist nexus */
RF3_RES_DISE = 0x04000000, /* Resist disenchantment */
RF3_RES_ALL = 0x08000000, /* Resist all */
-} old_monster_resistance_type;
+};
-typedef enum old_monster_breath_type {
+enum old_monster_breath_type {
RF4_BR_LITE = 0x00004000, /* Breathe Lite */
RF4_BR_DARK = 0x00008000, /* Breathe Dark */
RF4_BR_CONF = 0x00010000, /* Breathe Confusion */
RF4_BR_GRAV = 0x00800000, /* Breathe Gravity */
RF4_BR_SHAR = 0x01000000, /* Breathe Shards */
RF4_BR_WALL = 0x04000000, /* Breathe Force */
-} old_monster_breath_type;
+};
extern const int OLD_QUEST_WATER_CAVE;
extern const int QUEST_OLD_CASTLE;
{
if (z_older_than(10, 2, 2) && (creature_ptr->pclass == CLASS_BEASTMASTER) && !creature_ptr->is_dead) {
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
}
if (z_older_than(10, 3, 2) && (creature_ptr->pclass == CLASS_ARCHER) && !creature_ptr->is_dead) {
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
}
if (z_older_than(10, 2, 6) && (creature_ptr->pclass == CLASS_SORCERER) && !creature_ptr->is_dead) {
creature_ptr->hitdie = rp_ptr->r_mhp / 2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
}
if (z_older_than(10, 4, 7) && (creature_ptr->pclass == CLASS_BLUE_MAGE) && !creature_ptr->is_dead) {
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
}
}
#pragma once
/*** Terrain Feature Indexes (see "lib/edit/f_info.txt") ***/
-typedef enum old_feature_type {
+enum old_feature_type {
OLD_FEAT_INVIS = 0x02,
OLD_FEAT_RUNE_PROTECTION = 0x03,
OLD_FEAT_QUEST_ENTER = 0x08,
OLD_FEAT_RUNE_EXPLOSION = 0x40,
OLD_FEAT_BLDG_1 = 0x81,
OLD_FEAT_MIRROR = 0xc3,
-} old_feature_type;
+};
#pragma once
-typedef enum savedata_item_flag_type {
+enum savedata_item_flag_type {
SAVE_ITEM_PVAL = 0x00000001,
SAVE_ITEM_DISCOUNT = 0x00000002,
SAVE_ITEM_NUMBER = 0x00000004,
SAVE_ITEM_INSCRIPTION = 0x04000000,
SAVE_ITEM_ART_NAME = 0x08000000,
SAVE_ITEM_ART_FLAGS4 = 0x10000000,
-} savedata_item_flag_type;
+};
-typedef enum savedata_monster_flag_type {
+enum savedata_monster_flag_type {
SAVE_MON_AP_R_IDX = 0x00000001,
SAVE_MON_SUB_ALIGN = 0x00000002,
SAVE_MON_CSLEEP = 0x00000004,
SAVE_MON_MFLAG2 = 0x00002000,
SAVE_MON_NICKNAME = 0x00004000,
SAVE_MON_PARENT = 0x00008000,
-} savedata_monster_flag_type;
+};
byte tmp8u;
rd_byte(&tmp8u);
- creature_ptr->is_dead = tmp8u;
+ creature_ptr->is_dead = (bool)tmp8u;
rd_byte(&creature_ptr->feeling);
rd_world_info(creature_ptr);
#include <iconv.h>
static const struct ms_to_jis_unicode_conv_t {
- char from[3];
- char to[3];
+ unsigned char from[3];
+ unsigned char to[3];
} ms_to_jis_unicode_conv[] = {
{ { 0xef, 0xbd, 0x9e }, { 0xe3, 0x80, 0x9c } }, /* FULLWIDTH TILDE -> WAVE DASH */
{ { 0xef, 0xbc, 0x8d }, { 0xe2, 0x88, 0x92 } }, /* FULLWIDTH HYPHEN-MINUS -> MINUS SIGN */
* @param msg 表示する文字列
* @return なし
*/
-void set_damage(player_type *player_ptr, lore_type *lore_ptr, monster_spell_type ms_type, char *msg)
+void set_damage(player_type *player_ptr, lore_type *lore_ptr, monster_spell_type ms_type, concptr msg)
{
MONRACE_IDX r_idx = lore_ptr->r_idx;
int base_damage = monspell_race_damage(player_ptr, ms_type, r_idx, BASE_DAM);
void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char *msg);
bool know_armour(MONRACE_IDX r_idx, const bool know_everything);
bool know_damage(MONRACE_IDX r_idx, int i);
-void set_damage(player_type *player_ptr, lore_type *lore_ptr, monster_spell_type ms_type, char *msg);
+void set_damage(player_type *player_ptr, lore_type *lore_ptr, monster_spell_type ms_type, concptr msg);
void set_drop_flags(lore_type *lore_ptr);
#include "system/angband.h"
#include "system/monster-race-definition.h"
-typedef enum monster_sex {
+enum monster_sex {
MSEX_NONE = 0,
MSEX_MALE = 1,
MSEX_FEMALE = 2,
-} monster_sex;
+};
typedef struct lore_type {
#ifdef JP
int count;
} lore_type;
-typedef enum monster_lore_mode {
+enum monster_lore_mode {
MONSTER_LORE_NONE,
MONSTER_LORE_NORMAL,
MONSTER_LORE_RESEARCH,
MONSTER_LORE_DEBUG
-} monster_lore_mode;
+};
typedef void (*hook_c_roff_pf)(TERM_COLOR attr, concptr str);
extern hook_c_roff_pf hook_c_roff;
char *Data;
if (smoothRescaling && (ix != ox || iy != oy) &&
- visual->class == TrueColor)
+ visual->c_class == TrueColor)
{
return ResizeImageSmooth(dpy, Im, ix, iy, ox, oy);
}
static bool can_use_sound = FALSE;
/*
- * Show sub-windows even when Hengband is not in focus
+ * Show sub-windows even when Hengband is not in focus
*/
static bool keep_subwindows = TRUE;
*/
static concptr ANGBAND_DIR_XTRA_GRAF;
static concptr ANGBAND_DIR_XTRA_SOUND;
-static concptr ANGBAND_DIR_XTRA_MUSIC;
static concptr ANGBAND_DIR_XTRA_HELP;
static concptr ANGBAND_DIR_XTRA_MUSIC;
if (use_bg == 0)
return 0;
- hBG = LoadImage(NULL, bmfile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+ hBG = static_cast<HBITMAP>(LoadImage(NULL, bmfile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));
if (!hBG) {
plog_fmt(_("壁紙用ビットマップ '%s' を読み込めません。", "Can't load the bitmap file '%s'."), bmfile);
use_bg = 0;
int shgt = bm.bmHeight;
HDC hdcSrc = CreateCompatibleDC(hdc);
- HBITMAP hOld = SelectObject(hdcSrc, hBG);
+ HBITMAP hOld = static_cast<HBITMAP>(SelectObject(hdcSrc, hBG));
do {
int sx = nx % swid;
lppe = NULL;
nEntries = 0;
- HPALETTE hBmPal = infGraph.hPalette;
+ HPALETTE hBmPal = static_cast<HPALETTE>(infGraph.hPalette);
if (hBmPal) {
lppeSize = 256 * sizeof(PALETTEENTRY);
lppe = (LPPALETTEENTRY)ralloc(lppeSize);
}
current_graphics_mode = arg_graphics;
- return (current_graphics_mode);
+ return current_graphics_mode != 0;
}
/*
TEXTMETRIC tm;
hdcDesktop = GetDC(HWND_DESKTOP);
- hfOld = SelectObject(hdcDesktop, td->font_id);
+ hfOld = static_cast<HFONT>(SelectObject(hdcDesktop, td->font_id));
GetTextMetrics(hdcDesktop, &tm);
SelectObject(hdcDesktop, hfOld);
ReleaseDC(HWND_DESKTOP, hdcDesktop);
HDC hdc = GetDC(hWnd);
HBRUSH myBrush = CreateSolidBrush(RGB(255, 255, 255));
- HBRUSH oldBrush = SelectObject(hdc, myBrush);
- HPEN oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
+ HBRUSH oldBrush = static_cast<HBRUSH>(SelectObject(hdc, myBrush));
+ HPEN oldPen = static_cast<HPEN>(SelectObject(hdc, GetStockObject(NULL_PEN)));
PatBlt(hdc, tx, ty, tw, th, PATINVERT);
select_floor_music(player_ptr);
}
- if (use_graphics != arg_graphics) {
+ if (use_graphics != (arg_graphics > 0)) {
if (arg_graphics && !init_graphics()) {
plog(_("グラフィックスを初期化できません!", "Cannot initialize graphics!"));
arg_graphics = GRAPHICS_NONE;
}
- use_graphics = arg_graphics;
+ use_graphics = (arg_graphics > 0);
reset_visuals(player_ptr, process_autopick_file_command);
}
#ifdef JP
if (use_bigtile && *(s + i) == "■"[0] && *(s + i + 1) == "■"[1]) {
rc.right += td->font_wid;
- oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
+ oldBrush = static_cast<HBRUSH>(SelectObject(hdc, myBrush));
+ oldPen = static_cast<HPEN>(SelectObject(hdc, GetStockObject(NULL_PEN)));
Rectangle(hdc, rc.left, rc.top, rc.right + 1, rc.bottom + 1);
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
rc.left += 2 * td->tile_wid;
rc.right += 2 * td->tile_wid;
} else if (*(s + i) == 127) {
- oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
+ oldBrush = static_cast<HBRUSH>(SelectObject(hdc, myBrush));
+ oldPen = static_cast<HPEN>(SelectObject(hdc, GetStockObject(NULL_PEN)));
Rectangle(hdc, rc.left, rc.top, rc.right + 1, rc.bottom + 1);
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
}
#else
if (*(s + i) == 127) {
- oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
+ oldBrush = static_cast<HBRUSH>(SelectObject(hdc, myBrush));
+ oldPen = static_cast<HPEN>(SelectObject(hdc, GetStockObject(NULL_PEN)));
Rectangle(hdc, rc.left, rc.top, rc.right + 1, rc.bottom + 1);
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
TERM_LEN y2 = y * h2 + td->size_oh1 + infGraph.OffsetY;
HDC hdc = GetDC(td->w);
HDC hdcSrc = CreateCompatibleDC(hdc);
- HBITMAP hbmSrcOld = SelectObject(hdcSrc, infGraph.hBitmap);
+ HBITMAP hbmSrcOld = static_cast<HBITMAP>(SelectObject(hdcSrc, infGraph.hBitmap));
if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_HENGBAND) {
hdcMask = CreateCompatibleDC(hdc);
*/
static spoiler_output_status create_debug_spoiler(LPSTR cmd_line)
{
- char *s, *option;
+ char *s;
+ concptr option;
s = cmd_line;
if (!*s)
return SPOILER_OUTPUT_CANCEL;
wc.hInstance = hInst;
wc.hIcon = hIcon = LoadIcon(hInst, AppName);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = GetStockObject(BLACK_BRUSH);
+ wc.hbrBackground = static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH));
wc.lpszMenuName = AppName;
wc.lpszClassName = AppName;
#ifdef USE_XFT
Visual *vis = DefaultVisual(Metadpy->dpy, 0);
- if (vis->class != TrueColor) {
+ if (vis->c_class != TrueColor) {
quit_fmt("Display does not support truecolor.\n");
}
iwin->draw = XftDrawCreate(Metadpy->dpy, iwin->win, vis, Metadpy->cmap);
*/
static int Infoclr_Opcode(concptr str)
{
- register int i;
+ int i;
for (i = 0; opcode_pairs[i * 2]; ++i) {
if (streq(opcode_pairs[i * 2], str)) {
return (atoi(opcode_pairs[i * 2 + 1]));
/*
* Hack -- cursor color
*/
-static infoclr * xor ;
+static infoclr * xor_ ;
/*
* Actual color table
{
if (use_graphics) {
#ifdef USE_XFT
- XftDrawRect(Infowin->draw, &xor->fg, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->wid - 1, Infofnt->hgt - 1);
- XftDrawRect(Infowin->draw, &xor->fg, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->wid - 3, Infofnt->hgt - 3);
+ XftDrawRect(Infowin->draw, &xor_->fg, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->wid - 1, Infofnt->hgt - 1);
+ XftDrawRect(Infowin->draw, &xor_->fg, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->wid - 3, Infofnt->hgt - 3);
#else
- XDrawRectangle(Metadpy->dpy, Infowin->win, xor->gc, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->wid - 1, Infofnt->hgt - 1);
+ XDrawRectangle(Metadpy->dpy, Infowin->win, xor_->gc, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->wid - 1, Infofnt->hgt - 1);
XDrawRectangle(
- Metadpy->dpy, Infowin->win, xor->gc, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->wid - 3, Infofnt->hgt - 3);
+ Metadpy->dpy, Infowin->win, xor_->gc, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->wid - 3, Infofnt->hgt - 3);
#endif
} else {
- Infoclr_set(xor);
+ Infoclr_set(xor_);
Infofnt_text_non(x, y, " ", 1);
}
{
if (use_graphics) {
#ifdef USE_XFT
- XftDrawRect(Infowin->draw, &xor->fg, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->twid - 1, Infofnt->hgt - 1);
- XftDrawRect(Infowin->draw, &xor->fg, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->twid - 3, Infofnt->hgt - 3);
+ XftDrawRect(Infowin->draw, &xor_->fg, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->twid - 1, Infofnt->hgt - 1);
+ XftDrawRect(Infowin->draw, &xor_->fg, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->twid - 3, Infofnt->hgt - 3);
#else
XDrawRectangle(
- Metadpy->dpy, Infowin->win, xor->gc, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->twid - 1, Infofnt->hgt - 1);
+ Metadpy->dpy, Infowin->win, xor_->gc, x * Infofnt->wid + Infowin->ox, y * Infofnt->hgt + Infowin->oy, Infofnt->twid - 1, Infofnt->hgt - 1);
XDrawRectangle(
- Metadpy->dpy, Infowin->win, xor->gc, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->twid - 3, Infofnt->hgt - 3);
+ Metadpy->dpy, Infowin->win, xor_->gc, x * Infofnt->wid + Infowin->ox + 1, y * Infofnt->hgt + Infowin->oy + 1, Infofnt->twid - 3, Infofnt->hgt - 3);
#endif
} else {
- Infoclr_set(xor);
+ Infoclr_set(xor_);
Infofnt_text_non(x, y, " ", 2);
}
if (Metadpy_init_name(dpy_name))
return (-1);
- MAKE(xor, infoclr);
- Infoclr_set(xor);
+ MAKE(xor_, infoclr);
+ Infoclr_set(xor_);
Infoclr_init_ppn(Metadpy->fg, Metadpy->bg, "xor", 0);
for (i = 0; i < 256; ++i) {
Pixell pixel;
*head = test;
C_MAKE(head->info_ptr, head->info_size, char);
- fd_read(fd, head->info_ptr, head->info_size);
+ fd_read(fd, static_cast<char*>(head->info_ptr), head->info_size);
if (head->name_size) {
C_MAKE(head->name_ptr, head->name_size, char);
fd_read(fd, head->name_ptr, head->name_size);
static void update_header(angband_header *head, void **info, char **name, char **text, char **tag)
{
if (info)
- *info = head->info_ptr;
+ *info = static_cast<char*>(head->info_ptr);
if (name)
*name = head->name_ptr;
C_MAKE(head->tag_ptr, FAKE_TAG_SIZE, char);
if (info)
- *info = head->info_ptr;
+ *info = static_cast<char*>(head->info_ptr);
if (name)
*name = head->name_ptr;
safe_setuid_drop();
if (fd >= 0) {
fd_write(fd, (concptr)(head), head->head_size);
- fd_write(fd, head->info_ptr, head->info_size);
+ fd_write(fd, static_cast<concptr>(head->info_ptr), head->info_size);
fd_write(fd, head->name_ptr, head->name_size);
fd_write(fd, head->text_ptr, head->text_size);
fd_write(fd, head->tag_ptr, head->tag_size);
init_header(&f_head, max_f_idx, sizeof(feature_type));
f_head.parse_info_txt = parse_f_info;
f_head.retouch = retouch_f_info;
- return init_info(player_ptr, "f_info", &f_head, (void *)&f_info, &f_name, NULL, &f_tag);
+ return init_info(player_ptr, "f_info", &f_head, reinterpret_cast<void**>(&f_info), &f_name, NULL, &f_tag);
}
/*!
{
init_header(&k_head, max_k_idx, sizeof(object_kind));
k_head.parse_info_txt = parse_k_info;
- return init_info(player_ptr, "k_info", &k_head, (void *)&k_info, &k_name, &k_text, NULL);
+ return init_info(player_ptr, "k_info", &k_head, reinterpret_cast<void**>(&k_info), &k_name, &k_text, NULL);
}
/*!
{
init_header(&a_head, max_a_idx, sizeof(artifact_type));
a_head.parse_info_txt = parse_a_info;
- return init_info(player_ptr, "a_info", &a_head, (void *)&a_info, &a_name, &a_text, NULL);
+ return init_info(player_ptr, "a_info", &a_head, reinterpret_cast<void**>(&a_info), &a_name, &a_text, NULL);
}
/*!
{
init_header(&e_head, max_e_idx, sizeof(ego_item_type));
e_head.parse_info_txt = parse_e_info;
- return init_info(player_ptr, "e_info", &e_head, (void *)&e_info, &e_name, &e_text, NULL);
+ return init_info(player_ptr, "e_info", &e_head, reinterpret_cast<void**>(&e_info), &e_name, &e_text, NULL);
}
/*!
{
init_header(&r_head, max_r_idx, sizeof(monster_race));
r_head.parse_info_txt = parse_r_info;
- return init_info(player_ptr, "r_info", &r_head, (void *)&r_info, &r_name, &r_text, NULL);
+ return init_info(player_ptr, "r_info", &r_head, reinterpret_cast<void**>(&r_info), &r_name, &r_text, NULL);
}
/*!
{
init_header(&d_head, current_world_ptr->max_d_idx, sizeof(dungeon_type));
d_head.parse_info_txt = parse_d_info;
- return init_info(player_ptr, "d_info", &d_head, (void *)&d_info, &d_name, &d_text, NULL);
+ return init_info(player_ptr, "d_info", &d_head, reinterpret_cast<void**>(&d_info), &d_name, &d_text, NULL);
}
/*!
{
init_header(&v_head, max_v_idx, sizeof(vault_type));
v_head.parse_info_txt = parse_v_info;
- return init_info(player_ptr, "v_info", &v_head, (void *)&v_info, &v_name, &v_text, NULL);
+ return init_info(player_ptr, "v_info", &v_head, reinterpret_cast<void**>(&v_info), &v_name, &v_text, NULL);
}
/*!
{
init_header(&s_head, MAX_CLASS, sizeof(skill_table));
s_head.parse_info_txt = parse_s_info;
- return init_info(player_ptr, "s_info", &s_head, (void *)&s_info, NULL, NULL, NULL);
+ return init_info(player_ptr, "s_info", &s_head, reinterpret_cast<void**>(&s_info), NULL, NULL, NULL);
}
/*!
{
init_header(&m_head, MAX_CLASS, sizeof(player_magic));
m_head.parse_info_txt = parse_m_info;
- return init_info(player_ptr, "m_info", &m_head, (void *)&m_info, NULL, NULL, NULL);
+ return init_info(player_ptr, "m_info", &m_head, reinterpret_cast<void**>(&m_info), NULL, NULL, NULL);
}
#pragma once
-typedef enum music_type {
+enum music_type {
MUSIC_BASIC_DEFAULT = 0,
MUSIC_BASIC_GAMEOVER = 1,
MUSIC_BASIC_EXIT = 2,
MUSIC_BASIC_FINAL_QUEST_CLEAR = 19,
MUSIC_BASIC_AMBUSH = 20,
MUSIC_BASIC_MAX = 21, /*!< BGM定義の最大数 */
-} music_type;
+};
extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
#pragma once
-typedef enum sound_type {
+enum sound_type {
SOUND_HIT = 1,
SOUND_MISS = 2,
SOUND_FLEE = 3,
SOUND_GLASS = 65, /*!< A glass feature was crashed */
SOUND_REFLECT = 66, /*!< A bolt was reflected */
SOUND_MAX = 67, /*!< 効果音定義の最大数 / Maximum numbers of sound effect */
-} sound_type;
+};
extern const concptr angband_sound_name[SOUND_MAX];
{ MON_NOBORTA, TV_AMULET, SV_AMULET_ADORNMENT },
{ MON_MORI_TROLL, TV_FOOD, SV_FOOD_PINT_OF_WINE },
{ MON_IMP, TV_POTION, SV_POTION_SPEED },
- { MON_LION_HEART, 0, 0 },
+ { MON_LION_HEART, TV_NONE, 0 },
{ MON_MASTER_YEEK, TV_POTION, SV_POTION_CURING },
{ MON_SABRE_TIGER, TV_WAND, SV_WAND_STONE_TO_MUD },
{ MON_LIZARD_KING, TV_WAND, SV_WAND_TELEPORT_AWAY },
{ MON_BLACK_REAVER, TV_RING, SV_RING_LORDLY },
{ MON_FENGHUANG, TV_STAFF, SV_STAFF_THE_MAGI },
{ MON_WYRM_POWER, TV_SCROLL, SV_SCROLL_ARTIFACT },
- { 0, 0, 0 }, /* Victory prizing */
+ { 0, TV_NONE, 0 }, /* Victory prizing */
{ MON_HAGURE, TV_SCROLL, SV_SCROLL_ARTIFACT },
};
{
/* Black Market (unused) */
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 }
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 }
},
{
/* Home (unused) */
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 }
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 }
},
{
{
/* Museum (unused) */
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 }
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 },
+ { TV_NONE, 0 }
}
};
/*
* Buildings actions
*/
-typedef enum ba_actions {
+enum ba_actions {
BACT_NOTHING = 0,
BACT_RESEARCH_ITEM = 1,
BACT_TOWN_HISTORY = 2,
BACT_EVAL_AC = 46,
BACT_BROKEN_WEAPON = 47,
MAX_BACT = 48,
-} ba_actions;
+};
int n = 0;
int cand[TR_FLAG_MAX];
- for (tr_type i = 0; i < TR_FLAG_MAX; i++) {
+ for (int i = 0; i < TR_FLAG_MAX; i++) {
switch (i) {
case TR_IGNORE_ACID:
case TR_IGNORE_ELEC:
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), 0);
+ o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), TV_NONE);
if (!o_ptr)
return 0;
item_tester_hook = item_tester_hook_orthodox_melee_weapons;
OBJECT_IDX mater;
object_type *mo_ptr;
- mo_ptr = choose_object(player_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), 0);
+ mo_ptr = choose_object(player_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), TV_NONE);
if (!mo_ptr)
return 0;
if (mater == item) {
concptr s = _("比べるものがありません。", "You have nothing to compare.");
OBJECT_IDX item;
- o_ptr[0] = choose_object(customer_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr[0] = choose_object(customer_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr[0]) {
screen_load();
return 0;
q = _("第二の武器は?", "What is your second weapon? ");
s = _("比べるものがありません。", "You have nothing to compare.");
OBJECT_IDX item2;
- object_type *i2_ptr = choose_object(customer_ptr, &item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
+ object_type *i2_ptr = choose_object(customer_ptr, &item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!i2_ptr)
continue;
if (tv == 0)
break;
- KIND_OBJECT_IDX k_idx = lookup_kind(tv, sv);
+ KIND_OBJECT_IDX k_idx = lookup_kind(static_cast<tval_type>(tv), sv);
if (k_idx == 0)
continue;
if (tv == 0)
break;
- KIND_OBJECT_IDX k_idx = lookup_kind(tv, sv);
+ KIND_OBJECT_IDX k_idx = lookup_kind(static_cast<tval_type>(tv), sv);
if (k_idx == 0)
continue;
}
for (int j = 0; j < MAX_CLASS; j++)
- building[i].member_class[j] = 0;
+ building[i].member_class[j] = CLASS_WARRIOR;
for (int j = 0; j < MAX_RACES; j++)
- building[i].member_race[j] = 0;
+ building[i].member_race[j] = RACE_HUMAN;
for (int j = 0; j < MAX_MAGIC + 1; j++)
building[i].member_realm[j] = 0;
init_flags = INIT_SHOW_TEXT;
if (do_init)
- init_flags |= INIT_ASSIGN;
+ init_flags = static_cast<init_flags_type>(init_flags | INIT_ASSIGN);
parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
floor_ptr->inside_quest = old_quest;
msg_format("Your quest: kill %d %s", q_ptr->max_num, name);
#endif
get_questinfo(player_ptr, q_index, TRUE);
-}
\ No newline at end of file
+}
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr)
return;
switch (mam_ptr->effect) {
case 0:
case RBE_DR_MANA:
- mam_ptr->damage = mam_ptr->pt = 0;
+ mam_ptr->damage = 0;
+ mam_ptr->pt = GF_NONE;
break;
case RBE_SUPERHURT:
if ((randint1(mam_ptr->rlev * 2 + 250) > (mam_ptr->ac + 200)) || one_in_(13)) {
#include "system/angband.h"
#include "melee/melee-util.h"
-typedef enum be_type {
+enum be_type {
BLOW_EFFECT_TYPE_NONE = 0,
BLOW_EFFECT_TYPE_FEAR = 1,
BLOW_EFFECT_TYPE_SLEEP = 2,
BLOW_EFFECT_TYPE_HEAL = 3,
-} be_type;
+};
void describe_melee_method(player_type *subject_ptr, mam_type *mam_ptr);
void decide_monster_attack_effect(player_type *subject_ptr, mam_type *mam_ptr);
/*
* Some things which induce learning
*/
-typedef enum drs_type {
+enum drs_type {
DRS_ACID = 1,
DRS_ELEC = 2,
DRS_FIRE = 3,
DRS_FREE = 30,
DRS_MANA = 31,
DRS_REFLECT = 32,
-} drs_type;
+};
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
-typedef enum ammo_creation_type {
+enum ammo_creation_type {
AMMO_NONE = 0,
AMMO_SHOT = 1,
AMMO_ARROW = 2,
AMMO_BOLT = 3,
-} ammo_creation_type;
+};
/*!
* @brief「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
concptr q = _("どのアイテムから作りますか? ", "Convert which item? ");
concptr s = _("材料を持っていない。", "You have no item to convert.");
OBJECT_IDX item;
- object_type *q_ptr = choose_object(creature_ptr, &item, q, s, USE_INVEN | USE_FLOOR, 0);
+ object_type *q_ptr = choose_object(creature_ptr, &item, q, s, USE_INVEN | USE_FLOOR, TV_NONE);
if (!q_ptr)
return FALSE;
concptr q = _("どのアイテムから作りますか? ", "Convert which item? ");
concptr s = _("材料を持っていない。", "You have no item to convert.");
OBJECT_IDX item;
- object_type *q_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ object_type *q_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!q_ptr)
return FALSE;
return FALSE;
}
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
|| is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
break;
#include "system/angband.h"
-typedef enum mind_berserker_type mind_berserker_type;
+enum mind_berserker_type : int;
bool cast_berserk_spell(player_type *caster_ptr, mind_berserker_type spell);
#include "system/angband.h"
-typedef enum blue_magic_type {
+enum blue_magic_type : int {
MONSPELL_TYPE_BOLT = 1,
MONSPELL_TYPE_BALL = 2,
MONSPELL_TYPE_BREATH = 3,
MONSPELL_TYPE_SUMMON = 4,
MONSPELL_TYPE_OTHER = 5,
-} blue_magic_type;
+};
bool do_cmd_cast_learned(player_type *caster_ptr);
bool set_tim_sh_force(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool shock_power(player_type *caster_ptr);
-typedef enum mind_force_trainer_type mind_force_trainer_type;
+enum mind_force_trainer_type : int;
bool cast_force_spell(player_type *caster_ptr, mind_force_trainer_type spell);
object_type *o_ptr;
OBJECT_IDX item;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr)
return FALSE;
concptr q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
concptr s = _("魔力を取り込めるアイテムがない。", "There's nothing with power to absorb.");
OBJECT_IDX item;
- object_type *o_ptr = choose_object(user_ptr, &item, q, s, USE_INVEN | USE_FLOOR, 0);
+ object_type *o_ptr = choose_object(user_ptr, &item, q, s, USE_INVEN | USE_FLOOR, TV_NONE);
if (!o_ptr)
return FALSE;
concptr s = _("調べるアイテムがありません。", "You have nothing appropriate.");
object_type *o_ptr;
OBJECT_IDX item;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return FALSE;
*/
bool cast_mindcrafter_spell(player_type *caster_ptr, mind_mindcrafter_type spell)
{
- int b = 0;
+ bool b = FALSE;
+ int dam = 0;
DIRECTION dir;
TIME_EFFECT t;
PLAYER_LEVEL plev = caster_ptr->lev;
if (plev < 25)
return psychometry(caster_ptr);
else
- return ident_spell(caster_ptr, FALSE, 0);
+ return ident_spell(caster_ptr, FALSE, TV_NONE);
case MIND_WAVE:
msg_print(_("精神を捻じ曲げる波動を発生させた!", "Mind-warping forces emanate from your brain!"));
if (plev < 25)
if (!get_aim_dir(caster_ptr, &dir))
return FALSE;
- b = damroll(plev / 2, 6);
- if (fire_ball(caster_ptr, GF_PSI_DRAIN, dir, b, 0))
+ dam = damroll(plev / 2, 6);
+ if (fire_ball(caster_ptr, GF_PSI_DRAIN, dir, dam, 0))
caster_ptr->energy_need += randint1(150);
break;
bool psychometry(player_type *caster_ptr);
-typedef enum mind_mindcrafter_type mind_mindcrafter_type;
+enum mind_mindcrafter_type : int;
bool cast_mindcrafter_spell(player_type *caster_ptr, mind_mindcrafter_type spell);
bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-typedef enum mind_mirror_master_type mind_mirror_master_type;
+enum mind_mirror_master_type : int;
bool cast_mirror_spell(player_type *caster_ptr, mind_mirror_master_type spell);
(void)stasis_monster(caster_ptr, dir);
break;
case ANCIENT_KNOWLEDGE:
- return ident_spell(caster_ptr, FALSE, 0);
+ return ident_spell(caster_ptr, FALSE, TV_NONE);
case FLOATING:
set_tim_levitation(caster_ptr, randint1(20) + 20, FALSE);
break;
bool hayagake(player_type *creature_ptr);
bool set_superstealth(player_type *creature_ptr, bool set);
-typedef enum mind_ninja_type mind_ninja_type;
+enum mind_ninja_type : int;
bool cast_ninja_spell(player_type *caster_ptr, mind_ninja_type spell);
#pragma once
-typedef enum mind_berserker_type {
+enum mind_berserker_type : int {
DETECT_MANACE = 0,
CHARGE = 1,
SMASH_TRAP = 2,
QUAKE = 3,
MASSACRE = 4,
-} mind_berserker_type;
+};
-typedef enum mind_force_trainer_type {
+enum mind_force_trainer_type : int {
SMALL_FORCE_BALL = 0,
FLASH_LIGHT = 1,
FLYING_TECHNIQUE = 2,
EXPLODING_FLAME = 11,
SUPER_KAMEHAMEHA = 12,
LIGHT_SPEED = 13,
-} mind_force_trainer_type;
+};
-typedef enum mind_mindcrafter_type {
+enum mind_mindcrafter_type : int {
PRECOGNITION = 0,
NEURAL_BLAST = 1,
MINOR_DISPLACEMENT = 2,
PSYCHIC_DRAIN = 11,
PSYCHO_SPEAR = 12,
THE_WORLD = 13,
-} mind_mindcrafter_type;
+};
-typedef enum mind_mirror_master_type {
+enum mind_mirror_master_type : int {
MIRROR_SEEING = 0,
MAKE_MIRROR = 1,
DRIP_LIGHT = 2,
MULTI_SHADOW = 18,
BINDING_FIELD = 19,
RUFFNOR_MIRROR = 20,
-} mind_mirror_master_type;
+};
-typedef enum mind_ninja_type {
+enum mind_ninja_type : int {
DARKNESS_CREATION = 0,
DETECT_NEAR = 1,
HIDE_LEAVES = 2,
HIDE_MIST =17,
PURGATORY_FLAME = 18,
ALTER_EGO = 19,
-} mind_ninja_type;
+};
concptr s = _("祝福できる武器がありません。", "You have weapon to bless.");
OBJECT_IDX item;
- object_type *o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, 0);
+ object_type *o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, TV_NONE);
if (!o_ptr)
return FALSE;
#pragma once
-typedef enum mind_kind_type {
+enum mind_kind_type {
MIND_MINDCRAFTER = 0, /*!< 特殊能力: 超能力 */
MIND_KI = 1, /*!< 特殊能力: 練気 */
MIND_BERSERKER = 2, /*!< 特殊能力: 怒り */
MIND_MIRROR_MASTER = 3, /*!< 特殊能力: 鏡魔法 */
MIND_NINJUTSU = 4, /*!< 特殊能力: 忍術 */
-} mind_kind_type;
+};
POSITION y = caster_ptr->y + ddy[dir];
POSITION x = caster_ptr->x + ddx[dir];
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
if (randint0(caster_ptr->skill_dis) < 7)
msg_print(_("うまく逃げられなかった。", "You failed to run away."));
else
/* Hack -- attack monsters */
if (g_ptr->m_idx)
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
else {
msg_print(_("攻撃が空をきった。", "You attack the empty air."));
}
int stun_effect = 0;
int special_effect = process_monk_additional_effect(pa_ptr, &stun_effect);
WEIGHT weight = calc_monk_attack_weight(attacker_ptr);
- pa_ptr->attack_damage = critical_norm(attacker_ptr, attacker_ptr->lev * weight, min_level, pa_ptr->attack_damage, attacker_ptr->to_h[0], 0);
+ pa_ptr->attack_damage = critical_norm(attacker_ptr, attacker_ptr->lev * weight, min_level, pa_ptr->attack_damage, attacker_ptr->to_h[0], HISSATSU_NONE);
process_attack_vital_spot(attacker_ptr, pa_ptr, &stun_effect, &resist_stun, special_effect);
print_stun_effect(attacker_ptr, pa_ptr, stun_effect, resist_stun);
}
else
msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!", "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
handle_stuff(creature_ptr);
- do_cmd_attack(creature_ptr, y, x, 0);
+ do_cmd_attack(creature_ptr, y, x, HISSATSU_NONE);
}
creature_ptr->energy_need += ENERGY_NEED();
#pragma once
-typedef enum snipe_type {
+enum snipe_type {
SP_NONE = 0,
SP_LITE = 1,
SP_AWAY = 2,
SP_HOLYNESS = 13,
SP_FINAL = 14,
SP_NEEDLE = 15,
-} snipe_type;
\ No newline at end of file
+};
* "Race Blow Effect" の略。
* 実装の都合上、0 から始まる連番でなければならない。
*/
-typedef enum rbe_type {
+enum rbe_type {
RBE_NONE = 0,
RBE_HURT = 1, /*!< モンスターの攻撃効果: 攻撃する*/
RBE_POISON = 2, /*!< モンスターの攻撃効果: 毒をくらわす*/
RBE_FLAVOR = 36, /*!< モンスターの攻撃効果: フレーバー(メッセージ表示のみ) */
NB_RBE_TYPE, /*!< enum バリアント数 */
-} rbe_type;
+};
* "Race Blow Method" の略。
* 実装の都合上、0 から始まる連番でなければならない。
*/
-typedef enum rbm_type {
+enum rbm_type {
RBM_NONE = 0,
RBM_HIT = 1, /*!< モンスターの攻撃種別:殴る(傷/朦朧が半々) */
RBM_TOUCH = 2, /*!< モンスターの攻撃種別:触る */
RBM_SHOOT = 25, /*!< モンスターの攻撃種別:射撃(非打撃) */
NB_RBM_TYPE, /*!< enum バリアント数 */
-} rbm_type;
+};
typedef struct mbe_info_type {
int power; /* The attack "power" */
#include "system/angband.h"
-typedef enum summon_type summon_type;
+enum summon_type : int;
typedef bool (*summon_specific_pf)(player_type *, MONSTER_IDX, POSITION, POSITION, DEPTH, summon_type, BIT_FLAGS);
bool mon_scatter(player_type *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist);
if (!rad)
continue;
- int f_flag;
+ feature_flag_type f_flag;
if (rad > 0) {
if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2))
&& (monster_csleep_remaining(m_ptr) || (!floor_ptr->dun_level && is_daytime()) || subject_ptr->phase_out))
DEPTH dlev = get_dungeon_or_wilderness_level(player_ptr);
MONRACE_IDX r_idx = get_mon_num(player_ptr, 0, (dlev + lev) / 2 + 5, 0);
if (!r_idx) {
- summon_specific_type = 0;
+ summon_specific_type = SUMMON_NONE;
return FALSE;
}
mode |= PM_NO_KAGE;
if (!place_monster_aux(player_ptr, who, y, x, r_idx, mode)) {
- summon_specific_type = 0;
+ summon_specific_type = SUMMON_NONE;
return FALSE;
}
- summon_specific_type = 0;
+ summon_specific_type = SUMMON_NONE;
sound(SOUND_SUMMON);
return TRUE;
}
extern int summon_specific_who;
extern bool summon_unique_okay;
-typedef enum summon_type summon_type;
+enum summon_type : int;
bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode);
bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
/*
* Bit flags for the place_monster_???() (etc)
*/
-typedef enum place_monster_type {
+enum place_monster_type {
PM_NONE = 0x00000000, /*!< 特になし*/
PM_ALLOW_SLEEP = 0x00000001, /*!< モンスター生成フラグ: 眠っている状態で生成されても良い */
PM_ALLOW_GROUP = 0x00000002, /*!< モンスター生成フラグ: 集団生成されても良い */
PM_KAGE = 0x00000200, /*!< モンスター生成フラグ: 必ずあやしい影として生成する */
PM_MULTIPLY = 0x00000400, /*!< モンスター生成フラグ: 増殖処理時として生成する */
PM_JURAL = 0x00000800, /*!< モンスター生成フラグ: ジュラル星人として誤認生成する */
-} place_monster_type;
+};
#pragma once
-typedef enum race_flags_ability {
+enum race_flags_ability {
RF5_BA_ACID = 0x00000001, /*!< モンスター能力: アシッド・ボール / Acid Ball */
RF5_BA_ELEC = 0x00000002, /*!< モンスター能力: サンダー・ボール / Elec Ball */
RF5_BA_FIRE = 0x00000004, /*!< モンスター能力: ファイア・ボール / Fire Ball */
RF5_CONF = 0x20000000, /*!< モンスター能力: 混乱 / Confuse Player */
RF5_SLOW = 0x40000000, /*!< モンスター能力: 減速 / Slow Player */
RF5_HOLD = 0x80000000, /*!< モンスター能力: 麻痺 / Paralyze Player */
-} race_flags_ability;
+};
#pragma once
-typedef enum race_flags_ability2 {
+enum race_flags_ability2 {
RF6_HASTE = 0x00000001, /* Speed self */
RF6_HAND_DOOM = 0x00000002, /* Hand of Doom */
RF6_HEAL = 0x00000004, /* Heal self */
RF6_S_HI_DRAGON = 0x20000000, /* Summon Ancient Dragon */
RF6_S_AMBERITES = 0x40000000, /* Summon Amberites */
RF6_S_UNIQUE = 0x80000000, /* Summon Unique Monster */
-} race_flags_ability2;
+};
#pragma once
-typedef enum race_flags_resistance {
+enum race_flags_resistance {
RFR_IM_ACID = 0x00000001, /* Immunity acid */
RFR_IM_ELEC = 0x00000002, /* Immunity elec */
RFR_IM_FIRE = 0x00000004, /* Immunity fire */
RFR_XXX29 = 0x20000000,
RFR_XXX30 = 0x40000000,
RFR_XXX31 = 0x80000000,
-} race_flags_resistance;
+};
#define RFR_EFF_IM_ACID_MASK (RFR_IM_ACID | RFR_RES_ALL)
#define RFR_EFF_IM_ELEC_MASK (RFR_IM_ELEC | RFR_RES_ALL)
#pragma once
-typedef enum race_flags1 {
+enum race_flags1 {
RF1_UNIQUE = 0x00000001, /*!< モンスター特性: ユニーク / Unique Monster */
RF1_QUESTOR = 0x00000002, /*!< モンスター特性: クエストモンスター / Quest Monster */
RF1_MALE = 0x00000004, /*!< モンスター特性: 男性 / Male gender */
RF1_DROP_GREAT = 0x20000000, /*!< モンスター特性: 必ず高級品をドロップする / Drop great items */
RF1_XXX2 = 0x40000000, /*!< モンスター特性: 未使用 / XXX */
RF1_XXX3 = 0x80000000, /*!< モンスター特性: 未使用 / XXX */
-} race_flags1;
+};
#pragma once
-typedef enum race_flags2 {
+enum race_flags2 {
RF2_STUPID = 0x00000001, /*!< モンスター特性: 愚かな行動を取る / Monster is stupid */
RF2_SMART = 0x00000002, /*!< モンスター特性: 賢い行動を取る / Monster is smart */
RF2_CAN_SPEAK = 0x00000004, /*!< モンスター特性: 台詞をしゃべる / TY: can speak */
RF2_XXX6 = 0x20000000, /*!< モンスター特性: 未使用 / XXX */
RF2_HUMAN = 0x40000000, /*!< モンスター特性: 人間 / Human */
RF2_QUANTUM = 0x80000000, /*!< モンスター特性: 量子的な振る舞いをする / Monster has quantum behavior */
-} race_flags2;
+};
#pragma once
-typedef enum race_flags3 {
+enum race_flags3 {
RF3_ORC = 0x00000001, /*!< モンスター特性: オーク / Orc */
RF3_TROLL = 0x00000002, /*!< モンスター特性: トロル / Troll */
RF3_GIANT = 0x00000004, /*!< モンスター特性: 巨人 / Giant */
RF3_NO_STUN = 0x20000000, /*!< モンスター特性: 朦朧としない / Cannot be stunned */
RF3_NO_CONF = 0x40000000, /*!< モンスター特性: 混乱しない / Cannot be confused and resist confusion */
RF3_NO_SLEEP = 0x80000000, /*!< モンスター特性: 眠らない / Cannot be slept */
-} race_flags3;
+};
#pragma once
-typedef enum race_flags4 {
+enum race_flags4 {
RF4_SHRIEK = 0x00000001, /*!< モンスター能力: 叫ぶ / Shriek for help */
RF4_XXX1 = 0x00000002, /*!< モンスター能力: 未使用 / XXX */
RF4_DISPEL = 0x00000004, /*!< モンスター能力: 魔力消去 / Dispel magic */
RF4_BR_NUKE = 0x20000000, /*!< モンスター能力: 放射性廃棄物のブレス / TY: Toxic Breath */
RF4_BA_CHAO = 0x40000000, /*!< モンスター能力: ログルス球 / TY: Logrus Ball */
RF4_BR_DISI = 0x80000000, /*!< モンスター能力: 分解のブレス / Breathe Disintegration */
-} race_flags4;
+};
#pragma once
-typedef enum race_flags7 {
+enum race_flags7 {
RF7_AQUATIC = 0x00000001, /* Aquatic monster */
RF7_CAN_SWIM = 0x00000002, /* Monster can swim */
RF7_CAN_FLY = 0x00000004, /* Monster can fly */
RF7_SELF_DARK_1 = 0x00020000, /* Monster darkens itself */
RF7_HAS_DARK_2 = 0x00040000, /* Monster carries darkness */
RF7_SELF_DARK_2 = 0x00080000, /* Monster darkens itself */
-} race_flags7;
+};
#define RF7_LITE_MASK (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
#define RF7_DARK_MASK (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
#pragma once
-typedef enum race_flags8 {
+enum race_flags8 : uint32_t {
RF8_WILD_ONLY = 0x00000001,
RF8_WILD_TOWN = 0x00000002,
RF8_XXX8X02 = 0x00000004,
RF8_WILD_MOUNTAIN = 0x00000200,
RF8_WILD_GRASS = 0x00000400,
RF8_WILD_ALL = 0x80000000,
-} race_flags8;
+};
#pragma once
-typedef enum race_flags9 {
+enum race_flags9 {
RF9_DROP_CORPSE = 0x00000001,
RF9_DROP_SKELETON = 0x00000002,
RF9_EAT_BLIND = 0x00000004,
RF9_EAT_LOSE_CON = 0x20000000,
RF9_EAT_LOSE_CHR = 0x40000000,
RF9_EAT_DRAIN_MANA = 0x80000000,
-} race_flags9;
+};
#pragma once
-typedef enum monster_race_type {
+enum monster_race_type {
MON_PLAYER = 0, // Dummy.
MON_BEGGAR = 12,
MON_LEPER = 13,
MON_CAIT_SITH = 1262,
MON_SHIVA_BOOTS = 1264,
MON_BIG_RAVEN = 1268,
-} monster_race_type;
+};
#pragma once
-typedef enum monsetr_description_type {
+enum monsetr_description_type {
MD_NONE = 0x00000000,
MD_OBJECTIVE = 0x00000001, /* Objective (or Reflexive) */
MD_POSSESSIVE = 0x00000002, /* Possessive (or Reflexive) */
MD_ASSUME_VISIBLE = 0x00000080, /* Assume the monster is visible */
MD_TRUE_NAME = 0x00000100, /* Chameleon's true name */
MD_IGNORE_HALLU = 0x00000200, /* Ignore hallucination, and penetrate shape change */
-} monsetr_description_type;
+};
#define MD_WRONGDOER_NAME (MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE) /* 加害明記向け */
#pragma once
-typedef enum monster_flags_type {
+enum monster_flags_type {
MFLAG_VIEW = 0x01, /* Monster is in line of sight */
MFLAG_LOS = 0x02, /* Monster is marked for project_all_los(caster_ptr, ) */
MFLAG_ESP = 0x04, /* Monster is being sensed by ESP */
MFLAG_ETF = 0x08, /* Monster is entering the field. */
MFLAG_BORN = 0x10, /* Monster is still being born */
MFLAG_PREVENT_MAGIC = 0x20, /* Monster is still being no-magic */
-} monster_flags_type;
+};
-typedef enum monster_flags2_type {
+enum monster_flags2_type {
MFLAG2_KAGE = 0x01, /* Monster is kage */
MFLAG2_NOPET = 0x02, /* Cannot make monster pet */
MFLAG2_NOGENO = 0x04, /* Cannot genocide */
MFLAG2_NOFLOW = 0x10, /* Monster is in no_flow_by_smell mode */
MFLAG2_SHOW = 0x20, /* Monster is recently memorized */
MFLAG2_MARK = 0x40, /* Monster is currently memorized */
-} monster_flags2_type;
+};
int count = 0;
DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
- BIT_FLAGS p_mode = is_pet(m_ptr) ? PM_FORCE_PET : 0L;
+ BIT_FLAGS p_mode = is_pet(m_ptr) ? PM_FORCE_PET : PM_NONE;
for (int k = 0; k < A_MAX; k++) {
if (summon_specific(target_ptr, m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode))) {
#pragma once
-typedef enum monster_timed_effect_type {
+enum monster_timed_effect_type {
MTIMED_CSLEEP = 0, /* Monster is sleeping */
MTIMED_FAST = 1, /* Monster is temporarily fast */
MTIMED_SLOW = 2, /* Monster is temporarily slow */
MTIMED_MONFEAR = 5, /* Monster is afraid */
MTIMED_INVULNER = 6, /* Monster is temporarily invulnerable */
MAX_MTIMED = 7,
-} monster_timed_effect_type;
+};
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
-typedef enum dungeon_mode_type {
+enum dungeon_mode_type {
DUNGEON_MODE_AND = 1,
DUNGEON_MODE_NAND = 2,
DUNGEON_MODE_OR = 3,
DUNGEON_MODE_NOR = 4,
-} dungeon_mode_type;
+};
MONSTER_IDX hack_m_idx = 0; /* Hack -- see "process_monsters()" */
MONSTER_IDX hack_m_idx_ii = 0;
extern MONSTER_IDX hack_m_idx;
extern MONSTER_IDX hack_m_idx_ii;
extern int chameleon_change_m_idx;
-typedef enum summon_type summon_type;
+enum summon_type : int;
extern summon_type summon_specific_type;
monsterrace_hook_type get_monster_hook(player_type *player_ptr);
#pragma once
-typedef enum smart_learn_type {
+enum smart_learn_type {
SM_RES_ACID = 0x00000001, /*!< モンスターの学習フラグ: プレイヤーに酸耐性あり */
SM_RES_ELEC = 0x00000002, /*!< モンスターの学習フラグ: プレイヤーに電撃耐性あり */
SM_RES_FIRE = 0x00000004, /*!< モンスターの学習フラグ: プレイヤーに火炎耐性あり */
SM_IMM_REFLECT = 0x20000000, /*!< モンスターの学習フラグ: プレイヤーに反射あり */
SM_IMM_FREE = 0x40000000, /*!< モンスターの学習フラグ: プレイヤーに麻痺耐性あり */
SM_IMM_MANA = 0x80000000, /*!< モンスターの学習フラグ: プレイヤーにMPがない */
-} smart_learn_type;
+};
#include "system/angband.h"
-typedef enum mspell_lite_type {
+enum mspell_lite_type {
DO_SPELL_NONE = 0,
DO_SPELL_BR_LITE = 1,
DO_SPELL_BR_DISI = 2,
DO_SPELL_BA_LITE = 3,
-} mspell_lite_type;
+};
// Monster Spell Attack.
typedef struct monster_type monster_type;
#include "mspell/mspell-type.h"
#include "system/angband.h"
-typedef enum spell_flag_type {
+enum spell_flag_type {
DAM_ROLL = 1,
DAM_MAX = 2,
DAM_MIN = 3,
DICE_MULT = 6,
DICE_DIV = 7,
BASE_DAM = 8,
-} spell_flag_type;
+};
HIT_POINT monspell_damage(player_type* target_ptr, monster_spell_type ms_type, MONSTER_IDX m_idx, int TYPE);
HIT_POINT monspell_race_damage(player_type* target_ptr, monster_spell_type ms_type, MONRACE_IDX r_idx, int TYPE);
HIT_POINT dam = damroll(4, 8);
if (monster_to_player || t_idx == target_ptr->riding)
- teleport_player_to(target_ptr, m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+ teleport_player_to(target_ptr, m_ptr->fy, m_ptr->fx, static_cast<teleport_flags>(TELEPORT_NONMAGICAL | TELEPORT_PASSIVE));
else
- teleport_monster_to(target_ptr, t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+ teleport_monster_to(target_ptr, t_idx, m_ptr->fy, m_ptr->fx, 100, static_cast<teleport_flags>(TELEPORT_NONMAGICAL | TELEPORT_PASSIVE));
sound(SOUND_FALL);
bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
for (int k = 0; k < 1; k++) {
if (mon_to_player)
- count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+ count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
if (mon_to_mon)
- count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (monster_u_mode(floor_ptr, m_idx)));
+ count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_NONE, (monster_u_mode(floor_ptr, m_idx)));
}
if (target_ptr->blind && count && mon_to_player)
bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
for (int k = 0; k < S_NUM_6; k++) {
if (mon_to_player)
- count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+ count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
if (mon_to_mon)
- count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
+ count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_NONE, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
}
if (target_ptr->blind && count && mon_to_player)
if (count)
uniques_are_summoned = TRUE;
- int non_unique_type = SUMMON_HI_UNDEAD;
+ summon_type non_unique_type = SUMMON_HI_UNDEAD;
if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
- non_unique_type = 0;
+ non_unique_type = SUMMON_NONE;
else if (m_ptr->sub_align & SUB_ALIGN_GOOD)
non_unique_type = SUMMON_ANGEL;
#pragma once
-typedef enum monster_spell_type {
+enum monster_spell_type : int {
MS_SHRIEK = 0,
MS_XXX1 = 1,
MS_DISPEL = 2,
MS_S_HI_DRAGON = 93,
MS_S_AMBERITE = 94,
MS_S_UNIQUE = 95,
-} monster_spell_type;
+};
#pragma once
-typedef enum racial_flag_type {
+enum racial_flag_type {
MUT1_SPIT_ACID = 0x00000001L, /*!< 突然変異: 酸の唾 */
MUT1_BR_FIRE = 0x00000002L, /*!< 突然変異: 炎のブレス */
MUT1_HYPN_GAZE = 0x00000004L, /*!< 突然変異: 催眠睨み */
MUT1_BANISH = 0x20000000L, /*!< 突然変異: 邪悪消滅 */
MUT1_COLD_TOUCH = 0x40000000L, /*!< 突然変異: 凍結の手 */
MUT1_LAUNCHER = 0x80000000L, /*!< 突然変異: アイテム投げ */
-} racial_flag_type;
+};
-typedef enum mutation_flag_type_1 {
+enum mutation_flag_type_1 {
MUT2_BERS_RAGE = 0x00000001L, /*!< 突然変異: 狂戦士化の発作 */
MUT2_COWARDICE = 0x00000002L, /*!< 突然変異: 臆病 */
MUT2_RTELEPORT = 0x00000004L, /*!< 突然変異: ランダムテレポート / Random teleport, instability */
MUT2_SP_TO_HP = 0x20000000L, /*!< 突然変異: ランダムなMPからHPへの変換 */
MUT2_HP_TO_SP = 0x40000000L, /*!< 突然変異: ランダムなHPからMPへの変換 */
MUT2_DISARM = 0x80000000L, /*!< 突然変異: ランダムな武器落とし */
-} mutation_flag_type_1;
+};
-typedef enum mutation_flag_type_2 {
+enum mutation_flag_type_2 {
MUT3_HYPER_STR = 0x00000001L, /*!< 突然変異: 超人的な力 */
MUT3_PUNY = 0x00000002L, /*!< 突然変異: 虚弱 */
MUT3_HYPER_INT = 0x00000004L, /*!< 突然変異: 生体コンピュータ */
MUT3_VULN_ELEM = 0x20000000L, /*!< 突然変異: 元素攻撃弱点 */
MUT3_MOTION = 0x40000000L, /*!< 突然変異: 正確で力強い動作 */
MUT3_GOOD_LUCK = 0x80000000L, /*!< 突然変異: 白いオーラ(幸運) */
-} mutation_flag_type_2;
+};
lose_all_info(creature_ptr);
else
wiz_dark(creature_ptr);
- (void)teleport_player_aux(creature_ptr, 100, FALSE, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+ (void)teleport_player_aux(creature_ptr, 100, FALSE, static_cast<teleport_flags>(TELEPORT_NONMAGICAL | TELEPORT_PASSIVE));
wiz_dark(creature_ptr);
msg_print(_("あなたは見知らぬ場所で目が醒めた...頭が痛い。", "You wake up somewhere with a sore head..."));
msg_print(_("何も覚えていない。どうやってここに来たかも分からない!", "You can't remember a thing or how you got here!"));
msg_print(_("何かが邪魔しています!", "There's something in the way!"));
if (!m_ptr->ml || !is_pet(m_ptr))
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
} else if (has_flag(f_ptr->flags, FF_TREE)) {
msg_print(_("木の味は好きじゃない!", "You don't like the woody taste!"));
} else if (has_flag(f_ptr->flags, FF_GLASS)) {
msg_print(_("明るく輝いている...", "It glows brightly..."));
detect_all(user_ptr, DETECT_RAD_DEFAULT);
probing(user_ptr);
- identify_fully(user_ptr, FALSE, 0);
+ identify_fully(user_ptr, FALSE, TV_NONE);
return TRUE;
}
bool activate_fully_identification(player_type *user_ptr)
{
msg_print(_("黄色く輝いている...", "It glows yellow..."));
- identify_fully(user_ptr, FALSE, 0);
+ identify_fully(user_ptr, FALSE, TV_NONE);
return TRUE;
}
* @param user_ptr プレーヤーへの参照ポインタ
* @return 発動に成功したらTRUE
*/
-bool activate_identification(player_type *user_ptr) { return ident_spell(user_ptr, FALSE, 0); }
+bool activate_identification(player_type *user_ptr) { return ident_spell(user_ptr, FALSE, TV_NONE); }
bool activate_pesticide(player_type *user_ptr)
{
{ TR_RES_NETHER, GF_NETHER, _("地獄", "nether") },
{ TR_RES_CHAOS, GF_CHAOS, _("カオス", "chaos") },
{ TR_RES_DISEN, GF_DISENCHANT, _("劣化", "disenchantment") },
- { 0, 0, NULL }
+ { TR_STR, 0, NULL }
};
-
/*
* Bit flags for apply_magic()
*/
-typedef enum item_am_type {
+enum item_am_type : uint32_t {
+ AM_NONE = 0x00000000,
AM_NO_FIXED_ART = 0x00000001, /*!< Don't allow roll for fixed artifacts */
AM_GOOD = 0x00000002, /*!< Generate good items */
AM_GREAT = 0x00000004, /*!< Generate great items */
AM_SPECIAL = 0x00000008, /*!< Generate artifacts (for debug mode only) */
AM_CURSED = 0x00000010, /*!< Generate cursed/worthless items */
AM_FORBID_CHEST = 0x00000020, /*!< 箱からさらに箱が出現することを抑止する */
-} item_am_type;
+};
* アイテムの簡易鑑定定義 / Game generated inscription indices. These are stored in the object,
* and are used to index the string array from tables.c.
*/
-typedef enum item_feel_type {
+enum item_feel_type {
FEEL_NONE = 0, /*!< 簡易鑑定: 未鑑定 */
FEEL_BROKEN = 1, /*!< 簡易鑑定: 壊れている */
FEEL_TERRIBLE = 2, /*!< 簡易鑑定: 恐ろしい */
FEEL_EXCELLENT = 8, /*!< 簡易鑑定: 高級 */
FEEL_SPECIAL = 9, /*!< 簡易鑑定: 特別 */
FEEL_MAX = 9, /*!< 簡易鑑定の種別数 */
-} item_feel_type;
+};
/*
* Special Object Flags
*/
-typedef enum sof_type {
+enum sof_type {
IDENT_SENSE = 0x01, /* Item has been "sensed" */
IDENT_FIXED = 0x02, /* Item has been "haggled" */
IDENT_EMPTY = 0x04, /* Item charges are known */
IDENT_STORE = 0x10, /* Item is storebought !!!! */
IDENT_FULL_KNOWN = 0x20, /* Item information is known */
IDENT_BROKEN = 0x80, /* Item is permanently worthless */
-} sof_type;
+};
/*!
* todo TRが何の略か分かる人、補足求む
*/
-typedef enum tr_type {
+enum tr_type {
TR_STR = 0, /* STR += "pval" */
TR_INT = 1, /* INT += "pval" */
TR_WIS = 2, /* WIS += "pval" */
TR_DARK_SOURCE = 146,
TR_SUPPORTIVE = 147,
TR_FLAG_MAX = 148,
-} tr_type;
+};
#pragma once
/* TRCが何の略かは分からない (type / ??? / curse)*/
-typedef enum trc_curse_type {
+enum trc_curse_type {
TRC_CURSED = 0x00000001L,
TRC_HEAVY_CURSE = 0x00000002L,
TRC_PERMA_CURSE = 0x00000004L,
TRC_DRAIN_HP = 0x00080000L,
TRC_DRAIN_MANA = 0x00100000L,
TRC_CALL_UNDEAD = 0x00200000L,
-} trc_curse_type;
+};
-typedef enum trc_special_type {
+enum trc_special_type {
TRC_TELEPORT_SELF = 0x00000001L,
TRC_CHAINSWORD = 0x00000002L
-} trc_special_type;
+};
#pragma once
-typedef enum trg_type {
+enum trg_type {
TRG_INSTA_ART = 0x00000001L, /* Item must be an artifact */
TRG_QUESTITEM = 0x00000002L, /* quest level item -KMW- */
TRG_XTRA_POWER = 0x00000004L, /* Extra power */
TRG_RANDOM_CURSE2 = 0x00008000L, /* Item is Random Cursed */
TRG_XTRA_DICE = 0x00010000L, /* Extra dice */
TRG_POWERFUL = 0x00020000L, /* Item has good value even if Cursed */
-} trg_type;
+};
}
}
- if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + MAX_REALM - 1)))
+ if ((o_ptr->tval < TV_LIFE_BOOK) || (o_ptr->tval > (TV_LIFE_BOOK + static_cast<int>(MAX_REALM) - 1)))
return FALSE;
if ((o_ptr->tval == TV_MUSIC_BOOK) && (player_ptr->pclass == CLASS_BARD))
else
wiz_dark(creature_ptr);
- (void)teleport_player_aux(creature_ptr, 100, FALSE, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+ (void)teleport_player_aux(creature_ptr, 100, FALSE, static_cast<teleport_flags>(TELEPORT_NONMAGICAL | TELEPORT_PASSIVE));
wiz_dark(creature_ptr);
msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing or how you got here!"));
break;
case SV_POTION_NEW_LIFE:
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
get_max_stats(creature_ptr);
creature_ptr->update |= PU_BONUS;
lose_all_mutations(creature_ptr);
}
case SV_SCROLL_SUMMON_MONSTER: {
for (k = 0; k < randint1(3); k++) {
- if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0,
+ if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_NONE,
PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)) {
ident = TRUE;
}
}
case SV_SCROLL_SUMMON_PET: {
if (summon_specific(
- creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, PM_ALLOW_GROUP | PM_FORCE_PET))
+ creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_NONE, PM_ALLOW_GROUP | PM_FORCE_PET))
ident = TRUE;
break;
break;
}
case SV_SCROLL_IDENTIFY: {
- if (!ident_spell(creature_ptr, FALSE, 0))
+ if (!ident_spell(creature_ptr, FALSE, TV_NONE))
used_up = FALSE;
ident = TRUE;
break;
}
case SV_SCROLL_STAR_IDENTIFY: {
- if (!identify_fully(creature_ptr, FALSE, 0))
+ if (!identify_fully(creature_ptr, FALSE, TV_NONE))
used_up = FALSE;
ident = TRUE;
/*
* get_item()関数でアイテムの選択を行うフラグ / Bit flags for the "get_item" function
*/
-typedef enum item_use_flag {
+enum item_use_flag {
USE_EQUIP = 0x01, /*!< アイテム表示/選択範囲: 装備品からの選択を許可する / Allow equip items */
USE_INVEN = 0x02, /*!< アイテム表示/選択範囲: 所持品からの選択を許可する / Allow inven items */
USE_FLOOR = 0x04, /*!< アイテム表示/選択範囲: 床下のアイテムからの選択を許可する / Allow floor items */
USE_FORCE = 0x08, /*!< 特殊: wキーで錬気術への切り替えを許可する */
IGNORE_BOTHHAND_SLOT = 0x10, /*!< アイテム表示/選択範囲: 両手持ちスロットを選択に含めない */
USE_FULL = 0x20, /*!< アイテム表示/選択範囲: 空欄まですべて表示する*/
-} item_use_flag;
+};
#pragma once
-typedef enum om_type {
+enum om_type {
OM_FOUND = 0x01, /*!< アイテムを一度でも視界に収めたことがあるか */
OM_NOMSG = 0x02, /* temporary flag to suppress messages */
OM_NO_QUERY = 0x04, /* Query for auto-pick was already answered as 'No' */
OM_AUTODESTROY = 0x08, /* Destroy later to avoid illegal inventry shift */
OM_TOUCHED = 0x10, /* Object was touched by player */
-} om_type;
+};
#pragma once
-typedef enum tval_type {
+enum tval_type {
TV_NONE = 0,
TV_SKELETON = 1, /* Skeletons ('s'), not specified */
TV_BOTTLE = 2, /* Empty bottles ('!') */
TV_HISSATSU_BOOK = 106,
TV_HEX_BOOK = 107,
TV_GOLD = 127, /* Gold can only be picked up by players */
-} tval_type;
+};
#define TV_EQUIP_BEGIN TV_SHOT
#define TV_EQUIP_END TV_CARD
/* Search Inventory */
int number = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_type *o_ptr = &creature_ptr->inventory_list[i];
#pragma once
-typedef enum pet_command {
+enum pet_command {
PET_DISMISS = 1, /*!< ペットに関するコマンド: ペットを離す */
PET_TARGET = 2, /*!< ペットに関するコマンド: ペットのターゲットを指定 */
PET_STAY_CLOSE = 3, /*!< ペットに関するコマンド: 近くにいろ */
PET_RIDING = 14, /*!< ペットに関するコマンド: ペットに乗る */
PET_NAME = 15, /*!< ペットに関するコマンド: ペットに名前をつける */
PET_TWO_HANDS = 16, /*!< ペットに関するコマンド: 騎乗中に両手で武器を使うかどうか */
-} pet_command;
+};
-typedef enum pet_follow_distance {
+enum pet_follow_distance {
PET_CLOSE_DIST = 1, /*!<ペットの行動範囲…近くにいろ */
PET_FOLLOW_DIST = 6, /*!<ペットの行動範囲…ついて来い */
PET_SEEK_DIST = 10, /*!<ペットの行動範囲…特になし? */
PET_DESTROY_DIST = 255, /*!<ペットの行動範囲…敵を見つけて倒せ */
PET_SPACE_DIST = -10, /*!<ペットの行動範囲…少し離れていろ */
PET_AWAY_DIST = -25, /*!<ペットの行動範囲…離れていろ */
-} pet_follow_distance;
+};
-typedef enum pet_permission {
+enum pet_permission {
PF_OPEN_DOORS = 0x0001, /*!< ペットの行動許可…ドアを開けてよい */
PF_PICKUP_ITEMS = 0x0002, /*!< ペットの行動許可…アイテムを拾ってよい */
PF_TELEPORT = 0x0004, /*!< ペットの行動許可…テレポート魔法を使ってよい */
PF_SUMMON_SPELL = 0x0010, /*!< ペットの行動許可…召喚魔法を使ってよい */
PF_BALL_SPELL = 0x0020, /*!< ペットの行動許可…ボール魔法でプレイヤーを巻き込んでよい */
PF_TWO_HANDS = 0x0040, /*!< プレイヤーの騎乗フラグ…武器を片手で持つ */
-} pet_permission;
+};
#include "system/angband.h"
#include "grid/grid.h"
#include "system/object-type-definition.h"
#include "system/monster-type-definition.h"
-typedef enum chaotic_effect {
+enum chaotic_effect {
CE_NONE = 0,
CE_VAMPIRIC = 1,
CE_QUAKE = 2,
CE_CONFUSION = 3,
CE_TELE_AWAY = 4,
CE_POLYMORPH = 5,
-} chaotic_effect;
+};
typedef struct player_attack_type {
s16b hand;
*/
static void get_weapon_exp(player_type *attacker_ptr, player_attack_type *pa_ptr)
{
- tval_type tval = attacker_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand].tval - TV_WEAPON_BEGIN;
+ int tval = attacker_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand].tval - TV_WEAPON_BEGIN;
OBJECT_SUBTYPE_VALUE sval = attacker_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand].sval;
int now_exp = attacker_ptr->weapon_exp[tval][sval];
if (now_exp >= s_info[attacker_ptr->pclass].w_max[tval][sval])
g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (g_ptr->m_idx && (m_ptr->ml || cave_has_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)))
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
}
}
#pragma once
-typedef enum base_status_type {
+enum base_status_type {
A_STR = 0,
A_INT = 1,
A_WIS = 2,
A_CON = 4,
A_CHR = 5,
A_MAX = 6,
-} base_status_type;
+};
#pragma once
-typedef enum special_attack_type {
+enum special_attack_type {
ATTACK_CONFUSE = 0x00000001, /*!< プレイヤーのステータス:混乱打撃 */
ATTACK_XXX1 = 0x00000002, /*!< プレイヤーのステータス:未使用1 */
ATTACK_XXX2 = 0x00000004, /*!< プレイヤーのステータス:未使用2 */
ATTACK_POIS = 0x00000100, /*!< プレイヤーのステータス:魔法剣/毒殺 */
ATTACK_HOLY = 0x00000200, /*!< プレイヤーのステータス:対邪?(未使用) */
ATTACK_SUIKEN = 0x00000400, /*!< プレイヤーのステータス:酔拳 */
-} special_attack_type;
+};
-typedef enum special_defense_type {
+enum special_defense_type {
ACTION_NONE = 0, /*!< 持続行動: なし */
ACTION_SEARCH = 1, /*!< 持続行動: 探索 */
ACTION_REST = 2, /*!< 持続行動: 休憩 */
ACTION_SING = 7, /*!< 持続行動: 歌 */
ACTION_HAYAGAKE = 8, /*!< 持続行動: 早駆け */
ACTION_SPELL = 9, /*!< 持続行動: 呪術 */
-} special_defense_type;
+};
msg_print(_("「我が下僕たちよ、かの傲慢なる者を倒すべし!」", "'My pets, destroy the arrogant mortal!'"));
for (int i = 0, summon_num = randint1(5) + 1; i < summon_num; i++) {
- (void)summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0,
+ (void)summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_NONE,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
reward = _("モンスターを召喚された。", "summoning hostile monsters");
msg_print(_("「汝、謙虚たることを学ぶべし!」", "'Thou needst a lesson in humility, mortal!'"));
msg_print(_("あなたは以前より弱くなった!", "You feel less powerful!"));
- for (base_status_type stat = 0; stat < A_MAX; stat++) {
+ for (int stat = 0; stat < A_MAX; stat++) {
(void)dec_stat(creature_ptr, stat, 10 + randint1(15), TRUE);
}
reward = _("全能力値が下がった。", "decreasing all stats");
msg_print(_("「我がささやかなる賜物を受けとるがよい!」", "'Receive this modest gift from me!'"));
- for (base_status_type stat = 0; stat < A_MAX; stat++) {
+ for (int stat = 0; stat < A_MAX; stat++) {
(void)do_inc_stat(creature_ptr, stat);
}
reward = _("全能力値が上がった。", "increasing all stats");
}
break;
default:
- for (base_status_type stat = 0; stat < A_MAX; stat++) {
+ for (int stat = 0; stat < A_MAX; stat++) {
(void)dec_stat(creature_ptr, stat, 10 + randint1(15), TRUE);
}
reward = _("全能力値が下がった。", "decreasing all stats");
msg_print(_("「死ぬがよい、下僕よ!」", "'Die, mortal!'"));
take_hit(creature_ptr, DAMAGE_LOSELIFE, creature_ptr->lev * 4, wrath_reason, -1);
- for (base_status_type stat = 0; stat < A_MAX; stat++) {
+ for (int stat = 0; stat < A_MAX; stat++) {
(void)dec_stat(creature_ptr, stat, 10 + randint1(15), FALSE);
}
activate_hi_summon(creature_ptr, creature_ptr->y, creature_ptr->x, FALSE);
(void)activate_ty_curse(creature_ptr, FALSE, &count);
if (one_in_(2)) {
- inventory_slot_type slot = 0;
+ inventory_slot_type slot = INVEN_NONE;
if (has_melee_weapon(creature_ptr, INVEN_MAIN_HAND)) {
slot = INVEN_MAIN_HAND;
case REW_SER_MONS:
msg_format(_("%sは褒美として使いをよこした!", "%s rewards you with a servant!"), chaos_patrons[creature_ptr->chaos_patron]);
- if (!summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, PM_FORCE_PET))
+ if (!summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_NONE, PM_FORCE_PET))
msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
else
reward = _("モンスターがペットになった。", "a servant");
#pragma once
-typedef enum player_class_type {
+enum player_class_type {
CLASS_WARRIOR = 0,
CLASS_MAGE = 1,
CLASS_PRIEST = 2,
CLASS_NINJA = 26,
CLASS_SNIPER = 27,
MAX_CLASS = 28, /*!< 職業の最大定義数 Maximum number of player "class" types (see "table.c", etc) */
-} player_class_type;
+};
*/
int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
{
+ (void)monspell; // unused
+
int old_chp = creature_ptr->chp;
char death_message[1024];
#pragma once
-typedef enum player_personality_type {
+enum player_personality_type {
PERSONALITY_ORDINARY = 0,
PERSONALITY_MIGHTY = 1,
PERSONALITY_SHREWD = 2,
PERSONALITY_MUNCHKIN = 11,
PERSONALITY_CHARGEMAN = 12,
MAX_PERSONALITIES = 13,
-} player_personality_type;
+};
/*!
* @details 既にplayer_raceが存在するので_typeと付けた
*/
-typedef enum player_race_type {
+enum player_race_type {
RACE_HUMAN = 0,
RACE_HALF_ELF = 1,
RACE_ELF = 2,
RACE_ANDROID = 36,
RACE_MERFOLK = 37,
MAX_RACES = 38,
-} player_race_type;
+};
#include "system/angband.h"
/* 職業ごとの選択可能な魔法領域 / Possible realms that can be chosen. */
-typedef enum choosable_realm {
+enum choosable_realm {
CH_NONE = 0x00,
CH_LIFE = 0x01,
CH_SORCERY = 0x02,
CH_MUSIC = 0x8000,
CH_HISSATSU = 0x10000,
CH_HEX = 0x20000,
-} choosable_realm;
+};
extern const u32b realm_choices1[];
extern const u32b realm_choices2[];
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
BIT_FLAGS result = 0L;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
object_flags(creature_ptr, o_ptr, flgs);
if (has_flag(flgs, tr_flag))
- set_bits(result, convert_inventory_slot_type_to_flag_cause(i));
+ set_bits(result, convert_inventory_slot_type_to_flag_cause(static_cast<inventory_slot_type>(i)));
}
return result;
}
return result;
}
-BIT_FLAGS has_see_nocto(player_type *creature_ptr) { return creature_ptr->pclass == CLASS_NINJA ? FLAG_CAUSE_CLASS : 0L; }
+BIT_FLAGS has_see_nocto(player_type *creature_ptr) { return (creature_ptr->pclass == CLASS_NINJA) ? FLAG_CAUSE_CLASS : FLAG_CAUSE_NONE; }
BIT_FLAGS has_warning(player_type *creature_ptr)
{
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
if (has_flag(flgs, TR_WARNING)) {
if (!o_ptr->inscription || !(angband_strchr(quark_str(o_ptr->inscription), '$')))
- set_bits(result, convert_inventory_slot_type_to_flag_cause(i));
+ set_bits(result, convert_inventory_slot_type_to_flag_cause(static_cast<inventory_slot_type>(i)));
}
}
return result;
if (creature_ptr->riding) {
monster_type *riding_m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
- result = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? FLAG_CAUSE_RIDING : 0;
+ result = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? FLAG_CAUSE_RIDING : FLAG_CAUSE_NONE;
}
return result;
}
if (creature_ptr->pseikaku == PERSONALITY_SEXY)
creature_ptr->cursed |= (TRC_AGGRAVATE);
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
BIT_FLAGS flgs[TR_FLAG_SIZE];
creature_ptr->extra_blows[0] = creature_ptr->extra_blows[1] = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
if (!has_melee_weapon(creature_ptr, INVEN_MAIN_HAND + i)) {
return FALSE;
}
- tval_type tval = creature_ptr->inventory_list[INVEN_MAIN_HAND + i].tval - TV_WEAPON_BEGIN;
+ int tval = creature_ptr->inventory_list[INVEN_MAIN_HAND + i].tval - TV_WEAPON_BEGIN;
OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_MAIN_HAND + i].sval;
return creature_ptr->pclass == CLASS_NINJA
&& !((s_info[CLASS_NINJA].w_max[tval][sval] > WEAPON_EXP_BEGINNER) && (creature_ptr->inventory_list[INVEN_SUB_HAND - i].tval != TV_SHIELD));
if (!has_melee_weapon(creature_ptr, INVEN_MAIN_HAND + i)) {
return FALSE;
}
- tval_type tval = creature_ptr->inventory_list[INVEN_MAIN_HAND + i].tval - TV_WEAPON_BEGIN;
+ int tval = creature_ptr->inventory_list[INVEN_MAIN_HAND + i].tval - TV_WEAPON_BEGIN;
OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_MAIN_HAND + i].sval;
return ((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER)) && !(s_info[creature_ptr->pclass].w_max[tval][sval]);
}
#include "player/player-status.h"
#include "object-enchant/tr-types.h"
-enum flag_cause {
+enum flag_cause : uint32_t {
+ FLAG_CAUSE_NONE = 0x0U,
FLAG_CAUSE_INVEN_MAIN_HAND = 0x01U << 0, /*!< アイテムスロット…利手 */
FLAG_CAUSE_INVEN_SUB_HAND = 0x01U << 1, /*!< アイテムスロット…逆手 */
FLAG_CAUSE_INVEN_BOW = 0x01U << 2, /*!< アイテムスロット…射撃 */
FLAG_CAUSE_MAX = 0x01U << 21
};
-typedef enum melee_type {
+enum melee_type {
MELEE_TYPE_BAREHAND_TWO = 0,
MELEE_TYPE_BAREHAND_MAIN = 1,
MELEE_TYPE_BAREHAND_SUB = 2,
MELEE_TYPE_WEAPON_TWOHAND = 5,
MELEE_TYPE_WEAPON_DOUBLE = 6,
MELEE_TYPE_SHIELD_DOUBLE = 7
-} melee_type;
+};
enum aggravate_state {
AGGRAVATE_NONE = 0x00000000L,
#include "system/angband.h"
#include "player/player-status.h"
-typedef enum rate_calc_type_mode {
+enum rate_calc_type_mode {
CALC_RAND = 0,
CALC_AVERAGE = 1,
CALC_MIN = 2,
CALC_MAX = 3,
-} rate_calc_type_mode;
+};
PERCENTAGE calc_acid_damage_rate(player_type *creature_ptr);
/*!
* @brief 能力値テーブル / Abbreviations of healthy stats
*/
-const concptr stat_names[A_MAX] = {
+extern const concptr stat_names[A_MAX] = {
#ifdef JP
"腕力 :", "知能 :", "賢さ :", "器用 :", "耐久 :", "魅力 :"
#else
/*!
* @brief 能力値テーブル(能力低下時) / Abbreviations of damaged stats
*/
-const concptr stat_names_reduced[A_MAX] = {
+extern const concptr stat_names_reduced[A_MAX] = {
#ifdef JP
"腕力x:", "知能x:", "賢さx:", "器用x:", "耐久x:", "魅力x:"
#else
* @brief 基本必要経験値テーブル /
* Base experience levels, may be adjusted up for race and/or class
*/
-const s32b player_exp[PY_MAX_LEVEL] = { 10, 25, 45, 70, 100, 140, 200, 280, 380, /*10*/
+extern const s32b player_exp[PY_MAX_LEVEL] = { 10, 25, 45, 70, 100, 140, 200, 280, 380, /*10*/
500, 650, 850, 1100, 1400, 1800, 2300, 2900, 3600, 4400, /*20*/
5400, 6800, 8400, 10200, 12500, 17500, 25000, 35000L, 50000L, 75000L, /*30*/
100000L, 150000L, 200000L, 275000L, 350000L, 450000L, 550000L, 700000L, 850000L, 1000000L, /*40*/
/*!
* @brief 基本必要強化値テーブル(アンドロイド専用)
*/
-const s32b player_exp_a[PY_MAX_LEVEL] = { 20, 50, 100, 170, 280, 430, 650, 950, 1400, /*10*/
+extern const s32b player_exp_a[PY_MAX_LEVEL] = { 20, 50, 100, 170, 280, 430, 650, 950, 1400, /*10*/
1850, 2300, 2900, 3600, 4400, 5400, 6800, 8400, 10400, 12500, /*20*/
17500, 25000, 35000, 50000L, 75000L, 100000L, 150000L, 200000L, 275000L, 350000L, /*30*/
450000L, 550000L, 650000L, 800000L, 950000L, 1100000L, 1250000L, 1400000L, 1550000L, 1700000L, /*40*/
* 知力/賢さによるレベル毎の習得可能魔法数テーブル
* Stat Table (INT/WIS) -- Number of half-spells per level
*/
-const byte adj_mag_study[] = {
+extern const byte adj_mag_study[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 1 /* 8 */, 1 /* 9 */, 1 /* 10 */, 1 /* 11 */, 2 /* 12 */, 2 /* 13 */, 2 /* 14 */, 2 /* 15 */,
2 /* 16 */, 2 /* 17 */, 2 /* 18/00-18/09 */, 2 /* 18/10-18/19 */, 2 /* 18/20-18/29 */, 2 /* 18/30-18/39 */, 2 /* 18/40-18/49 */, 3 /* 18/50-18/59 */,
3 /* 18/60-18/69 */, 3 /* 18/70-18/79 */, 3 /* 18/80-18/89 */, 4 /* 18/90-18/99 */, 4 /* 18/100-18/109 */, 4 /* 18/110-18/119 */, 5 /* 18/120-18/129 */,
* 知力/賢さによるMP修正テーブル
* Stat Table (INT/WIS) -- extra 1/4-mana-points per level
*/
-const byte adj_mag_mana[] = {
+extern const byte adj_mag_mana[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 1 /* 8 */, 2 /* 9 */, 3 /* 10 */, 4 /* 11 */, 5 /* 12 */, 5 /* 13 */, 6 /* 14 */, 7 /* 15 */,
8 /* 16 */, 9 /* 17 */, 10 /* 18/00-18/09 */, 11 /* 18/10-18/19 */, 11 /* 18/20-18/29 */, 12 /* 18/30-18/39 */, 12 /* 18/40-18/49 */, 13 /* 18/50-18/59 */,
14 /* 18/60-18/69 */, 15 /* 18/70-18/79 */, 16 /* 18/80-18/89 */, 17 /* 18/90-18/99 */, 18 /* 18/100-18/109 */, 19 /* 18/110-18/119 */,
* 知力/賢さによる最低魔法失敗率テーブル
* Stat Table (INT/WIS) -- Minimum failure rate (percentage)
*/
-const byte adj_mag_fail[] = {
+extern const byte adj_mag_fail[] = {
99 /* 3 */, 99 /* 4 */, 99 /* 5 */, 99 /* 6 */, 99 /* 7 */, 50 /* 8 */, 30 /* 9 */, 20 /* 10 */, 15 /* 11 */, 12 /* 12 */, 11 /* 13 */, 10 /* 14 */,
9 /* 15 */, 8 /* 16 */, 7 /* 17 */, 6 /* 18/00-18/09 */, 6 /* 18/10-18/19 */, 5 /* 18/20-18/29 */, 5 /* 18/30-18/39 */, 5 /* 18/40-18/49 */,
4 /* 18/50-18/59 */, 4 /* 18/60-18/69 */, 4 /* 18/70-18/79 */, 4 /* 18/80-18/89 */, 3 /* 18/90-18/99 */, 3 /* 18/100-18/109 */, 2 /* 18/110-18/119 */,
* 知力/賢さによる魔法失敗率修正テーブル
* Stat Table (INT/WIS) -- Various things
*/
-const byte adj_mag_stat[] = {
+extern const byte adj_mag_stat[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 1 /* 8 */, 1 /* 9 */, 1 /* 10 */, 1 /* 11 */, 1 /* 12 */, 1 /* 13 */, 1 /* 14 */, 2 /* 15 */,
2 /* 16 */, 2 /* 17 */, 3 /* 18/00-18/09 */, 3 /* 18/10-18/19 */, 3 /* 18/20-18/29 */, 3 /* 18/30-18/39 */, 3 /* 18/40-18/49 */, 4 /* 18/50-18/59 */,
4 /* 18/60-18/69 */, 5 /* 18/70-18/79 */, 6 /* 18/80-18/89 */, 7 /* 18/90-18/99 */, 8 /* 18/100-18/109 */, 9 /* 18/110-18/119 */, 10 /* 18/120-18/129 */,
* 魅力による店での取引修正テーブル
* Stat Table (CHR) -- payment percentages
*/
-const byte adj_chr_gold[] = {
+extern const byte adj_chr_gold[] = {
130 /* 3 */, 125 /* 4 */, 122 /* 5 */, 120 /* 6 */, 118 /* 7 */, 116 /* 8 */, 114 /* 9 */, 112 /* 10 */, 110 /* 11 */, 108 /* 12 */, 106 /* 13 */,
104 /* 14 */, 103 /* 15 */, 102 /* 16 */, 101 /* 17 */, 100 /* 18/00-18/09 */, 99 /* 18/10-18/19 */, 98 /* 18/20-18/29 */, 97 /* 18/30-18/39 */,
96 /* 18/40-18/49 */, 95 /* 18/50-18/59 */, 94 /* 18/60-18/69 */, 93 /* 18/70-18/79 */, 92 /* 18/80-18/89 */, 91 /* 18/90-18/99 */, 90 /* 18/100-18/109 */,
* 知力による魔道具使用修正テーブル
* Stat Table (INT) -- Magic devices
*/
-const byte adj_int_dev[] = {
+extern const byte adj_int_dev[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 1 /* 8 */, 1 /* 9 */, 1 /* 10 */, 1 /* 11 */, 1 /* 12 */, 1 /* 13 */, 1 /* 14 */, 2 /* 15 */,
2 /* 16 */, 2 /* 17 */, 3 /* 18/00-18/09 */, 3 /* 18/10-18/19 */, 4 /* 18/20-18/29 */, 4 /* 18/30-18/39 */, 5 /* 18/40-18/49 */, 5 /* 18/50-18/59 */,
6 /* 18/60-18/69 */, 6 /* 18/70-18/79 */, 7 /* 18/80-18/89 */, 7 /* 18/90-18/99 */, 8 /* 18/100-18/109 */, 9 /* 18/110-18/119 */, 10 /* 18/120-18/129 */,
* 賢さによる魔法防御修正テーブル
* Stat Table (WIS) -- Saving throw
*/
-const byte adj_wis_sav[] = {
+extern const byte adj_wis_sav[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 1 /* 8 */, 1 /* 9 */, 1 /* 10 */, 1 /* 11 */, 1 /* 12 */, 1 /* 13 */, 1 /* 14 */, 2 /* 15 */,
2 /* 16 */, 2 /* 17 */, 3 /* 18/00-18/09 */, 3 /* 18/10-18/19 */, 3 /* 18/20-18/29 */, 3 /* 18/30-18/39 */, 3 /* 18/40-18/49 */, 4 /* 18/50-18/59 */,
4 /* 18/60-18/69 */, 5 /* 18/70-18/79 */, 5 /* 18/80-18/89 */, 6 /* 18/90-18/99 */, 7 /* 18/100-18/109 */, 8 /* 18/110-18/119 */, 9 /* 18/120-18/129 */,
* 器用さによるトラップ解除修正テーブル
* Stat Table (DEX) -- disarming
*/
-const byte adj_dex_dis[] = {
+extern const byte adj_dex_dis[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 0 /* 8 */, 0 /* 9 */, 0 /* 10 */, 0 /* 11 */, 0 /* 12 */, 1 /* 13 */, 1 /* 14 */, 1 /* 15 */,
2 /* 16 */, 2 /* 17 */, 4 /* 18/00-18/09 */, 4 /* 18/10-18/19 */, 4 /* 18/20-18/29 */, 4 /* 18/30-18/39 */, 5 /* 18/40-18/49 */, 5 /* 18/50-18/59 */,
5 /* 18/60-18/69 */, 6 /* 18/70-18/79 */, 6 /* 18/80-18/89 */, 7 /* 18/90-18/99 */, 8 /* 18/100-18/109 */, 8 /* 18/110-18/119 */, 8 /* 18/120-18/129 */,
* 知力によるトラップ解除修正テーブル
* Stat Table (INT) -- disarming
*/
-const byte adj_int_dis[] = {
+extern const byte adj_int_dis[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 1 /* 8 */, 1 /* 9 */, 1 /* 10 */, 1 /* 11 */, 1 /* 12 */, 1 /* 13 */, 1 /* 14 */, 2 /* 15 */,
2 /* 16 */, 2 /* 17 */, 3 /* 18/00-18/09 */, 3 /* 18/10-18/19 */, 3 /* 18/20-18/29 */, 4 /* 18/30-18/39 */, 4 /* 18/40-18/49 */, 5 /* 18/50-18/59 */,
6 /* 18/60-18/69 */, 7 /* 18/70-18/79 */, 8 /* 18/80-18/89 */, 9 /* 18/90-18/99 */, 10 /* 18/100-18/109 */, 10 /* 18/110-18/119 */, 11 /* 18/120-18/129 */,
* 器用さによるAC修正テーブル
* Stat Table (DEX) -- bonus to ac (plus 128)
*/
-const byte adj_dex_ta[] = {
+extern const byte adj_dex_ta[] = {
128 + -4 /* 3 */, 128 + -3 /* 4 */, 128 + -2 /* 5 */, 128 + -1 /* 6 */, 128 + 0 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */,
128 + 0 /* 11 */, 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 0 /* 14 */, 128 + 1 /* 15 */, 128 + 1 /* 16 */, 128 + 1 /* 17 */, 128 + 2 /* 18/00-18/09 */,
128 + 2 /* 18/10-18/19 */, 128 + 2 /* 18/20-18/29 */, 128 + 2 /* 18/30-18/39 */, 128 + 2 /* 18/40-18/49 */, 128 + 3 /* 18/50-18/59 */,
* 腕力によるダメージ修正テーブル
* Stat Table (STR) -- bonus to dam (plus 128)
*/
-const byte adj_str_td[] = {
+extern const byte adj_str_td[] = {
128 + -2 /* 3 */, 128 + -2 /* 4 */, 128 + -1 /* 5 */, 128 + -1 /* 6 */, 128 + 0 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */,
128 + 0 /* 11 */, 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 0 /* 14 */, 128 + 0 /* 15 */, 128 + 1 /* 16 */, 128 + 2 /* 17 */, 128 + 2 /* 18/00-18/09 */,
128 + 2 /* 18/10-18/19 */, 128 + 3 /* 18/20-18/29 */, 128 + 3 /* 18/30-18/39 */, 128 + 3 /* 18/40-18/49 */, 128 + 3 /* 18/50-18/59 */,
* 器用度による命中修正テーブル
* Stat Table (DEX) -- bonus to hit (plus 128)
*/
-const byte adj_dex_th[] = {
+extern const byte adj_dex_th[] = {
128 + -3 /* 3 */, 128 + -2 /* 4 */, 128 + -2 /* 5 */, 128 + -1 /* 6 */, 128 + -1 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */,
128 + 0 /* 11 */, 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 0 /* 14 */, 128 + 0 /* 15 */, 128 + 1 /* 16 */, 128 + 2 /* 17 */, 128 + 3 /* 18/00-18/09 */,
128 + 3 /* 18/10-18/19 */, 128 + 3 /* 18/20-18/29 */, 128 + 3 /* 18/30-18/39 */, 128 + 3 /* 18/40-18/49 */, 128 + 4 /* 18/50-18/59 */,
* 腕力による命中修正テーブル
* Stat Table (STR) -- bonus to hit (plus 128)
*/
-const byte adj_str_th[] = {
+extern const byte adj_str_th[] = {
128 + -3 /* 3 */, 128 + -2 /* 4 */, 128 + -1 /* 5 */, 128 + -1 /* 6 */, 128 + 0 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */,
128 + 0 /* 11 */, 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 0 /* 14 */, 128 + 0 /* 15 */, 128 + 0 /* 16 */, 128 + 0 /* 17 */, 128 + 1 /* 18/00-18/09 */,
128 + 1 /* 18/10-18/19 */, 128 + 1 /* 18/20-18/29 */, 128 + 1 /* 18/30-18/39 */, 128 + 1 /* 18/40-18/49 */, 128 + 1 /* 18/50-18/59 */,
* 腕力による基本所持重量値テーブル
* Stat Table (STR) -- weight limit in deca-pounds
*/
-const byte adj_str_wgt[] = {
+extern const byte adj_str_wgt[] = {
10 /* 3 */, 11 /* 4 */, 12 /* 5 */, 13 /* 6 */, 14 /* 7 */, 15 /* 8 */, 16 /* 9 */, 17 /* 10 */, 18 /* 11 */, 19 /* 12 */, 20 /* 13 */, 21 /* 14 */,
22 /* 15 */, 23 /* 16 */, 24 /* 17 */, 25 /* 18/00-18/09 */, 26 /* 18/10-18/19 */, 27 /* 18/20-18/29 */, 28 /* 18/30-18/39 */, 29 /* 18/40-18/49 */,
30 /* 18/50-18/59 */, 31 /* 18/60-18/69 */, 31 /* 18/70-18/79 */, 32 /* 18/80-18/89 */, 32 /* 18/90-18/99 */, 33 /* 18/100-18/109 */,
* 腕力による武器重量限界値テーブル
* Stat Table (STR) -- weapon weight limit in pounds
*/
-const byte adj_str_hold[] = {
+extern const byte adj_str_hold[] = {
4 /* 3 */, 5 /* 4 */, 6 /* 5 */, 7 /* 6 */, 8 /* 7 */, 9 /* 8 */, 10 /* 9 */, 11 /* 10 */, 12 /* 11 */, 13 /* 12 */, 14 /* 13 */, 15 /* 14 */, 16 /* 15 */,
17 /* 16 */, 18 /* 17 */, 19 /* 18/00-18/09 */, 20 /* 18/10-18/19 */, 21 /* 18/20-18/29 */, 22 /* 18/30-18/39 */, 23 /* 18/40-18/49 */,
24 /* 18/50-18/59 */, 25 /* 18/60-18/69 */, 26 /* 18/70-18/79 */, 27 /* 18/80-18/89 */, 28 /* 18/90-18/99 */, 30 /* 18/100-18/109 */,
* 腕力による採掘能力修正値テーブル
* Stat Table (STR) -- digging value
*/
-const byte adj_str_dig[] = {
+extern const byte adj_str_dig[] = {
0 /* 3 */, 0 /* 4 */, 1 /* 5 */, 2 /* 6 */, 3 /* 7 */, 4 /* 8 */, 4 /* 9 */, 5 /* 10 */, 5 /* 11 */, 6 /* 12 */, 6 /* 13 */, 7 /* 14 */, 7 /* 15 */,
8 /* 16 */, 8 /* 17 */, 9 /* 18/00-18/09 */, 10 /* 18/10-18/19 */, 12 /* 18/20-18/29 */, 15 /* 18/30-18/39 */, 20 /* 18/40-18/49 */, 25 /* 18/50-18/59 */,
30 /* 18/60-18/69 */, 35 /* 18/70-18/79 */, 40 /* 18/80-18/89 */, 45 /* 18/90-18/99 */, 50 /* 18/100-18/109 */, 55 /* 18/110-18/119 */,
* 器用さによる盗難防止&体当たり成功判定修正テーブル
* Stat Table (DEX) -- chance of avoiding "theft" and "falling"
*/
-const byte adj_dex_safe[] = {
+extern const byte adj_dex_safe[] = {
0 /* 3 */, 1 /* 4 */, 2 /* 5 */, 3 /* 6 */, 4 /* 7 */, 5 /* 8 */, 5 /* 9 */, 6 /* 10 */, 6 /* 11 */, 7 /* 12 */, 7 /* 13 */, 8 /* 14 */, 8 /* 15 */,
9 /* 16 */, 9 /* 17 */, 10 /* 18/00-18/09 */, 10 /* 18/10-18/19 */, 15 /* 18/20-18/29 */, 15 /* 18/30-18/39 */, 20 /* 18/40-18/49 */, 25 /* 18/50-18/59 */,
30 /* 18/60-18/69 */, 35 /* 18/70-18/79 */, 40 /* 18/80-18/89 */, 45 /* 18/90-18/99 */, 50 /* 18/100-18/109 */, 60 /* 18/110-18/119 */,
* 耐久による基本HP自然治癒値テーブル /
* Stat Table (CON) -- base regeneration rate
*/
-const byte adj_con_fix[] = {
+extern const byte adj_con_fix[] = {
0 /* 3 */, 0 /* 4 */, 0 /* 5 */, 0 /* 6 */, 0 /* 7 */, 0 /* 8 */, 0 /* 9 */, 0 /* 10 */, 0 /* 11 */, 0 /* 12 */, 0 /* 13 */, 1 /* 14 */, 1 /* 15 */,
1 /* 16 */, 1 /* 17 */, 2 /* 18/00-18/09 */, 2 /* 18/10-18/19 */, 2 /* 18/20-18/29 */, 2 /* 18/30-18/39 */, 2 /* 18/40-18/49 */, 3 /* 18/50-18/59 */,
3 /* 18/60-18/69 */, 3 /* 18/70-18/79 */, 3 /* 18/80-18/89 */, 3 /* 18/90-18/99 */, 4 /* 18/100-18/109 */, 4 /* 18/110-18/119 */, 5 /* 18/120-18/129 */,
* 耐久による基本HP自然治癒値テーブル /
* Stat Table (CON) -- extra 1/4-hitpoints per level (plus 128)
*/
-const byte adj_con_mhp[] = {
+extern const byte adj_con_mhp[] = {
128 + -8 /* 3 */, 128 + -6 /* 4 */, 128 + -4 /* 5 */, 128 + -2 /* 6 */, 128 + -1 /* 7 */, 128 + 0 /* 8 */, 128 + 0 /* 9 */, 128 + 0 /* 10 */,
128 + 0 /* 11 */, 128 + 0 /* 12 */, 128 + 0 /* 13 */, 128 + 1 /* 14 */, 128 + 1 /* 15 */, 128 + 2 /* 16 */, 128 + 3 /* 17 */, 128 + 4 /* 18/00-18/09 */,
128 + 5 /* 18/10-18/19 */, 128 + 6 /* 18/20-18/29 */, 128 + 7 /* 18/30-18/39 */, 128 + 8 /* 18/40-18/49 */, 128 + 9 /* 18/50-18/59 */,
* 魅力による魅了能力修正テーブル /
* Stat Table (CHR) -- charm
*/
-const byte adj_chr_chm[] = {
+extern const byte adj_chr_chm[] = {
0 /* 3 */, 0 /* 4 */, 1 /* 5 */, 2 /* 6 */, 3 /* 7 */, 4 /* 8 */, 4 /* 9 */, 5 /* 10 */, 5 /* 11 */, 6 /* 12 */, 6 /* 13 */, 7 /* 14 */, 7 /* 15 */,
8 /* 16 */, 8 /* 17 */, 9 /* 18/00-18/09 */, 10 /* 18/10-18/19 */, 12 /* 18/20-18/29 */, 15 /* 18/30-18/39 */, 18 /* 18/40-18/49 */, 21 /* 18/50-18/59 */,
24 /* 18/60-18/69 */, 28 /* 18/70-18/79 */, 32 /* 18/80-18/89 */, 36 /* 18/90-18/99 */, 39 /* 18/100-18/109 */, 42 /* 18/110-18/119 */,
WEIGHT weight = 0;
object_type *o_ptr;
- for (inventory_slot_type i = 0; i < INVEN_TOTAL; i++) {
+ for (int i = 0; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
int extra_shots = 0;
BIT_FLAGS flgs[TR_FLAG_SIZE];
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *q_ptr;
q_ptr = &creature_ptr->inventory_list[i];
if (!q_ptr->k_idx)
num = 100;
num += (extra_shots * 100);
- tval_type tval_ammo = bow_tval_ammo(o_ptr);
+ tval_type tval_ammo = static_cast<tval_type>(bow_tval_ammo(o_ptr));
if ((creature_ptr->pclass == CLASS_RANGER) && (tval_ammo == TV_ARROW)) {
num += (creature_ptr->lev * 4);
}
pow += 3;
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
{
ACTION_SKILL_POWER result = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
pow = tmp_rp_ptr->r_dev + c_ptr->c_dev + a_ptr->a_dev;
pow += ((c_ptr->x_dev * creature_ptr->lev / 10) + (ap_ptr->a_dev * creature_ptr->lev / 50));
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
pow = tmp_rp_ptr->r_srh + c_ptr->c_srh + a_ptr->a_srh;
pow += (c_ptr->x_srh * creature_ptr->lev / 10);
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
pow = tmp_rp_ptr->r_fos + c_ptr->c_fos + a_ptr->a_fos;
pow += (c_ptr->x_fos * creature_ptr->lev / 10);
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
if (creature_ptr->pclass == CLASS_BERSERKER)
pow += (100 + creature_ptr->lev * 8);
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
pow++;
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku];
pow = tmp_rp_ptr->r_adj[A_INT] + c_ptr->c_adj[A_INT] + a_ptr->a_adj[A_INT];
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku];
pow = tmp_rp_ptr->r_adj[A_WIS] + c_ptr->c_adj[A_WIS] + a_ptr->a_adj[A_WIS];
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
pow--;
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
pow++;
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku];
pow = tmp_rp_ptr->r_adj[A_CHR] + c_ptr->c_adj[A_CHR] + a_ptr->a_adj[A_CHR];
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
if (creature_ptr->pseikaku == PERSONALITY_CHARGEMAN)
chance += 5;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
o_ptr = &creature_ptr->inventory_list[i];
if (creature_ptr->yoiyami)
return 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
ac -= 50;
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[i];
object_flags(creature_ptr, o_ptr, flags);
ac += 30;
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i <= INVEN_FEET; i++) {
+ for (int i = INVEN_MAIN_HAND; i <= INVEN_FEET; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
static SPEED calc_player_speed_by_equipment(player_type *creature_ptr)
{
SPEED result = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(creature_ptr, o_ptr, flgs);
}
}
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
int bonus_to_d = 0;
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx || o_ptr->tval == TV_CAPTURE || (i == INVEN_MAIN_HAND && has_melee_weapon(creature_ptr, i))
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(creature_ptr, o_ptr, flgs);
- tval_type tval = o_ptr->tval - TV_WEAPON_BEGIN;
+ int tval = o_ptr->tval - TV_WEAPON_BEGIN;
OBJECT_SUBTYPE_VALUE sval = o_ptr->sval;
/* Traind bonuses */
}
/* Bonuses from inventory */
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
/* Ignore empty hands, handed weapons, bows and capture balls */
}
// 武器以外の装備による修正
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
int bonus_to_h;
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx || o_ptr->tval == TV_CAPTURE || (i == INVEN_MAIN_HAND && has_melee_weapon(creature_ptr, i))
s16b to_dam = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
s16b to_hit = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
case MELEE_TYPE_SHIELD_DOUBLE:
return PLAYER_HAND_MAIN;
}
- return 0;
+ return PLAYER_HAND_MAIN;
}
};
/*!< Weapon hand status */
-typedef enum player_hand { PLAYER_HAND_MAIN = 0x0000, PLAYER_HAND_SUB = 0x0001, PLAYER_HAND_OTHER = 0x0002 } player_hand;
+enum player_hand {
+ PLAYER_HAND_MAIN = 0x0000,
+ PLAYER_HAND_SUB = 0x0001,
+ PLAYER_HAND_OTHER = 0x0002
+};
/*
* Player sex constants (hard-coded by save-files, arrays, etc)
extern s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
BIT_FLAGS player_flags_speed(player_type *creature_ptr);
BIT_FLAGS player_flags_stealth(player_type *creature_ptr);
-static void update_bonuses(player_type *creature_ptr);
extern WEIGHT calc_weight_limit(player_type *creature_ptr);
extern bool has_melee_weapon(player_type *creature_ptr, int i);
{
if (creature_ptr->equip_cnt) {
term_clear();
- (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
+ (void)show_equipment(creature_ptr, 0, USE_FULL, TV_NONE);
prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0);
if (inkey() == ESCAPE)
return TRUE;
if (creature_ptr->inven_cnt) {
term_clear();
- (void)show_inventory(creature_ptr, 0, USE_FULL, 0);
+ (void)show_inventory(creature_ptr, 0, USE_FULL, TV_NONE);
prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0);
if (inkey() == ESCAPE)
return;
show_dead_home_items(creature_ptr);
-}
\ No newline at end of file
+}
for (int i = 0; i < TR_FLAG_SIZE; i++)
flags[i] = 0L;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
{
u32b o_flags[TR_FLAG_SIZE];
object_type *o_ptr;
#pragma once
-typedef enum special_defence {
+enum special_defence {
DEFENSE_ACID = 0x00000001, /*!< プレイヤーのステータス:酸免疫 */
DEFENSE_ELEC = 0x00000002, /*!< プレイヤーのステータス:電撃免疫 */
DEFENSE_FIRE = 0x00000004, /*!< プレイヤーのステータス:火炎免疫 */
KATA_MUSOU = 0x00001000, /*!< プレイヤーのステータス:無想 */
NINJA_KAWARIMI = 0x00002000, /*!< プレイヤーのステータス:変わり身 */
NINJA_S_STEALTH = 0x00004000, /*!< プレイヤーのステータス:超隠密 */
-} special_defence;
+};
#define MAX_KAMAE 4 /*!< 修行僧の構え最大数 */
#define KAMAE_MASK (KAMAE_GENBU | KAMAE_BYAKKO | KAMAE_SEIRYU | KAMAE_SUZAKU) /*!< 修行僧の構えビット配列 */
if (is_oppose_pois(creature_ptr))
add_flag(flags, TR_RES_POIS);
- for (tr_type test_flag = 0; test_flag < TR_FLAG_MAX; test_flag++) {
- if (any_bits(get_player_flags(creature_ptr, test_flag), tmp_effect_flag))
+ for (int test_flag = 0; test_flag < TR_FLAG_MAX; test_flag++) {
+ if (any_bits(get_player_flags(creature_ptr, static_cast<tr_type>(test_flag)), tmp_effect_flag))
add_flag(flags, test_flag);
}
}
if (creature_ptr->is_dead || (creature_ptr->prace != RACE_ANDROID))
return;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
object_type forge;
object_type *q_ptr = &forge;
return TRUE;
}
- return (command != -4) || identify_fully(creature_ptr, FALSE, 0);
+ return (command != -4) || identify_fully(creature_ptr, FALSE, TV_NONE);
case CLASS_IMITATOR:
handle_stuff(creature_ptr);
return do_cmd_mane(creature_ptr, TRUE);
return recall_player(creature_ptr, randint0(21) + 15);
case CLASS_SMITH:
if (creature_ptr->lev <= 29)
- return ident_spell(creature_ptr, TRUE, 0);
+ return ident_spell(creature_ptr, TRUE, TV_NONE);
- return identify_fully(creature_ptr, TRUE, 0);
+ return identify_fully(creature_ptr, TRUE, TV_NONE);
case CLASS_MIRROR_MASTER:
if (command == -3) {
remove_all_mirrors(creature_ptr, TRUE);
{
if (cast) {
- if (!ident_spell(caster_ptr, FALSE, 0))
+ if (!ident_spell(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast) {
- if (!identify_fully(caster_ptr, FALSE, 0))
+ if (!identify_fully(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast) {
if (randint1(50) > plev) {
- if (!ident_spell(caster_ptr, FALSE, 0))
+ if (!ident_spell(caster_ptr, FALSE, TV_NONE))
return NULL;
} else {
- if (!identify_fully(caster_ptr, FALSE, 0))
+ if (!identify_fully(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
#pragma once
-typedef enum realm_hex_type {
+enum realm_hex_type {
/* 1st book */
HEX_BLESS = 0,
HEX_CURE_LIGHT = 1,
HEX_SHADOW_MOVE = 29,
HEX_ANTI_MAGIC = 30,
HEX_REVENGE = 31,
-} realm_hex_type;
+};
q = _("どれを呪いますか?", "Which weapon do you curse?");
s = _("武器を装備していない。", "You're not wielding a weapon.");
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), TV_NONE);
if (!o_ptr)
return FALSE;
q = _("どれを呪いますか?", "Which piece of armour do you curse?");
s = _("防具を装備していない。", "You're not wearing any armor.");
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), TV_NONE);
if (!o_ptr)
return FALSE;
q = _("どの装備品から吸収しますか?", "Which cursed equipment do you drain mana from?");
s = _("呪われたアイテムを装備していない。", "You have no cursed equipment.");
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), TV_NONE);
if (!o_ptr)
return FALSE;
y = caster_ptr->y + ddy_cdd[cdir];
x = caster_ptr->x + ddx_cdd[cdir];
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = caster_ptr->y + ddy_cdd[(cdir + 7) % 8];
x = caster_ptr->x + ddx_cdd[(cdir + 7) % 8];
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = caster_ptr->y + ddy_cdd[(cdir + 1) % 8];
x = caster_ptr->x + ddx_cdd[(cdir + 1) % 8];
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
}
return NULL;
}
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
|| is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
x = caster_ptr->x + ddx[dir];
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return NULL;
if (cast) {
if (plev > 44) {
- if (!identify_fully(caster_ptr, TRUE, 0))
+ if (!identify_fully(caster_ptr, TRUE, TV_NONE))
return NULL;
} else {
- if (!ident_spell(caster_ptr, TRUE, 0))
+ if (!ident_spell(caster_ptr, TRUE, TV_NONE))
return NULL;
}
}
x = caster_ptr->x + ddx[dir];
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
handle_stuff(caster_ptr);
- do_cmd_attack(caster_ptr, y, x, 0);
+ do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
}
} else {
msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
{
if (cast) {
- if (!ident_spell(caster_ptr, FALSE, 0))
+ if (!ident_spell(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast) {
- if (!identify_fully(caster_ptr, FALSE, 0))
+ if (!identify_fully(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast) {
- if (!identify_fully(caster_ptr, FALSE, 0))
+ if (!identify_fully(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
#pragma once
-typedef enum realm_song_type {
+enum realm_song_type {
MUSIC_NONE = 0,
MUSIC_SLOW = 1,
MUSIC_BLESS = 2,
MUSIC_H_LIFE = 21,
MUSIC_INVULN = 22,
MUSIC_PSI = 23,
-} realm_song_type;
+};
#define MUSIC_DETECT 101
{
if (cast) {
- if (!ident_spell(caster_ptr, FALSE, 0))
+ if (!ident_spell(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast) {
- if (!identify_fully(caster_ptr, FALSE, 0))
+ if (!identify_fully(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast || fail) {
- int type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
+ summon_type type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
msg_print(_("あなたは動物のカードに集中する...", "You concentrate on the trump of an animal..."));
if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L)) {
if (fail) {
{
if (cast || fail) {
POSITION x, y;
- int type;
+ summon_type type;
if (cast) {
if (!target_set(caster_ptr, TARGET_KILL))
{
if (cast || fail) {
- int type;
+ summon_type type;
msg_print(_("あなたはモンスターのカードに集中する...", "You concentrate on several trumps at once..."));
if (caster_ptr->pclass == CLASS_BEASTMASTER)
type = SUMMON_LIVING;
else
- type = 0;
+ type = SUMMON_NONE;
if (trump_summoning(caster_ptr, (1 + (plev - 15) / 10), !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L)) {
if (fail) {
{
if (cast) {
- if (!identify_fully(caster_ptr, FALSE, 0))
+ if (!identify_fully(caster_ptr, FALSE, TV_NONE))
return NULL;
}
}
{
if (cast) {
- int type;
+ summon_type type;
if (caster_ptr->pclass == CLASS_BEASTMASTER)
type = SUMMON_HI_DRAGON_LIVING;
#pragma once
-typedef enum magic_realm_type {
+enum magic_realm_type {
REALM_NONE = 0,
REALM_LIFE = 1,
REALM_SORCERY = 2,
REALM_HISSATSU = 17,
REALM_HEX = 18,
MAX_REALM = 18,
-} magic_realm_type;
+};
#pragma once
/* 池型地形の生成ID / Room types for generate_lake() */
-typedef enum lake_type {
+enum lake_type {
LAKE_T_LAVA = 1, /*!< 池型地形ID: 溶岩 */
LAKE_T_WATER = 2, /*!< 池型地形ID: 池 */
LAKE_T_CAVE = 3, /*!< 池型地形ID: 空洞 */
LAKE_T_AIR_VAULT = 5, /*!< 池型地形ID: 風属性VAULT */
LAKE_T_WATER_VAULT = 6, /*!< 池型地形ID: 水属性VAULT */
LAKE_T_FIRE_VAULT = 7, /*!< 池型地形ID: 火属性VAULT */
-} lake_type;
+};
#pragma once
/* 部屋型ID / Room types for room_build() */
-typedef enum room_type {
+enum room_type {
ROOM_T_NORMAL = 0, /*!<部屋型ID:基本長方形 / Simple (33x11) */
ROOM_T_OVERLAP = 1, /*!<部屋型ID:長方形二つ重ね / Overlapping (33x11) */
ROOM_T_CROSS = 2, /*!<部屋型ID:十字 / Crossed (33x11) */
ROOM_T_ARCADE = 15, /*!<部屋型ID:商店 / Arcade */
ROOM_T_FIXED = 16, /*!<部屋型ID:固定部屋 / Fixed room */
ROOM_T_MAX = 17, /*!<部屋型ID最大数 */
-} room_type;
+};
#include "floor/floor-save.h"
#include "system/angband.h"
-typedef enum save_type {
+enum save_type {
SAVE_TYPE_CLOSE_GAME = 0,
SAVE_TYPE_CONTINUE_GAME = 1,
SAVE_TYPE_DEBUG = 2
-}save_type;
+};
bool save_player(player_type *player_ptr, save_type type);
if (randint1(100)<target_ptr->current_floor_ptr->dun_level)
activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
else
- (void)summon_specific(target_ptr, 0, y, x, mon_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
}
o_ptr->pval = 0;
}
}
-
void update_lite_radius(player_type *creature_ptr)
{
creature_ptr->cur_lite = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[i];
BIT_FLAGS flgs[TR_FLAG_SIZE];
mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
count += summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x,
- (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : caster_ptr->current_floor_ptr->dun_level), 0, mode);
+ (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : caster_ptr->current_floor_ptr->dun_level), SUMMON_NONE, mode);
if (!one_in_(6))
break;
}
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr)
return FALSE;
static int exe_curse_removal(player_type *creature_ptr, int all)
{
int cnt = 0;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx)
continue;
concptr s = _("強化できるアイテムがない。", "You have nothing to enchant.");
object_type *o_ptr;
OBJECT_IDX item;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return FALSE;
concptr q = _("どれを使いますか?", "Use which item? ");
concptr s = _("使えるものがありません。", "You have nothing you can use.");
- o_ptr = choose_object(owner_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(owner_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return FALSE;
concptr s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return FALSE;
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return FALSE;
case 8:
case 9:
case 18:
- (*count) += summon_specific(target_ptr, 0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (*count) += summon_specific(target_ptr, 0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
if (!one_in_(6))
break;
/* Fall through */
case 34:
case 35:
for (int counter = 0; counter < 8; counter++) {
- (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+ (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3) / 2, static_cast<summon_type>(type), (PM_ALLOW_GROUP | PM_NO_PET));
}
break;
*/
void teleport_player(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode)
{
- if (!teleport_player_aux(creature_ptr, dis, FALSE, mode))
+ if (!teleport_player_aux(creature_ptr, dis, FALSE, static_cast<teleport_flags>(mode)))
return;
/* Monsters with teleport ability may follow the player */
concptr q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
concptr s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
OBJECT_IDX item;
- object_type *o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, 0);
+ object_type *o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, TV_NONE);
if (o_ptr == NULL)
return FALSE;
concptr s = _("金に変えられる物がありません。", "You have nothing to turn to gold.");
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr)
return FALSE;
if (die < 30) {
msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
trump_summoning(
- caster_ptr, 1, FALSE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+ caster_ptr, 1, FALSE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), static_cast<summon_type>(SUMMON_UNIQUE + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
return;
}
if (die < 111) {
msg_print(_("《審判》だ。", "It's Judgement."));
- roll_hitdice(caster_ptr, 0L);
+ roll_hitdice(caster_ptr, SPOP_NONE);
lose_all_mutations(caster_ptr);
return;
}
#pragma once
-typedef enum spells_type
+enum spells_type
{
GF_NONE = 0,
GF_ELEC = 1, /*!< 魔法効果: 電撃*/
GF_STASIS_EVIL = 115, /*!< 魔法効果: 邪悪拘束*/
GF_WOUNDS = 116, /*!< 魔法効果: 創傷*/
MAX_GF = 117, /*!< 欠番を無視した最大サイズ (直上の値+1) */
-} spells_type;
+};
{ TV_SWORD, SV_BROKEN_DAGGER, 3, AMS_FIXED_ART }, // Broken Dagger of Magician
{ TV_SWORD, SV_BROKEN_DAGGER, 10, AMS_NOTHING }, { TV_SWORD, SV_BROKEN_SWORD, 5, AMS_NOTHING }, { TV_SCROLL, SV_SCROLL_AMUSEMENT, 10, AMS_NOTHING },
- { 0, 0, 0, 0 } };
+ { TV_NONE, 0, 0, 0 } };
/*!
* @brief 誰得ドロップを行う。
{
object_type *i_ptr;
object_type object_type_body;
- BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L);
+ BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : AM_NONE) | (special ? AM_SPECIAL : AM_NONE);
/* Acquirement */
while (num--) {
bool perilous_secrets(player_type *user_ptr)
{
- if (!ident_spell(user_ptr, FALSE, 0))
+ if (!ident_spell(user_ptr, FALSE, TV_NONE))
return FALSE;
if (mp_ptr->spell_book) {
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
if (!o_ptr)
return FALSE;
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | IGNORE_BOTHHAND_SLOT, 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | IGNORE_BOTHHAND_SLOT, TV_NONE);
if (!o_ptr)
return;
* @param mode モンスター生成条件フラグ
* @return モンスターが(敵対も含めて)召還されたならばTRUEを返す。
*/
-bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode)
+bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, summon_type type, BIT_FLAGS mode)
{
/* Default level */
PLAYER_LEVEL plev = caster_ptr->lev;
bool cast_summon_undead(player_type *creature_ptr, int power)
{
bool pet = one_in_(3);
- int type = (creature_ptr->lev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
+ summon_type type = (creature_ptr->lev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
BIT_FLAGS mode = 0L;
if (!pet || ((creature_ptr->lev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
concptr s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+ o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_NONE);
if (!o_ptr) return FALSE;
PLAYER_LEVEL plev = caster_ptr->lev;
default:
if (!can_pet)
mode |= PM_ALLOW_UNIQUE;
- count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
+ count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, pet ? summon_lev : (((summon_lev * 3) / 2) + 5), SUMMON_NONE, mode);
}
}
#include "system/angband.h"
-bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode);
+enum summon_type : int;
+
+bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, summon_type type, BIT_FLAGS mode);
bool cast_summon_demon(player_type *creature_ptr, int power);
bool cast_summon_undead(player_type *creature_ptr, int power);
bool cast_summon_hound(player_type *creature_ptr, int power);
#define DETECT_RAD_ALL 255
#define MAX_SPELLS 108
-typedef enum spell_type { SPELL_NAME = 0, SPELL_DESC = 1, SPELL_INFO = 2, SPELL_CAST = 3, SPELL_FAIL = 4, SPELL_STOP = 5, SPELL_CONT = 6 } spell_type;
+enum spell_type { SPELL_NAME = 0, SPELL_DESC = 1, SPELL_INFO = 2, SPELL_CAST = 3, SPELL_FAIL = 4, SPELL_STOP = 5, SPELL_CONT = 6 };
-typedef enum spell_operation {
- SPOP_DISPLAY_MES = 0x0001, // !< スペル処理オプション … メッセージを表示する
- SPOP_NO_UPDATE = 0x0002, // !< スペル処理オプション … ステータス更新を解決後行う
- SPOP_DEBUG = 0x8000 // !< スペル処理オプション … デバッグ処理あり
-} spell_operation;
+enum spell_operation : uint16_t {
+ SPOP_NONE = 0x0000U,
+ SPOP_DISPLAY_MES = 0x0001U, // !< スペル処理オプション … メッセージを表示する
+ SPOP_NO_UPDATE = 0x0002U, // !< スペル処理オプション … ステータス更新を解決後行う
+ SPOP_DEBUG = 0x8000U // !< スペル処理オプション … デバッグ処理あり
+};
-typedef enum teleport_flags {
+enum teleport_flags {
TELEPORT_SPONTANEOUS = 0x0000,
TELEPORT_NONMAGICAL = 0x0001,
TELEPORT_PASSIVE = 0x0002,
TELEPORT_DEC_VALOUR = 0x0004
-} teleport_flags;
+};
-typedef enum autogenesis_magical_effect {
+enum autogenesis_magical_effect {
PROJECT_WHO_UNCTRL_POWER = -1, /*!< 魔法効果の自然発生要因: 名状し難い力の解放 */
PROJECT_WHO_GLASS_SHARDS = -2 /*!< 魔法効果の自然発生要因: 破壊されたガラス地形の破片 */
-} autogenesis_magical_effect;
+};
#pragma once
/* summon_specificで取り扱われる、召喚の種別定義 / Legal restrictions for "summon_specific()" */
-typedef enum summon_type {
+enum summon_type : int {
SUMMON_NONE = 0,
SUMMON_ANT = 11, /*!< 召喚タイプ: アリ */
SUMMON_SPIDER = 12, /*!< 召喚タイプ: 蜘蛛 */
SUMMON_APOCRYPHA_FOLLOWERS = 68, /*!< 召喚タイプ: 信者 */
SUMMON_APOCRYPHA_DRAGONS = 69, /*!< 召喚タイプ: 強力な古代ドラゴン */
SUMMON_VESPOID = 70, /*!< 召喚タイプ: ランゴスタ */
-} summon_type;
+};
else
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
check_experience(creature_ptr);
creature_ptr->redraw |= (PR_BASIC);
creature_ptr->update |= (PU_BONUS);
power -= 10;
get_max_stats(creature_ptr);
- roll_hitdice(creature_ptr, 0L);
+ roll_hitdice(creature_ptr, SPOP_NONE);
}
while ((power > randint0(15)) && one_in_(3)) {
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(owner_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, 0);
+ o_ptr = choose_object(owner_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, TV_NONE);
if (!o_ptr)
return;
#pragma once
/* The "sval" codes for TV_AMULET */
-typedef enum sv_amulet_type {
+enum sv_amulet_type {
SV_AMULET_DOOM = 0,
SV_AMULET_TELEPORT = 1,
SV_AMULET_ADORNMENT = 2,
SV_AMULET_WISDOM = 22,
SV_AMULET_MAGIC_MASTERY = 23,
SV_AMULET_NIGHT = 24,
-} sv_amulet_type;
+};
#pragma once
/* The "sval" codes for TV_SOFT_ARMOR */
-typedef enum sv_soft_armor_type {
+enum sv_soft_armor_type {
SV_T_SHIRT = 0,
SV_FILTHY_RAG = 1,
SV_ROBE = 2,
SV_ABUNAI_MIZUGI = 50,
SV_YOIYAMI_ROBE = 60,
SV_NAMAKE_ARMOR = 63,
-} sv_soft_armor_type;
+};
/* The "sval" codes for TV_HARD_ARMOR */
-typedef enum sv_hard_armor_type {
+enum sv_hard_armor_type {
SV_RUSTY_CHAIN_MAIL = 1, /* 14- */
SV_RING_MAIL = 2, /* 12 */
SV_METAL_SCALE_MAIL = 3, /* 13 */
SV_MITHRIL_CHAIN_MAIL = 20, /* 28+ */
SV_MITHRIL_PLATE_MAIL = 25, /* 35+ */
SV_ADAMANTITE_PLATE_MAIL = 30, /* 40+ */
-} sv_hard_armor_type;
+};
/* The "sval" codes for TV_DRAG_ARMOR */
-typedef enum sv_dragon_armor_type {
+enum sv_dragon_armor_type {
SV_DRAGON_BLACK = 1,
SV_DRAGON_BLUE = 2,
SV_DRAGON_WHITE = 3,
SV_DRAGON_CHAOS = 18,
SV_DRAGON_BALANCE = 20,
SV_DRAGON_POWER = 30,
-} sv_dragon_armor_type;
+};
\ No newline at end of file
#pragma once
/* The "sval" codes for TV_BOW (note information in "sval") */
-typedef enum sv_bow_type {
+enum sv_bow_type {
SV_SLING = 2, /* (x2) */
SV_SHORT_BOW = 12, /* (x2) */
SV_LONG_BOW = 13, /* (x3) */
SV_CRIMSON = 50, /* (x0) */
SV_HARP = 51, /* (x0) */
SV_NAMAKE_BOW = 63, /* (x3) */
-} sv_bow_type;
+};
#pragma once
/* The "sval" codes for TV_DIGGING */
-typedef enum sv_digging_type {
+enum sv_digging_type {
SV_SHOVEL = 1,
SV_GNOMISH_SHOVEL = 2,
SV_DWARVEN_SHOVEL = 3,
SV_ORCISH_PICK = 5,
SV_DWARVEN_PICK = 6,
SV_MATTOCK = 7,
-} sv_digging_type;
+};
#pragma once
/* The "sval" codes for TV_FOOD */
-typedef enum sv_food_type {
+enum sv_food_type {
SV_FOOD_POISON = 0,
SV_FOOD_BLINDNESS = 1,
SV_FOOD_PARANOIA = 2,
SV_FOOD_WAYBREAD = 37,
SV_FOOD_PINT_OF_ALE = 38,
SV_FOOD_PINT_OF_WINE = 39,
-} sv_food_type;
+};
#pragma once
/* The sval codes for TV_LITE */
-typedef enum sv_lite_type {
+enum sv_lite_type {
SV_LITE_TORCH = 0,
SV_LITE_LANTERN = 1,
SV_LITE_FEANOR = 2,
SV_LITE_LORE = 7,
SV_LITE_PALANTIR = 8,
SV_LITE_FLY_STONE = 9,
-} sv_lite_type;
+};
#pragma once
/* The "sval" codes for TV_POTION */
-typedef enum sv_potion_type {
+enum sv_potion_type {
SV_POTION_WATER = 0,
SV_POTION_APPLE_JUICE = 1,
SV_POTION_SLIME_MOLD = 2,
SV_POTION_NEO_TSUYOSHI = 64,
SV_POTION_TSUYOSHI = 65,
SV_POTION_POLYMORPH = 66,
-} sv_potion_type;
+};
#pragma once
/* The "sval" codes for TV_SHIELD */
-typedef enum sv_shield_type {
+enum sv_shield_type {
SV_SMALL_LEATHER_SHIELD = 2,
SV_SMALL_METAL_SHIELD = 3,
SV_LARGE_LEATHER_SHIELD = 4,
SV_KNIGHT_SHIELD = 7,
SV_MIRROR_SHIELD = 10,
SV_YATA_MIRROR = 50,
-} sv_shield_type;
+};
/* The "sval" codes for TV_HELM */
-typedef enum sv_helm_type {
+enum sv_helm_type {
SV_HARD_LEATHER_CAP = 2,
SV_METAL_CAP = 3,
SV_JINGASA = 4, /* 4 */
SV_STEEL_HELM = 6,
SV_DRAGON_HELM = 7,
SV_KABUTO = 8, /* 7 */
-} sv_helm_type;
+};
/* The "sval" codes for TV_CROWN */
-typedef enum sv_crown_type {
+enum sv_crown_type {
SV_IRON_CROWN = 10,
SV_GOLDEN_CROWN = 11,
SV_JEWELED_CROWN = 12,
SV_CHAOS = 50,
-} sv_crown_type;
+};
/* The "sval" codes for TV_BOOTS */
-typedef enum sv_boots_type {
+enum sv_boots_type {
SV_PAIR_OF_SOFT_LEATHER_BOOTS = 2,
SV_PAIR_OF_HARD_LEATHER_BOOTS = 3,
SV_PAIR_OF_DRAGON_GREAVE = 4,
SV_PAIR_OF_METAL_SHOD_BOOTS = 6,
-} sv_boots_type;
+};
/* The "sval" codes for TV_CLOAK */
-typedef enum sv_cloak_type {
+enum sv_cloak_type {
SV_CLOAK = 1,
SV_ELVEN_CLOAK = 2,
SV_FUR_CLOAK = 3,
SV_ETHEREAL_CLOAK = 5,
SV_SHADOW_CLOAK = 6,
-} sv_cloak_type;
+};
/* The "sval" codes for TV_GLOVES */
-typedef enum sv_gloves_type {
+enum sv_gloves_type {
SV_SET_OF_LEATHER_GLOVES = 1,
SV_SET_OF_GAUNTLETS = 2,
SV_SET_OF_DRAGON_GLOVES = 3,
SV_SET_OF_CESTI = 5,
-} sv_gloves_type;
+};
#pragma once
/* The sval codes for TV_RING */
-typedef enum sv_ring_type {
+enum sv_ring_type {
SV_RING_WOE = 0,
SV_RING_AGGRAVATION = 1,
SV_RING_WEAKNESS = 2,
SV_RING_DEC_MANA = 53,
SV_RING_WARNING = 54,
SV_RING_MUSCLE = 55,
-} sv_ring_type;
+};
#pragma once
/* The "sval" codes for TV_ROD */
-typedef enum sv_rod_type {
+enum sv_rod_type {
SV_ROD_DETECT_TRAP = 0,
SV_ROD_DETECT_DOOR = 1,
SV_ROD_IDENTIFY = 2,
SV_ROD_HAVOC = 28,
SV_ROD_STONE_TO_MUD = 29,
SV_ROD_AGGRAVATE = 30,
-} sv_rod_type;
+};
#pragma once
/* The "sval" codes for TV_SCROLL */
-typedef enum sv_scroll_type {
+enum sv_scroll_type {
SV_SCROLL_DARKNESS = 0,
SV_SCROLL_AGGRAVATE_MONSTER = 1,
SV_SCROLL_CURSE_ARMOR = 2,
SV_SCROLL_SUMMON_KIN = 54,
SV_SCROLL_AMUSEMENT = 55,
SV_SCROLL_STAR_AMUSEMENT = 56,
-} sv_scroll_type;
+};
#pragma once
/* The "sval" codes for TV_STAFF */
-typedef enum sv_staff_type {
+enum sv_staff_type {
SV_STAFF_DARKNESS = 0,
SV_STAFF_SLOWNESS = 1,
SV_STAFF_HASTE_MONSTERS = 2,
SV_STAFF_ANIMATE_DEAD = 30,
SV_STAFF_MSTORM = 31,
SV_STAFF_NOTHING = 32,
-} sv_staff_type;
+};
#pragma once
/* The "sval" codes for TV_WAND */
-typedef enum sv_wand_type {
+enum sv_wand_type {
SV_WAND_HEAL_MONSTER = 0,
SV_WAND_HASTE_MONSTER = 1,
SV_WAND_CLONE_MONSTER = 2,
SV_WAND_ROCKETS = 29,
SV_WAND_STRIKING = 30,
SV_WAND_GENOCIDE = 31,
-} sv_wand_type;
+};
#pragma once
/* The "sval" values for TV_HAFTED */
-typedef enum sv_hafted_type {
+enum sv_hafted_type {
SV_CLUB = 1, /* 1d4 */
SV_WHIP = 2, /* 1d6 */
SV_QUARTERSTAFF = 3, /* 1d9 */
SV_WIZSTAFF = 21, /* 1d2 */
SV_GROND = 50, /* 3d9 */
SV_NAMAKE_HAMMER = 63, /* 1d77 */
-} sv_hafted_type;
+};
/* The "sval" values for TV_POLEARM */
-typedef enum sv_polearm_type {
+enum sv_polearm_type {
SV_HATCHET = 1, /* 1d5 */
SV_SPEAR = 2, /* 1d6 */
SV_SICKLE = 3, /* 2d3 */
SV_SCYTHE_OF_SLICING = 30, /* 8d4 */
SV_TSURIZAO = 40, /* 1d1 */
SV_DEATH_SCYTHE = 50, /* 10d10 */
-} sv_polearm_type;
+};
/* The "sval" codes for TV_SWORD */
-typedef enum sv_sword_type {
+enum sv_sword_type {
SV_BROKEN_DAGGER = 1, /* 1d1 */
SV_BROKEN_SWORD = 2, /* 1d2 */
SV_DAGGER = 4, /* 1d4 */
SV_DIAMOND_EDGE = 31, /* 7d5 */
SV_POISON_NEEDLE = 32, /* 1d1 */
SV_HAYABUSA = 33, /* 1d6 */
-} sv_sword_type;
+};
if (IS_ALPHA_VERSION) {
sprintf(buf, _("変愚蛮怒 %d.%d.%dAlpha%d", "Hengband %d.%d.%dAlpha%d"), H_VER_MAJOR, H_VER_MINOR, H_VER_PATCH, H_VER_EXTRA);
} else {
- char *mode = IS_STABLE_VERSION ? _("安定版", "Stable") : _("開発版", "Developing");
+ concptr mode = IS_STABLE_VERSION ? _("安定版", "Stable") : _("開発版", "Developing");
sprintf(buf, _("変愚蛮怒 %d.%d.%d.%d(%s)", "Hengband %d.%d.%d.%d(%s)"), H_VER_MAJOR, H_VER_MINOR, H_VER_PATCH, H_VER_EXTRA, mode);
}
-}
\ No newline at end of file
+}
#pragma once
-typedef enum game_option_types {
+enum game_option_types {
OPT_PAGE_INPUT,
OPT_PAGE_MAPSCREEN,
OPT_PAGE_TEXT,
OPT_PAGE_AUTODESTROY,
OPT_PAGE_PLAYRECORD,
OPT_PAGE_HIDE,
-} game_option_types;
+};
/* A signed byte of memory */
/* typedef signed char syte; */
typedef unsigned char byte; /*!< byte型をunsighned charとして定義 / Note that unsigned values can cause math problems / An unsigned byte of memory */
+#ifndef __cplusplus
#if __STDC_VERSION__ >= 199901L
#include <stdbool.h>
#else
typedef char bool; /*!< bool型をcharとして定義 / Note that a bool is smaller than a full "int" / Simple True/False type */
#endif
+#endif
typedef unsigned int uint; /* uint型をintとして定義 / An unsigned, "standard" integer (often pre-defined) */
/* The largest possible unsigned integer */
/* A key extractor takes a thing and returns (a pointer to) some key */
typedef vptr (*func_key)(vptr);
-typedef enum process_result {
+enum process_result {
PROCESS_FALSE = 0,
PROCESS_TRUE = 1,
PROCESS_CONTINUE = 2,
-} process_result;
+};
#endif
#define MAX_NAZGUL_NUM 5
#define SCREEN_BUF_MAX_SIZE (1024 * 1024) /*!< Max size of screen dump buffer */
-typedef enum init_flags_type {
+enum init_flags_type {
INIT_NAME_ONLY = 0x01,
INIT_SHOW_TEXT = 0x02,
INIT_ASSIGN = 0x04,
INIT_CREATE_DUNGEON = 0x08,
INIT_ONLY_FEATURES = 0x10,
INIT_ONLY_BUILDINGS = 0x20,
-} init_flags_type;
+};
extern init_flags_type init_flags;
extern concptr ANGBAND_SYS;
if (!easy_floor)
return;
- eg_ptr->floor_num = scan_floor_items(subject_ptr, eg_ptr->floor_list, eg_ptr->y, eg_ptr->x, SCAN_FLOOR_ONLY_MARKED, 0);
+ eg_ptr->floor_num = scan_floor_items(subject_ptr, eg_ptr->floor_list, eg_ptr->y, eg_ptr->x, SCAN_FLOOR_ONLY_MARKED, TV_NONE);
if (eg_ptr->floor_num > 0)
eg_ptr->x_info = _("x物 ", "x,");
}
while (TRUE) {
screen_save();
show_gold_on_floor = TRUE;
- (void)show_floor_items(subject_ptr, 0, eg_ptr->y, eg_ptr->x, min_width, 0);
+ (void)show_floor_items(subject_ptr, 0, eg_ptr->y, eg_ptr->x, min_width, TV_NONE);
show_gold_on_floor = FALSE;
#ifdef JP
sprintf(eg_ptr->out_val, "%s %d個のアイテム%s%s [Enterで次へ, %s]", eg_ptr->s1, (int)eg_ptr->floor_num, eg_ptr->s2, eg_ptr->s3, eg_ptr->info);
extern bool show_gold_on_floor;
-typedef enum target_type target_type;
+enum target_type : uint8_t;
char examine_grid(player_type *subject_ptr, const POSITION y, const POSITION x, target_type mode, concptr info);
describe_grid_wizard(creature_ptr, ts_ptr);
/* Describe and Prompt (enable "TARGET_LOOK") */
- while ((ts_ptr->query = examine_grid(creature_ptr, ts_ptr->y, ts_ptr->x, ts_ptr->mode | TARGET_LOOK, ts_ptr->info)) == 0)
+ while ((ts_ptr->query = examine_grid(creature_ptr, ts_ptr->y, ts_ptr->x, static_cast<target_type>(ts_ptr->mode | TARGET_LOOK), ts_ptr->info)) == 0)
;
ts_ptr->distance = 0;
#include "system/angband.h"
-typedef enum target_type target_type;
+enum target_type : uint8_t;
bool target_set(player_type *creature_ptr, target_type mode);
#pragma once
/* target_set用関数の利用用途フラグ / Bit flags for the "target_set" function */
-typedef enum target_type {
+enum target_type : uint8_t {
TARGET_KILL = 0x01, /*!< モンスターへの狙いをつける(視界内モンスターのみクエリ対象) / Target monsters */
TARGET_LOOK = 0x02, /*!< "L"ookコマンド向けの既存情報確認向け(全ての有為な情報をクエリ対象) / Describe grid fully */
TARGET_XTRA = 0x04, /*!< 現在未使用 / Currently unused flag */
TARGET_GRID = 0x08, /*!< 全てのマス対象にする(現在未使用) / Select from all grids */
-} target_type;
+};
static DWORD PASCAL lread(int fh, void *pv, DWORD ul)
{
DWORD ulT = ul;
- BYTE *hp = pv;
+ BYTE *hp = static_cast<BYTE*>(pv);
while (ul > (DWORD)MAXREAD)
{
*/
else
{
- return(GetStockObject(DEFAULT_PALETTE));
+ return static_cast<HPALETTE>(GetStockObject(DEFAULT_PALETTE));
}
}
GlobalUnlock(pInfo->hDIB);
hDC = GetDC(hWnd);
- if (!MakeBitmapAndPalette(hDC, pInfo->hDIB, &((HPALETTE)pInfo->hPalette),
- &((HBITMAP)pInfo->hBitmap)))
+ if (!MakeBitmapAndPalette(hDC, pInfo->hDIB, reinterpret_cast<HPALETTE*>(&pInfo->hPalette),
+ reinterpret_cast<HBITMAP*>(&pInfo->hBitmap)))
{
ReleaseDC(hWnd,hDC);
global_free(pInfo, &fh, FALSE);
* The "(R,G,B)" codes are given in "fourths" of the "maximal" value,
* and should "gamma corrected" on most (non-Macintosh) machines.
*/
-typedef enum term_color_type {
+enum term_color_type {
TERM_DARK = 0, /*!< 'd' - 黒 0,0,0 */
TERM_WHITE = 1, /*!< 'w' - 白 4,4,4 */
TERM_SLATE = 2, /*!< 's' - 灰 2,2,2 */
TERM_L_GREEN = 13, /*!< 'G' - 明るい緑 0,4,0 */
TERM_L_BLUE = 14, /*!< 'B' - 明るい青 0,4,4 */
TERM_L_UMBER = 15, /*!< 'U' - 明るい琥珀 3,2,1 */
-} term_color_type;
+};
errr term_set_cursor(int v)
{
/* Already done */
- if (Term->scr->cv == v)
+ if (Term->scr->cv == (bool)v)
return 1;
/* Change */
*/
static void decide_vulnerability_color(u16b mode, TERM_LEN row, TERM_LEN *col, int flag1, BIT_FLAGS *flags, byte *header_color, bool vuln, bool riding)
{
- byte color = (riding ? TERM_L_GREEN : TERM_WHITE);
+ term_color_type color = (riding ? TERM_L_GREEN : TERM_WHITE);
color = (vuln ? TERM_RED : color);
if (has_flag(flags, flag1)) {
c_put_str(color, (mode & DP_IMM) ? "*" : "+", row, *col);
static void decide_colors(player_type *creature_ptr, u16b mode, TERM_LEN row, TERM_LEN *col, int flag1, byte *header_color, bool vuln, bool riding)
{
int max_i = (mode & DP_WP) ? INVEN_SUB_HAND + 1 : INVEN_TOTAL;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < max_i; i++) {
+ for (int i = INVEN_MAIN_HAND; i < max_i; i++) {
BIT_FLAGS flags[TR_FLAG_SIZE];
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[i];
object_flags_known(creature_ptr, o_ptr, flags);
if (!(mode & DP_IMM)) {
- byte color = (riding ? TERM_L_GREEN : TERM_SLATE);
+ term_color_type color = (riding ? TERM_L_GREEN : TERM_SLATE);
color = (vuln ? TERM_RED : color);
c_put_str(color, ".", row, *col);
static void display_one_characteristic(
TERM_LEN row, TERM_LEN col, concptr header, byte header_color, int header_col, int flag1, bool vuln, bool riding, all_player_flags *f)
{
- byte color = (riding ? TERM_L_GREEN : TERM_SLATE);
+ term_color_type color = (riding ? TERM_L_GREEN : TERM_SLATE);
color = (vuln ? TERM_RED : color);
c_put_str(color, ".", row, col);
*/
void display_inventory(player_type *owner_ptr, tval_type tval)
{
- register int i, n, z = 0;
+ int i, n, z = 0;
object_type *o_ptr;
TERM_COLOR attr = TERM_WHITE;
char tmp_val[80];
*/
static void display_equipments_compensation(player_type *creature_ptr, BIT_FLAGS *flags, int row, int *col)
{
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[i];
object_flags_known(creature_ptr, o_ptr, flags);
void display_player_equippy(player_type *creature_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
{
int max_i = (mode & DP_WP) ? INVEN_SUB_HAND + 1 : INVEN_TOTAL;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < max_i; i++)
+ for (int i = INVEN_MAIN_HAND; i < max_i; i++)
{
object_type *o_ptr;
o_ptr = &creature_ptr->inventory_list[i];
void display_max_base_status(player_type *creature_ptr, self_info_type *self_ptr)
{
self_ptr->info[self_ptr->line++] = _("能力の最大値", "Limits of maximum stats");
- for (base_status_type v_nr = 0; v_nr < A_MAX; v_nr++) {
+ for (int v_nr = 0; v_nr < A_MAX; v_nr++) {
char stat_desc[80];
sprintf(stat_desc, "%s 18/%d", stat_names[v_nr], creature_ptr->stat_max_max[v_nr] - 18);
strcpy(self_ptr->s_string[v_nr], stat_desc);
} stat_bar;
/* 画面下部に表示する状態表示定義ID / Data structure for status bar */
-typedef enum bar_definition_type {
+enum bar_definition_type {
BAR_TSUYOSHI = 0, /*!< 下部ステータス表示: オクレ兄さん状態 */
BAR_HALLUCINATION = 1, /*!< 下部ステータス表示: 幻覚 */
BAR_BLINDNESS = 2, /*!< 下部ステータス表示: 盲目 */
BAR_CURE = 65, /*!< 下部ステータス表示: 回復 */
BAR_ESP_EVIL = 66, /*!< 下部ステータス表示: 邪悪感知 */
BAR_NIGHTSIGHT = 67, /*!< 下部ステータス表示: 暗視 */
-} bar_definition_type;
+};
#define MAX_STAT_BARS 69
TERM_COLOR attr = TERM_WHITE;
char tmp_val[80];
GAME_TEXT o_name[MAX_NLEN];
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
object_type *o_ptr;
o_ptr = &owner_ptr->inventory_list[i];
tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
break;
case 'f':
- identify_fully(creature_ptr, FALSE, 0);
+ identify_fully(creature_ptr, FALSE, TV_NONE);
break;
case 'F':
wiz_create_feature(creature_ptr);
acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, FALSE, FALSE, TRUE);
break;
case 'h':
- roll_hitdice(creature_ptr, SPOP_DISPLAY_MES | SPOP_DEBUG);
+ roll_hitdice(creature_ptr, static_cast<spell_operation>(SPOP_DISPLAY_MES | SPOP_DEBUG));
break;
case 'H':
wiz_summon_horde(creature_ptr);
break;
case 'i':
- (void)ident_spell(creature_ptr, FALSE, 0);
+ (void)ident_spell(creature_ptr, FALSE, TV_NONE);
break;
case 'j':
wiz_jump_to_dungeon(creature_ptr);
#include "system/angband.h"
#include "wizard/spoiler-util.h"
+enum race_flags8 : uint32_t;
spoiler_output_status spoil_mon_desc_all(concptr fname);
-spoiler_output_status spoil_mon_desc(concptr fname, bool show_all, BIT_FLAGS RF8_flags);
+spoiler_output_status spoil_mon_desc(concptr fname, bool show_all, race_flags8 RF8_flags);
spoiler_output_status spoil_mon_info(concptr fname);
{ TV_SKELETON, _("その他", "Misc") }, { TV_BOTTLE, NULL }, { TV_JUNK, NULL }, { TV_SPIKE, NULL }, { TV_FLASK, NULL }, { TV_PARCHMENT, NULL },
- { 0, "" } };
+ { TV_NONE, "" } };
/* The artifacts categorized by type */
grouper group_artifact[MAX_GROUPER_ARTIFACT] = {
{ TV_LITE, _("光源", "Light Sources") },
{ TV_AMULET, _("アミュレット", "Amulets") },
{ TV_RING, _("指輪", "Rings") },
- { 0, NULL },
+ { TV_NONE, NULL },
};
flag_desc stat_flags_desc[MAX_STAT_FLAGS_DESCRIPTION] = { { TR_STR, _("腕力", "STR") }, { TR_INT, _("知能", "INT") }, { TR_WIS, _("賢さ", "WIS") },
* the flag whose value is "1UL << N", but that requires hard-coding.
*/
typedef struct flag_desc {
- const tr_type flag;
- concptr const desc;
+ tr_type flag;
+ concptr desc;
} flag_desc;
extern grouper group_item[MAX_GROUPER_ITEM];
void spoiler_underline(concptr str);
void spoil_out(concptr str);
-typedef enum spoiler_output_status {
+enum spoiler_output_status {
SPOILER_OUTPUT_CANCEL,
SPOILER_OUTPUT_SUCCESS,
SPOILER_OUTPUT_FAIL_FOPEN,
SPOILER_OUTPUT_FAIL_FCLOSE
-} spoiler_output_status;
+};
concptr s = "You have nothing to play with.";
OBJECT_IDX item;
object_type *o_ptr;
- o_ptr = choose_object(creature_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, 0);
+ o_ptr = choose_object(creature_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, TV_NONE);
if (!o_ptr)
return;
- screen_save(creature_ptr);
+ screen_save();
object_type forge;
object_type *q_ptr;
}
}
- screen_load(creature_ptr);
+ screen_load();
if (changed) {
msg_print("Changes accepted.");
} else {
msg_print("Changes ignored.");
}
-}
\ No newline at end of file
+}
if ((num < 0) || (num >= max_num))
return 0;
- tval_type tval = tvals[num].tval;
+ tval_type tval = static_cast<tval_type>(tvals[num].tval);
concptr tval_desc = tvals[num].desc;
term_clear();
num = 0;
*/
void wiz_create_item(player_type *caster_ptr)
{
- screen_save(caster_ptr);
+ screen_save();
OBJECT_IDX k_idx = wiz_create_itemtype();
- screen_load(caster_ptr);
+ screen_load();
if (!k_idx)
return;
if (tmp_int < 0 || tmp_int >= MAX_CLASS)
return;
- creature_ptr->pclass = (byte)tmp_int;
+ creature_ptr->pclass = static_cast<player_class_type>(tmp_int);
creature_ptr->window_flags |= PW_PLAYER;
creature_ptr->update |= PU_BONUS | PU_HP | PU_MANA | PU_SPELLS;
handle_stuff(creature_ptr);
{
BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
for (int j = 1; j < A_MAX; j++) {
- set_rf_masks(&f4, &f5, &f6, j);
+ set_rf_masks(&f4, &f5, &f6, static_cast<blue_magic_type>(j));
int i;
for (i = 0; i < 32; i++) {
void wiz_summon_random_enemy(player_type *caster_ptr, int num)
{
for (int i = 0; i < num; i++)
- (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, 0, PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+ (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_NONE, PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
}
/*!
typedef struct debug_spell_command {
int type;
- char *command_name;
+ concptr command_name;
spell_functions command_function;
} debug_spell_command;