summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2019-02-15 19:20:25 +0100
committerBardur Arantsson <bardur@scientician.net>2019-02-15 19:20:25 +0100
commitcf174d71d2b56fb40248d96707090a484b4957fc (patch)
treeca2666f5f0aabca22b45f2f87baf19be296ac0af
parent79d1633d51015b2a9224dece9da083ff1ab8b7c2 (diff)
Search/replace bool_ with bool
We also search/replace TRUE/FALSE with their bool equivalents.
-rw-r--r--src/birth.cc76
-rw-r--r--src/bldg.cc42
-rw-r--r--src/cave.cc30
-rw-r--r--src/cmd1.cc374
-rw-r--r--src/cmd1.hpp2
-rw-r--r--src/cmd2.cc300
-rw-r--r--src/cmd3.cc70
-rw-r--r--src/cmd4.cc70
-rw-r--r--src/cmd4.hpp2
-rw-r--r--src/cmd5.cc64
-rw-r--r--src/cmd6.cc344
-rw-r--r--src/cmd6.hpp2
-rw-r--r--src/cmd7.cc94
-rw-r--r--src/corrupt.cc38
-rw-r--r--src/dungeon.cc130
-rw-r--r--src/dungeon_info_type.hpp2
-rw-r--r--src/fate.hpp4
-rw-r--r--src/files.cc104
-rw-r--r--src/files.hpp2
-rw-r--r--src/generate.cc414
-rw-r--r--src/generate.hpp6
-rw-r--r--src/gods.cc20
-rw-r--r--src/gods.hpp6
-rw-r--r--src/h-basic.hpp18
-rw-r--r--src/hiscore.cc4
-rw-r--r--src/hook_stair_out.hpp2
-rw-r--r--src/hooks.cc8
-rw-r--r--src/init1.cc76
-rw-r--r--src/init1.hpp2
-rw-r--r--src/init2.cc10
-rw-r--r--src/joke.cc8
-rw-r--r--src/loadsave.cc86
-rw-r--r--src/loadsave.hpp2
-rw-r--r--src/lua_bind.cc6
-rw-r--r--src/main-gcu.cc10
-rw-r--r--src/main-gtk2.cc92
-rw-r--r--src/main-sdl.cc42
-rw-r--r--src/main-win.cc166
-rw-r--r--src/main-x11.cc12
-rw-r--r--src/main.cc2
-rw-r--r--src/melee1.cc162
-rw-r--r--src/melee1.hpp4
-rw-r--r--src/melee2.cc368
-rw-r--r--src/modules.cc38
-rw-r--r--src/monster1.cc40
-rw-r--r--src/monster2.cc206
-rw-r--r--src/monster2.hpp26
-rw-r--r--src/monster3.cc32
-rw-r--r--src/monster_ego.hpp2
-rw-r--r--src/monster_power.hpp2
-rw-r--r--src/monster_race.hpp2
-rw-r--r--src/monster_type.hpp2
-rw-r--r--src/object1.cc300
-rw-r--r--src/object1.hpp14
-rw-r--r--src/object2.cc226
-rw-r--r--src/object2.hpp22
-rw-r--r--src/object_kind.hpp8
-rw-r--r--src/player_race_mod.hpp2
-rw-r--r--src/player_type.hpp8
-rw-r--r--src/powers.cc14
-rw-r--r--src/q_betwen.cc16
-rw-r--r--src/q_dragons.cc12
-rw-r--r--src/q_eol.cc18
-rw-r--r--src/q_evil.cc8
-rw-r--r--src/q_fireprof.cc36
-rw-r--r--src/q_god.cc26
-rw-r--r--src/q_haunted.cc10
-rw-r--r--src/q_hobbit.cc18
-rw-r--r--src/q_invas.cc26
-rw-r--r--src/q_library.cc20
-rw-r--r--src/q_main.cc6
-rw-r--r--src/q_narsil.cc6
-rw-r--r--src/q_nazgul.cc12
-rw-r--r--src/q_nirna.cc8
-rw-r--r--src/q_one.cc20
-rw-r--r--src/q_poison.cc16
-rw-r--r--src/q_rand.cc44
-rw-r--r--src/q_rand.hpp2
-rw-r--r--src/q_shroom.cc36
-rw-r--r--src/q_spider.cc8
-rw-r--r--src/q_thief.cc20
-rw-r--r--src/q_thrain.cc12
-rw-r--r--src/q_troll.cc26
-rw-r--r--src/q_ultrag.cc16
-rw-r--r--src/q_wight.cc12
-rw-r--r--src/q_wolves.cc6
-rw-r--r--src/quest_type.hpp2
-rw-r--r--src/randart.cc22
-rw-r--r--src/set_component.hpp2
-rw-r--r--src/skills.cc106
-rw-r--r--src/skills.hpp6
-rw-r--r--src/spell_type.cc10
-rw-r--r--src/spells1.cc768
-rw-r--r--src/spells1.hpp14
-rw-r--r--src/spells2.cc316
-rw-r--r--src/spells2.hpp52
-rw-r--r--src/spells3.cc52
-rw-r--r--src/spells4.cc8
-rw-r--r--src/spells4.hpp2
-rw-r--r--src/spells5.cc2
-rw-r--r--src/spells6.cc6
-rw-r--r--src/squelch/object_status.cc2
-rw-r--r--src/squelch/rule.cc2
-rw-r--r--src/store.cc152
-rw-r--r--src/tables.cc244
-rw-r--r--src/town_type.hpp4
-rw-r--r--src/util.cc148
-rw-r--r--src/util.hpp12
-rw-r--r--src/variable.cc50
-rw-r--r--src/variable.hpp48
-rw-r--r--src/wild.cc52
-rw-r--r--src/wilderness_map.hpp2
-rw-r--r--src/wizard2.cc112
-rw-r--r--src/wizard2.hpp2
-rw-r--r--src/xtra1.cc52
-rw-r--r--src/xtra2.cc438
-rw-r--r--src/xtra2.hpp116
-rw-r--r--src/z-form.cc16
-rw-r--r--src/z-term.cc4
119 files changed, 3733 insertions, 3751 deletions
diff --git a/src/birth.cc b/src/birth.cc
index 5ff95dfd..e303e6ab 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -333,7 +333,7 @@ static void get_stats()
/* Roll and verify some stats */
- while (TRUE)
+ while (true)
{
/* Roll some dice */
for (j = i = 0; i < 18; i++)
@@ -487,7 +487,7 @@ static errr init_randart()
ra.name_full = get_line("rart_f.txt", ANGBAND_DIR_FILE, buf, i);
ra.attr = randint(15);
ra.activation = rand_int(MAX_T_ACT);
- ra.generated = FALSE;
+ ra.generated = false;
ra.cost = cost;
// Push
@@ -636,7 +636,7 @@ static void player_wipe()
for (auto &k_entry: k_info)
{
auto k_ptr = k_entry.second;
- k_ptr->aware = FALSE;
+ k_ptr->aware = false;
k_ptr->artifact = 0;
}
@@ -659,7 +659,7 @@ static void player_wipe()
r_ptr->r_pkills = 0;
/* Clear saved flag */
- r_ptr->on_saved = FALSE;
+ r_ptr->on_saved = false;
}
@@ -671,7 +671,7 @@ static void player_wipe()
/* Assume no winning game */
total_winner = 0;
- has_won = FALSE;
+ has_won = false;
/* Assume no cheating */
noscore = 0;
@@ -682,15 +682,15 @@ static void player_wipe()
{
fates[i].fate = 0;
}
- p_ptr->no_mortal = FALSE;
+ p_ptr->no_mortal = false;
/* Player don't have the black breath from the beginning !*/
p_ptr->black_breath = false;
/* Default pet command settings */
p_ptr->pet_follow_distance = 6;
- p_ptr->pet_open_doors = FALSE;
- p_ptr->pet_pickup_items = FALSE;
+ p_ptr->pet_open_doors = false;
+ p_ptr->pet_pickup_items = false;
/* Body changing initialisation */
p_ptr->body_monster = 0;
@@ -717,7 +717,7 @@ static void player_wipe()
inscription_known = false;
}
- /* Reset wild_mode to FALSE */
+ /* Reset wild_mode to false */
p_ptr->wild_mode = false;
p_ptr->old_wild_mode = false;
@@ -759,7 +759,7 @@ static void outfit_obj(object_proto const *proto)
/* These objects are "storebought" */
q_ptr->number = damroll(proto->dd, proto->ds);
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
@@ -781,7 +781,7 @@ static void player_outfit_object(int qty, int tval, int sval)
object_type *q_ptr = &forge;
object_prep(q_ptr, lookup_kind(tval, sval));
q_ptr->number = qty;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
@@ -796,7 +796,7 @@ static void player_outfit_spellbook(const char *spell_name)
object_type *q_ptr = &forge;
object_prep(q_ptr, lookup_kind(TV_BOOK, 255));
q_ptr->pval = *spell_idx;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
else
{
@@ -935,7 +935,7 @@ static void player_outfit()
object_prep(q_ptr, lookup_kind(TV_CLOAK, SV_MIMIC_CLOAK));
q_ptr->pval2 = resolve_mimic_name("Mouse");
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
if (game_module_idx == MODULE_THEME)
@@ -967,7 +967,7 @@ static void player_outfit()
object_prep(q_ptr, lookup_kind(TV_LITE, SV_LITE_TORCH));
q_ptr->number = (byte)rand_range(3, 7);
q_ptr->timeout = rand_range(3, 7) * 500;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
/* Outfit the player with starting items */
@@ -1350,7 +1350,7 @@ static bool player_birth_aux_ask()
put_str("Use same character as last time (y/n)? ", 20, 2);
c = inkey();
if (c == 'Q') quit(NULL);
- else if (c == 'S') return (FALSE);
+ else if (c == 'S') return false;
else if ((c == 'y') || (c == 'Y'))
{
do_quick_start = true;
@@ -1417,7 +1417,7 @@ static bool player_birth_aux_ask()
else if (c == '=')
{
screen_save();
- do_cmd_options_aux(6, "Startup Options", FALSE);
+ do_cmd_options_aux(6, "Startup Options", false);
screen_load();
}
else if (c == '2')
@@ -1560,7 +1560,7 @@ static bool player_birth_aux_ask()
else if (c == '=')
{
screen_save();
- do_cmd_options_aux(6, "Startup Options", FALSE);
+ do_cmd_options_aux(6, "Startup Options", false);
screen_load();
}
else if (c == '2')
@@ -1679,7 +1679,7 @@ static bool player_birth_aux_ask()
else if (c == '=')
{
screen_save();
- do_cmd_options_aux(6, "Startup Options", FALSE);
+ do_cmd_options_aux(6, "Startup Options", false);
screen_load();
}
else if (c == '2')
@@ -1757,7 +1757,7 @@ static bool player_birth_aux_ask()
else if (c == '=')
{
screen_save();
- do_cmd_options_aux(6, "Startup Options", FALSE);
+ do_cmd_options_aux(6, "Startup Options", false);
screen_load();
}
else if (c == '2')
@@ -1876,7 +1876,7 @@ static bool player_birth_aux_ask()
else if (c == '=')
{
screen_save();
- do_cmd_options_aux(6, "Startup Options", FALSE);
+ do_cmd_options_aux(6, "Startup Options", false);
screen_load();
}
else if (c == '2')
@@ -1941,7 +1941,7 @@ static bool player_birth_aux_ask()
if (get_check("Do you want to modify the options"))
{
screen_save();
- do_cmd_options_aux(6, "Startup Options", FALSE);
+ do_cmd_options_aux(6, "Startup Options", false);
screen_load();
}
}
@@ -1996,13 +1996,13 @@ static bool player_birth_aux_ask()
"If you do not want any optional quests, enter 0.");
/* Ask the number of additional quests */
- while (TRUE)
+ while (true)
{
put_str(format("Number of quests? (0-%u) ",
MAX_RANDOM_QUEST - 1), 20, 2);
/* Get a the number of additional quest */
- while (TRUE)
+ while (true)
{
/* Move the cursor */
put_str("", 20, 27);
@@ -2292,7 +2292,7 @@ static bool player_birth_aux_auto()
j = rp_ptr->ps.adj[i] + rmp_ptr->ps.adj[i] + cp_ptr->ps.adj[i];
/* Obtain the "maximal" stat */
- m = adjust_stat(17, j, TRUE);
+ m = adjust_stat(17, j, true);
/* Save the maximum */
@@ -2314,7 +2314,7 @@ static bool player_birth_aux_auto()
for (i = 0; i < 6; i++)
{
/* Get a minimum stat */
- while (TRUE)
+ while (true)
{
char *s;
@@ -2473,7 +2473,7 @@ static bool player_birth_aux_auto()
get_money();
/* Input loop */
- while (TRUE)
+ while (true)
{
/* Calculate the bonuses and hitpoints */
p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_BODY);
@@ -2624,12 +2624,12 @@ static bool player_birth_aux()
/* Point based */
if (options->point_based)
{
- if (!player_birth_aux_point()) return FALSE;
+ if (!player_birth_aux_point()) return false;
}
/* Auto-roll */
else
{
- if (!player_birth_aux_auto()) return FALSE;
+ if (!player_birth_aux_auto()) return false;
}
/*** Finish up ***/
@@ -2712,7 +2712,7 @@ void player_birth()
p_ptr->skill_points = 0;
p_ptr->skill_last_level = 1;
- recalc_skills(FALSE);
+ recalc_skills(false);
/* grab level 1 abilities */
p_ptr->abilities.clear();
@@ -2722,7 +2722,7 @@ void player_birth()
{
byte i = p_ptr->pgod;
p_ptr->pgod = 0;
- follow_god(i, TRUE);
+ follow_god(i, true);
}
/* Select the default melee type */
@@ -2763,7 +2763,7 @@ void player_birth()
d_ptr->t_idx[num] = rtown;
rtown++;
- while (TRUE)
+ while (true)
{
bool ok = true;
@@ -2807,7 +2807,7 @@ void player_birth()
for (std::size_t i = 1; i < max_towns; i++)
{
/* Not destroyed ! yet .. ;) */
- town_info[i].destroyed = FALSE;
+ town_info[i].destroyed = false;
/* Ignore non-existent towns */
if (!(town_info[i].flags & (TOWN_REAL))) continue;
@@ -2831,7 +2831,7 @@ void player_birth()
auto &w = wilderness(x, y);
w.seed = seed_t::system();
w.entrance = 0;
- w.known = FALSE;
+ w.known = false;
}
}
}
@@ -3036,7 +3036,7 @@ static void dump_savefiles(int sel, int max)
/* Asks for new game or load game */
-bool no_begin_screen = FALSE;
+bool no_begin_screen = false;
bool begin_screen()
{
@@ -3062,7 +3062,7 @@ savefile_try_again:
max = m + 2;
if (max > 2) sel = 2;
- while (TRUE)
+ while (true)
{
/* Clear screen */
Term_clear();
@@ -3145,7 +3145,7 @@ savefile_try_again:
set_player_base(tmp);
// If the savefile already exists, we do *NOT* want to
- // create a new game, so we'll need to return FALSE for
+ // create a new game, so we'll need to return false for
// that.
if (boost::filesystem::exists(name_file_save()))
{
@@ -3165,12 +3165,12 @@ savefile_try_again:
prt("", 0, 0);
// Load character
- return FALSE;
+ return false;
}
else
{
// Start new game
- return TRUE;
+ return true;
}
}
if (k == 'b')
diff --git a/src/bldg.cc b/src/bldg.cc
index b93926f4..5f3fd641 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -377,7 +377,7 @@ static void gamble_comm(int cmd)
wager = 1;
}
msg_print(NULL);
- win = FALSE;
+ win = false;
odds = 0;
oldgold = p_ptr->au;
@@ -395,7 +395,7 @@ static void gamble_comm(int cmd)
{
c_put_str(TERM_GREEN, "In Between", 5, 2);
odds = 3;
- win = FALSE;
+ win = false;
roll1 = randint(10);
roll2 = randint(10);
choice = randint(10);
@@ -406,7 +406,7 @@ static void gamble_comm(int cmd)
prt(tmp_str, 11, 14);
if (((choice > roll1) && (choice < roll2)) ||
((choice < roll1) && (choice > roll2)))
- win = TRUE;
+ win = true;
break;
}
@@ -423,9 +423,9 @@ static void gamble_comm(int cmd)
roll2, roll3);
prt(tmp_str, 7, 5);
if ((roll3 == 7) || (roll3 == 11))
- win = TRUE;
+ win = true;
else if ((roll3 == 2) || (roll3 == 3) || (roll3 == 12))
- win = FALSE;
+ win = false;
else
{
do
@@ -440,11 +440,11 @@ static void gamble_comm(int cmd)
roll1, roll2, roll3);
prt(tmp_str, 8, 5);
if (roll3 == choice)
- win = TRUE;
+ win = true;
else if (roll3 == 7)
- win = FALSE;
+ win = false;
}
- while ((win != TRUE) && (win != FALSE));
+ while ((win != true) && (win != false));
}
break;
@@ -453,7 +453,7 @@ static void gamble_comm(int cmd)
case BACT_DICE_SLOTS: /* The Dice Slots */
{
c_put_str(TERM_GREEN, "Dice Slots", 5, 2);
- win = FALSE;
+ win = false;
roll1 = randint(6);
roll2 = randint(6);
choice = randint(6);
@@ -468,7 +468,7 @@ static void gamble_comm(int cmd)
display_fruit(8, 21, choice - 1);
if ((roll1 == roll2) && (roll2 == choice))
{
- win = TRUE;
+ win = true;
if (roll1 == 1)
odds = 4;
else if (roll1 == 2)
@@ -478,7 +478,7 @@ static void gamble_comm(int cmd)
}
else if ((roll1 == 6) && (roll2 == 6))
{
- win = TRUE;
+ win = true;
odds = choice + 1;
}
@@ -868,7 +868,7 @@ static void list_weapon(object_type *o_ptr, int row, int col)
char tmp_str[80];
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, true, 0);
c_put_str(TERM_YELLOW, o_name, row, col);
strnfmt(tmp_str, 80, "To Hit: %d To Damage: %d", o_ptr->to_h, o_ptr->to_d);
put_str(tmp_str, row + 1, col);
@@ -1011,7 +1011,7 @@ static bool fix_item(int istart, int iend, int ispecific, bool iac)
if (o_ptr->tval)
{
- object_desc(tmp_str, o_ptr, FALSE, 1);
+ object_desc(tmp_str, o_ptr, false, 1);
if (o_ptr->name1 && o_ptr->identified)
strnfmt(out_val, 80, "%-40s: beyond our skills!", tmp_str);
@@ -1250,12 +1250,12 @@ bool bldg_process_command(const store_type *s_ptr, store_action_type const *ba_p
/* needs work */
case BACT_RESTORE:
{
- if (do_res_stat(A_STR, TRUE)) paid = true;
- if (do_res_stat(A_INT, TRUE)) paid = true;
- if (do_res_stat(A_WIS, TRUE)) paid = true;
- if (do_res_stat(A_DEX, TRUE)) paid = true;
- if (do_res_stat(A_CON, TRUE)) paid = true;
- if (do_res_stat(A_CHR, TRUE)) paid = true;
+ if (do_res_stat(A_STR, true)) paid = true;
+ if (do_res_stat(A_INT, true)) paid = true;
+ if (do_res_stat(A_WIS, true)) paid = true;
+ if (do_res_stat(A_DEX, true)) paid = true;
+ if (do_res_stat(A_CON, true)) paid = true;
+ if (do_res_stat(A_CHR, true)) paid = true;
break;
}
@@ -1282,7 +1282,7 @@ bool bldg_process_command(const store_type *s_ptr, store_action_type const *ba_p
case BACT_TELEPORT_LEVEL:
{
- if (reset_recall(FALSE))
+ if (reset_recall(false))
{
p_ptr->word_recall = 1;
msg_print("The air about you becomes charged...");
@@ -1310,7 +1310,7 @@ bool bldg_process_command(const store_type *s_ptr, store_action_type const *ba_p
if (fates[i].know) continue;
msg_print("You know a little more of your fate.");
- fates[i].know = TRUE;
+ fates[i].know = true;
found = true;
break;
diff --git a/src/cave.cc b/src/cave.cc
index 6b6b52f7..7b96e16f 100644
--- a/src/cave.cc
+++ b/src/cave.cc
@@ -65,7 +65,7 @@ int distance(int y1, int x1, int y2, int x2)
/*
- * Returns TRUE if a grid is considered to be a wall for the purpose
+ * Returns true if a grid is considered to be a wall for the purpose
* of magic mapping / clairvoyance
*/
static bool is_wall(cave_type *c_ptr)
@@ -116,10 +116,10 @@ static bool is_wall(cave_type *c_ptr)
* A simple, fast, integer-based line-of-sight algorithm. By Joseph Hall,
* 4116 Brewster Drive, Raleigh NC 27606. Email to jnh@ecemwl.ncsu.edu.
*
- * Returns TRUE if a line of sight can be traced from (x1,y1) to (x2,y2).
+ * Returns true if a line of sight can be traced from (x1,y1) to (x2,y2).
*
* The LOS begins at the center of the tile (x1,y1) and ends at the center of
- * the tile (x2,y2). If los() is to return TRUE, all of the tiles this line
+ * the tile (x2,y2). If los() is to return true, all of the tiles this line
* passes through must be floor tiles, except for (x1,y1) and (x2,y2).
*
* We assume that the "mathematical corner" of a non-floor tile does not
@@ -188,7 +188,7 @@ bool los(int y1, int x1, int y2, int x2)
/* Paranoia -- require "safe" origin */
- /* if (!in_bounds(y1, x1)) return (FALSE); */
+ /* if (!in_bounds(y1, x1)) return false; */
/* Directly South/North */
@@ -621,7 +621,7 @@ static byte multi_hued_attr(std::shared_ptr<monster_race> r_ptr)
/* Check breaths */
for (std::size_t i = 0; i < monster_spell_flag_set::nbits; i++)
{
- bool_ stored = FALSE;
+ bool stored = false;
/* Don't have that breath */
if (!(r_ptr->spells.bit(i))) continue;
@@ -651,7 +651,7 @@ static byte multi_hued_attr(std::shared_ptr<monster_race> r_ptr)
for (std::size_t j = 0; j < stored_colors; j++)
{
/* Already stored */
- if (allowed_attrs[j] == first_color) stored = TRUE;
+ if (allowed_attrs[j] == first_color) stored = true;
}
if (!stored)
{
@@ -1471,7 +1471,7 @@ void note_spot(int y, int x)
object_type *o_ptr = &o_list[this_o_idx];
/* Memorize objects */
- o_ptr->marked = TRUE;
+ o_ptr->marked = true;
}
if (c_ptr->m_idx)
@@ -1482,7 +1482,7 @@ void note_spot(int y, int x)
if (r_ptr->flags & RF_MIMIC)
{
object_type *o_ptr = &o_list[m_ptr->mimic_o_idx()];
- o_ptr->marked = TRUE;
+ o_ptr->marked = true;
}
}
@@ -1679,7 +1679,7 @@ static byte priority(byte a, char c)
int i, p0, p1;
/* Scan the table */
- for (i = 0; TRUE; i++)
+ for (i = 0; true; i++)
{
/* Priority level */
p1 = priority_table[i][1];
@@ -3241,7 +3241,7 @@ void update_mon_lite()
cave_type *c_ptr;
u16b info;
- bool_ invis;
+ bool invis;
s16b fast_lite_n = lite_n;
s16b fast_temp_n;
@@ -3405,7 +3405,7 @@ void update_mon_lite()
if (player_has_los_bold(y, x) && c_ptr->m_idx)
{
/* Hide the monster */
- update_mon(c_ptr->m_idx, FALSE);
+ update_mon(c_ptr->m_idx, false);
}
else
{
@@ -3443,7 +3443,7 @@ void update_mon_lite()
if (c_ptr->m_idx)
{
/* Show it */
- update_mon(c_ptr->m_idx, FALSE);
+ update_mon(c_ptr->m_idx, false);
}
else
{
@@ -3692,7 +3692,7 @@ void wiz_lite()
if (o_ptr->held_m_idx) continue;
/* Memorize */
- o_ptr->marked = TRUE;
+ o_ptr->marked = true;
}
/* Scan all normal grids */
@@ -3711,7 +3711,7 @@ void wiz_lite()
if (r_ptr->flags & RF_MIMIC)
{
object_type *o_ptr = &o_list[m_ptr->mimic_o_idx()];
- o_ptr->marked = TRUE;
+ o_ptr->marked = true;
}
}
@@ -3803,7 +3803,7 @@ void wiz_dark()
if (o_ptr->held_m_idx) continue;
/* Forget the object */
- o_ptr->marked = FALSE;
+ o_ptr->marked = false;
}
/* Fully update the visuals */
diff --git a/src/cmd1.cc b/src/cmd1.cc
index 5c6dc861..d6de677e 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -169,11 +169,11 @@ s16b critical_shot(int weight, int plus, int dam, int skill)
*
* Factor in weapon weight, total plusses, player level.
*/
-s16b critical_norm(int weight, int plus, int dam, int weapon_tval, bool_ *done_crit)
+s16b critical_norm(int weight, int plus, int dam, int weapon_tval, bool *done_crit)
{
int i, k, num = randint(5000);
- *done_crit = FALSE;
+ *done_crit = false;
/* Extract "blow" power */
i = (weight + ((p_ptr->to_h + plus) * 5) +
@@ -191,7 +191,7 @@ s16b critical_norm(int weight, int plus, int dam, int weapon_tval, bool_ *done_c
set_tim_deadly(p_ptr->tim_deadly - 1);
msg_print("It was a *GREAT* hit!");
dam = 3 * dam + 20;
- *done_crit = TRUE;
+ *done_crit = true;
}
/* Chance */
@@ -228,7 +228,7 @@ s16b critical_norm(int weight, int plus, int dam, int weapon_tval, bool_ *done_c
msg_print("It was a *SUPERB* hit!");
dam = ((7 * dam) / 2) + 25;
}
- *done_crit = TRUE;
+ *done_crit = true;
}
return (dam);
@@ -514,7 +514,7 @@ static void touch_zap_player(monster_type *m_ptr)
* Carried monster can attack too.
* Based on monst_attack_monst.
*/
-static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
+static void carried_monster_attack(s16b m_idx, bool *mdeath, int x, int y)
{
auto const &r_info = game->edit_data.r_info;
@@ -528,7 +528,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
char temp[80];
- bool_ blinked = FALSE, touched = FALSE;
+ bool blinked = false, touched = false;
byte y_saver = t_ptr->fy;
@@ -557,7 +557,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
monster_desc(t_name, t_ptr, 0);
/* Assume no blink */
- blinked = FALSE;
+ blinked = false;
if (!t_ptr->ml)
{
@@ -605,49 +605,49 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
case RBM_HIT:
{
act = "hits %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_TOUCH:
{
act = "touches %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_PUNCH:
{
act = "punches %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_KICK:
{
act = "kicks %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CLAW:
{
act = "claws %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_BITE:
{
act = "bites %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_STING:
{
act = "stings %s.";
- touched = TRUE;
+ touched = true;
break;
}
@@ -660,84 +660,84 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
case RBM_BUTT:
{
act = "butts %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRUSH:
{
act = "crushes %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_ENGULF:
{
act = "engulfs %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CHARGE:
{
act = "charges %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRAWL:
{
act = "crawls on %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_DROOL:
{
act = "drools on %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_SPIT:
{
act = "spits on %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_GAZE:
{
act = "gazes at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_WAIL:
{
act = "wails at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_SPORE:
{
act = "releases spores at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_XXX4:
{
act = "projects XXX4's at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_BEG:
{
act = "begs %s for money.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -745,7 +745,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
case RBM_INSULT:
{
act = "insults %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -753,7 +753,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
case RBM_MOAN:
{
act = "moans at %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -761,7 +761,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
case RBM_SHOW:
{
act = "sings to %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -826,7 +826,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
case RBE_EAT_GOLD:
{
pt = damage = 0;
- if (randint(2) == 1) blinked = TRUE;
+ if (randint(2) == 1) blinked = true;
break;
}
@@ -939,7 +939,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
{
if (t_ptr->ml)
{
- blinked = FALSE;
+ blinked = false;
msg_format("You are suddenly very hot!");
}
project(m_idx, 0, p_ptr->py, p_ptr->px,
@@ -954,7 +954,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
{
if (t_ptr->ml)
{
- blinked = FALSE;
+ blinked = false;
msg_format("You get zapped!");
}
project(m_idx, 0, p_ptr->py, p_ptr->px,
@@ -1009,7 +1009,7 @@ static void carried_monster_attack(s16b m_idx, bool_ *mdeath, int x, int y)
* Carried monster can attack too.
* Based on monst_attack_monst.
*/
-static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
+static void incarnate_monster_attack(s16b m_idx, bool *mdeath,
int x, int y)
{
auto const &r_info = game->edit_data.r_info;
@@ -1026,7 +1026,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
char temp[80];
- bool_ blinked = FALSE, touched = FALSE;
+ bool blinked = false, touched = false;
byte y_saver = t_ptr->fy;
@@ -1050,7 +1050,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
monster_desc(t_name, t_ptr, 0);
/* Assume no blink */
- blinked = FALSE;
+ blinked = false;
if (!t_ptr->ml)
{
@@ -1098,49 +1098,49 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
case RBM_HIT:
{
act = "hit %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_TOUCH:
{
act = "touch %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_PUNCH:
{
act = "punch %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_KICK:
{
act = "kick %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CLAW:
{
act = "claw %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_BITE:
{
act = "bite %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_STING:
{
act = "sting %s.";
- touched = TRUE;
+ touched = true;
break;
}
@@ -1153,84 +1153,84 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
case RBM_BUTT:
{
act = "butt %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRUSH:
{
act = "crush %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_ENGULF:
{
act = "engulf %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CHARGE:
{
act = "charge %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRAWL:
{
act = "crawl on %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_DROOL:
{
act = "drool on %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_SPIT:
{
act = "spit on %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_GAZE:
{
act = "gaze at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_WAIL:
{
act = "wail at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_SPORE:
{
act = "release spores at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_XXX4:
{
act = "project XXX4's at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_BEG:
{
act = "beg %s for money.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -1238,7 +1238,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
case RBM_INSULT:
{
act = "insult %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -1246,7 +1246,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
case RBM_MOAN:
{
act = "moan at %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -1254,7 +1254,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
case RBM_SHOW:
{
act = "sing to %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -1316,7 +1316,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
case RBE_EAT_GOLD:
{
pt = damage = 0;
- if (randint(2) == 1) blinked = TRUE;
+ if (randint(2) == 1) blinked = true;
break;
}
@@ -1428,7 +1428,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
{
if (t_ptr->ml)
{
- blinked = FALSE;
+ blinked = false;
msg_format("You are suddenly very hot!");
}
project(m_idx, 0, p_ptr->py, p_ptr->px,
@@ -1443,7 +1443,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
{
if (t_ptr->ml)
{
- blinked = FALSE;
+ blinked = false;
msg_format("You get zapped!");
}
project(m_idx, 0, p_ptr->py, p_ptr->px,
@@ -1504,7 +1504,7 @@ static void incarnate_monster_attack(s16b m_idx, bool_ *mdeath,
static void flavored_attack(int percent, char *output)
{
int insanity = (p_ptr->msane - p_ptr->csane) * 100 / p_ptr->msane;
- bool_ insane = (rand_int(100) < insanity);
+ bool insane = (rand_int(100) < insanity);
if (percent < 5)
{
@@ -1625,7 +1625,7 @@ static void py_attack_hand(int *k, monster_type *m_ptr, s32b *special)
martial_arts *blow_table = ma_blows;
int resist_stun = 0;
int max = MAX_MA;
- bool_ desc = FALSE;
+ bool desc = false;
int plev = p_ptr->lev;
if ((!p_ptr->body_monster) && (p_ptr->mimic_form == resolve_mimic_name("Bear")) &&
@@ -1697,14 +1697,14 @@ static void py_attack_hand(int *k, monster_type *m_ptr, s32b *special)
}
else if (!desc) msg_format(ma_ptr->desc, m_name);
- desc = TRUE;
+ desc = true;
}
if (ma_ptr->effect & MA_FULL_SLOW)
{
special_effect = MA_SLOW;
if (!desc) msg_format(ma_ptr->desc, m_name);
- desc = TRUE;
+ desc = true;
}
if (ma_ptr->effect & MA_SLOW)
{
@@ -1717,7 +1717,7 @@ static void py_attack_hand(int *k, monster_type *m_ptr, s32b *special)
}
else if (!desc) msg_format(ma_ptr->desc, m_name);
- desc = TRUE;
+ desc = true;
}
if (ma_ptr->effect & MA_STUN)
{
@@ -1727,7 +1727,7 @@ static void py_attack_hand(int *k, monster_type *m_ptr, s32b *special)
}
if (!desc) msg_format(ma_ptr->desc, m_name);
- desc = TRUE;
+ desc = true;
}
if (ma_ptr->effect & MA_WOUND)
{
@@ -1736,10 +1736,10 @@ static void py_attack_hand(int *k, monster_type *m_ptr, s32b *special)
*special |= SPEC_CUT;
}
if (!desc) msg_format(ma_ptr->desc, m_name);
- desc = TRUE;
+ desc = true;
}
- bool_ done_crit;
+ bool done_crit;
*k = critical_norm(plev * (randint(10)), ma_ptr->min_level, *k, -1, &done_crit);
if ((special_effect & MA_KNEE) && ((*k + p_ptr->to_d) < m_ptr->hp))
@@ -1780,13 +1780,13 @@ static void py_attack_hand(int *k, monster_type *m_ptr, s32b *special)
static void do_nazgul(int *k, int *num, int num_blow, int weap, std::shared_ptr<monster_race> r_ptr,
object_type *o_ptr)
{
- bool_ allow_shatter = TRUE;
+ bool allow_shatter = true;
/* Extract mundane-ness of the current weapon */
auto const f = object_flags(o_ptr);
/* It should be Slay Evil, Slay Undead, or *Slay Undead* */
- bool_ const mundane =
+ bool const mundane =
!(f & TR_SLAY_EVIL) &&
!(f & TR_SLAY_UNDEAD) &&
!(f & TR_KILL_UNDEAD);
@@ -1794,7 +1794,7 @@ static void do_nazgul(int *k, int *num, int num_blow, int weap, std::shared_ptr<
/* Some blades can resist shattering */
if (f & TR_RES_MORGUL)
{
- allow_shatter = FALSE;
+ allow_shatter = false;
}
/* Mega Hack -- Hitting Nazgul is REALY dangerous (ideas from Akhronath) */
@@ -1887,21 +1887,21 @@ void py_attack(int y, int x, int max_blow)
bool fear = false;
- bool_ mdeath = FALSE;
+ bool mdeath = false;
- bool_ backstab = FALSE;
+ bool backstab = false;
- bool_ vorpal_cut = FALSE;
+ bool vorpal_cut = false;
int chaos_effect = 0;
- bool_ stab_fleeing = FALSE;
+ bool stab_fleeing = false;
- bool_ do_quake = FALSE;
+ bool do_quake = false;
- bool_ done_crit = FALSE;
+ bool done_crit = false;
- bool_ drain_msg = TRUE;
+ bool drain_msg = true;
int drain_result = 0, drain_heal = 0;
@@ -1923,11 +1923,11 @@ void py_attack(int y, int x, int max_blow)
if ((m_ptr->csleep) && (m_ptr->ml))
{
/* Can't backstab creatures that we can't see, right? */
- backstab = TRUE;
+ backstab = true;
}
else if ((m_ptr->monfear) && (m_ptr->ml))
{
- stab_fleeing = TRUE;
+ stab_fleeing = true;
}
}
@@ -2081,9 +2081,9 @@ void py_attack(int y, int x, int max_blow)
}
if ((flags & TR_VORPAL) && (randint(6) == 1))
- vorpal_cut = TRUE;
+ vorpal_cut = true;
else
- vorpal_cut = FALSE;
+ vorpal_cut = false;
/* Should we attack with hands or not ? */
if (p_ptr->melee_style != SKILL_MASTERY)
@@ -2111,7 +2111,7 @@ void py_attack(int y, int x, int max_blow)
if ((p_ptr->impact && ((k > 50) || randint(7) == 1))
|| (chaos_effect == 2))
{
- do_quake = TRUE;
+ do_quake = true;
}
k = critical_norm(o_ptr->weight, o_ptr->to_h, k, o_ptr->tval, &done_crit);
@@ -2170,7 +2170,7 @@ void py_attack(int y, int x, int max_blow)
project(0, p_ptr->tim_project_rad, y, x, p_ptr->tim_project_dam, p_ptr->tim_project_gf, p_ptr->tim_project_flag | PROJECT_JUMP);
if (!c_ptr->m_idx)
{
- mdeath = TRUE;
+ mdeath = true;
break;
}
}
@@ -2201,7 +2201,7 @@ void py_attack(int y, int x, int max_blow)
{
msg_format("Oh no! Your weapon clones %^s!",
m_name);
- multiply_monster(c_ptr->m_idx, FALSE, TRUE);
+ multiply_monster(c_ptr->m_idx, false, true);
}
/* Apply the player damage bonuses */
@@ -2234,7 +2234,7 @@ void py_attack(int y, int x, int max_blow)
monster_race_desc(buf, m_ptr->r_idx, m_ptr->ego);
- backstab = FALSE;
+ backstab = false;
msg_format
("You cruelly stab the helpless, sleeping %s!",
@@ -2269,7 +2269,7 @@ void py_attack(int y, int x, int max_blow)
{
energy_use = energy_use * num / num_blow;
}
- mdeath = TRUE;
+ mdeath = true;
break;
}
@@ -2320,7 +2320,7 @@ void py_attack(int y, int x, int max_blow)
msg_format
("Your weapon drains life from %s!",
m_name);
- drain_msg = FALSE;
+ drain_msg = false;
}
hp_player(drain_heal);
@@ -2335,7 +2335,7 @@ void py_attack(int y, int x, int max_blow)
/* Cancel glowing hands */
if (p_ptr->confusing)
{
- p_ptr->confusing = FALSE;
+ p_ptr->confusing = false;
msg_print("Your hands stop glowing.");
}
@@ -2402,7 +2402,7 @@ void py_attack(int y, int x, int max_blow)
/* Player misses */
else
{
- backstab = FALSE; /* Clumsy! */
+ backstab = false; /* Clumsy! */
/* Message */
msg_format("You miss %s.", m_name);
@@ -2529,14 +2529,14 @@ bool player_can_enter(byte feature)
* easy_open_door --
*
* If there is a jammed/closed/locked door at the given location,
- * then attempt to unlock/open it. Return TRUE if an attempt was
- * made (successful or not), otherwise return FALSE.
+ * then attempt to unlock/open it. Return true if an attempt was
+ * made (successful or not), otherwise return false.
*
* The code here should be nearly identical to that in
* do_cmd_open_test() and do_cmd_open_aux().
*/
-static bool_ easy_open_door(int y, int x)
+static bool easy_open_door(int y, int x)
{
auto const &r_info = game->edit_data.r_info;
@@ -2551,14 +2551,14 @@ static bool_ easy_open_door(int y, int x)
{
msg_print("You cannot open doors.");
- return (FALSE);
+ return false;
}
/* Must be a closed door */
if (!((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_DOOR_TAIL)))
{
/* Nope */
- return (FALSE);
+ return false;
}
/* Jammed door */
@@ -2625,7 +2625,7 @@ static bool_ easy_open_door(int y, int x)
}
/* Result */
- return (TRUE);
+ return true;
}
/*
@@ -2653,7 +2653,7 @@ void move_player_aux(int dir, int do_pickup, int run)
char m_name[80];
- bool_ oktomove = TRUE;
+ bool oktomove = true;
/* Hack - random movement */
@@ -2728,7 +2728,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_x--;
p_ptr->oldpy = cur_hgt - 2;
p_ptr->oldpx = cur_wid - 2;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if ((y == 0) && (x == MAX_WID - 1))
@@ -2737,7 +2737,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_x++;
p_ptr->oldpy = cur_hgt - 2;
p_ptr->oldpx = 1;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if ((y == MAX_HGT - 1) && (x == 0))
@@ -2746,7 +2746,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_x--;
p_ptr->oldpy = 1;
p_ptr->oldpx = cur_wid - 2;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if ((y == MAX_HGT - 1) && (x == MAX_WID - 1))
@@ -2755,7 +2755,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_x++;
p_ptr->oldpy = 1;
p_ptr->oldpx = 1;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (y == 0)
@@ -2763,7 +2763,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_y--;
p_ptr->oldpy = cur_hgt - 2;
p_ptr->oldpx = x;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (y == cur_hgt - 1)
@@ -2771,7 +2771,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_y++;
p_ptr->oldpy = 1;
p_ptr->oldpx = x;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (x == 0)
@@ -2779,7 +2779,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_x--;
p_ptr->oldpx = cur_wid - 2;
p_ptr->oldpy = y;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (x == cur_wid - 1)
@@ -2787,7 +2787,7 @@ void move_player_aux(int dir, int do_pickup, int run)
p_ptr->wilderness_x++;
p_ptr->oldpx = 1;
p_ptr->oldpy = y;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
p_ptr->leaving = true;
@@ -2806,7 +2806,7 @@ void move_player_aux(int dir, int do_pickup, int run)
if (p_ptr->dripping_tread > 0)
{
- geomancy_random_floor(y, x, FALSE);
+ geomancy_random_floor(y, x, false);
p_ptr->dripping_tread -= 1;
if (p_ptr->dripping_tread == 0)
{
@@ -2855,13 +2855,13 @@ void move_player_aux(int dir, int do_pickup, int run)
m_ptr->fx = p_ptr->px;
cave[p_ptr->py][p_ptr->px].m_idx = c_ptr->m_idx;
c_ptr->m_idx = 0;
- update_mon(cave[p_ptr->py][p_ptr->px].m_idx, TRUE);
+ update_mon(cave[p_ptr->py][p_ptr->px].m_idx, true);
}
else
{
msg_format("%^s is in your way!", m_name);
energy_use = 0;
- oktomove = FALSE;
+ oktomove = false;
}
/* now continue on to 'movement' */
@@ -2869,7 +2869,7 @@ void move_player_aux(int dir, int do_pickup, int run)
else
{
py_attack(y, x, -1);
- oktomove = FALSE;
+ oktomove = false;
}
}
@@ -2877,20 +2877,20 @@ void move_player_aux(int dir, int do_pickup, int run)
{
msg_print("You can't cross the chasm.");
running = 0;
- oktomove = FALSE;
+ oktomove = false;
}
/* Player can't enter ? soo bad for him/her ... */
else if (!player_can_enter(c_ptr->feat))
{
- oktomove = FALSE;
+ oktomove = false;
/* Disturb the player */
disturb();
if (p_ptr->prob_travel)
{
- if (passwall(tmp, TRUE)) return;
+ if (passwall(tmp, true)) return;
}
/* Notice things in the dark */
@@ -3102,26 +3102,26 @@ static int see_obstacle_grid(cave_type *c_ptr)
case FEAT_DEEP_WATER:
case FEAT_ICE:
{
- if (p_ptr->ffall || p_ptr->fly) return (FALSE);
+ if (p_ptr->ffall || p_ptr->fly) return false;
}
/* Require immunity */
case FEAT_DEEP_LAVA:
case FEAT_SHAL_LAVA:
{
- if (p_ptr->invuln || p_ptr->immune_fire) return (FALSE);
+ if (p_ptr->invuln || p_ptr->immune_fire) return false;
}
}
/* "Safe" floor grids aren't obstacles */
- if (f_info[c_ptr->feat].flags & FF_CAN_RUN) return (FALSE);
+ if (f_info[c_ptr->feat].flags & FF_CAN_RUN) return false;
/* Must be known to the player */
- if (!(c_ptr->info & (CAVE_MARK))) return (FALSE);
+ if (!(c_ptr->info & (CAVE_MARK))) return false;
/* Default */
- return (TRUE);
+ return true;
}
@@ -3135,7 +3135,7 @@ static int see_obstacle(int dir, int y, int x)
x += ddx[dir];
/* Illegal grids are not known walls */
- if (!in_bounds2(y, x)) return (FALSE);
+ if (!in_bounds2(y, x)) return false;
/* Analyse the grid */
return (see_obstacle_grid(&cave[y][x]));
@@ -3152,19 +3152,19 @@ static int see_nothing(int dir, int y, int x)
x += ddx[dir];
/* Illegal grids are unknown */
- if (!in_bounds2(y, x)) return (TRUE);
+ if (!in_bounds2(y, x)) return true;
/* Memorized grids are always known */
- if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
+ if (cave[y][x].info & (CAVE_MARK)) return false;
/* Non-floor grids are unknown */
- if (!cave_floor_bold(y, x)) return (TRUE);
+ if (!cave_floor_bold(y, x)) return true;
/* Viewable door/wall grids are known */
- if (player_can_see_bold(y, x)) return (FALSE);
+ if (player_can_see_bold(y, x)) return false;
/* Default */
- return (TRUE);
+ return true;
}
@@ -3325,13 +3325,13 @@ static byte find_prevdir;
/*
* We are looking for open area
*/
-static bool_ find_openarea;
+static bool find_openarea;
/*
* We are looking for a break
*/
-static bool_ find_breakright;
-static bool_ find_breakleft;
+static bool find_breakright;
+static bool find_breakleft;
@@ -3363,14 +3363,14 @@ static void run_init(int dir)
find_prevdir = dir;
/* Assume looking for open area */
- find_openarea = TRUE;
+ find_openarea = true;
/* Assume not looking for breaks */
- find_breakright = find_breakleft = FALSE;
+ find_breakright = find_breakleft = false;
/* Assume no nearby walls */
- deepleft = deepright = FALSE;
- shortright = shortleft = FALSE;
+ deepleft = deepright = false;
+ shortright = shortleft = false;
/* Find the destination grid */
row = p_ptr->py + ddy[dir];
@@ -3382,32 +3382,32 @@ static void run_init(int dir)
/* Check for walls */
if (see_obstacle(cycle[i + 1], p_ptr->py, p_ptr->px))
{
- find_breakleft = TRUE;
- shortleft = TRUE;
+ find_breakleft = true;
+ shortleft = true;
}
else if (see_obstacle(cycle[i + 1], row, col))
{
- find_breakleft = TRUE;
- deepleft = TRUE;
+ find_breakleft = true;
+ deepleft = true;
}
/* Check for walls */
if (see_obstacle(cycle[i - 1], p_ptr->py, p_ptr->px))
{
- find_breakright = TRUE;
- shortright = TRUE;
+ find_breakright = true;
+ shortright = true;
}
else if (see_obstacle(cycle[i - 1], row, col))
{
- find_breakright = TRUE;
- deepright = TRUE;
+ find_breakright = true;
+ deepright = true;
}
/* Looking for a break */
if (find_breakleft && find_breakright)
{
/* Not looking for open area */
- find_openarea = FALSE;
+ find_openarea = false;
/* Hack -- allow angled corridor entry */
if (dir & 0x01)
@@ -3441,9 +3441,9 @@ static void run_init(int dir)
/*
* Update the current "run" path
*
- * Return TRUE if the running should be stopped
+ * Return true if the running should be stopped
*/
-static bool_ run_test()
+static bool run_test()
{
auto const &f_info = game->edit_data.f_info;
@@ -3483,7 +3483,7 @@ static bool_ run_test()
monster_type *m_ptr = &m_list[c_ptr->m_idx];
/* Visible monster */
- if (m_ptr->ml) return (TRUE);
+ if (m_ptr->ml) return true;
}
/* Visible objects abort running */
@@ -3493,17 +3493,17 @@ static bool_ run_test()
object_type * o_ptr = &o_list[o_idx];
/* Visible object */
- if (o_ptr->marked) return (TRUE);
+ if (o_ptr->marked) return true;
}
/* Assume unknown */
- inv = TRUE;
+ inv = true;
/* Check memorized grids */
if (c_ptr->info & (CAVE_MARK))
{
- bool_ notice = TRUE;
+ bool notice = true;
/*
* Examine the terrain -- conditional disturbance
@@ -3515,7 +3515,7 @@ static bool_ run_test()
case FEAT_SHAL_LAVA:
{
/* Ignore */
- if (p_ptr->invuln || p_ptr->immune_fire) notice = FALSE;
+ if (p_ptr->invuln || p_ptr->immune_fire) notice = false;
/* Done */
break;
@@ -3525,7 +3525,7 @@ static bool_ run_test()
case FEAT_ICE:
{
/* Ignore */
- if (p_ptr->ffall || p_ptr->fly) notice = FALSE;
+ if (p_ptr->ffall || p_ptr->fly) notice = false;
/* Done */
break;
@@ -3536,7 +3536,7 @@ static bool_ run_test()
case FEAT_BROKEN:
{
/* Option -- ignore */
- if (options->find_ignore_doors) notice = FALSE;
+ if (options->find_ignore_doors) notice = false;
/* Done */
break;
@@ -3562,7 +3562,7 @@ static bool_ run_test()
case FEAT_BETWEEN2:
{
/* Option -- ignore */
- if (options->find_ignore_stairs) notice = FALSE;
+ if (options->find_ignore_stairs) notice = false;
/* Done */
break;
@@ -3572,14 +3572,14 @@ static bool_ run_test()
/* Check the "don't notice running" flag */
if (f_info[c_ptr->feat].flags & FF_DONT_NOTICE_RUNNING)
{
- notice = FALSE;
+ notice = false;
}
/* Interesting feature */
- if (notice) return (TRUE);
+ if (notice) return true;
/* The grid is "visible" */
- inv = FALSE;
+ inv = false;
}
/* Analyze unknown grids and floors */
@@ -3600,13 +3600,13 @@ static bool_ run_test()
/* Three new directions. Stop running. */
else if (option2)
{
- return (TRUE);
+ return true;
}
/* Two non-adjacent new directions. Stop running. */
else if (option != cycle[chome[prev_dir] + i - 1])
{
- return (TRUE);
+ return true;
}
/* Two new (adjacent) directions (case 1) */
@@ -3633,13 +3633,13 @@ static bool_ run_test()
if (i < 0)
{
/* Break to the right */
- find_breakright = TRUE;
+ find_breakright = true;
}
else if (i > 0)
{
/* Break to the left */
- find_breakleft = TRUE;
+ find_breakleft = true;
}
}
}
@@ -3666,7 +3666,7 @@ static bool_ run_test()
/* Looking to break right */
if (find_breakright)
{
- return (TRUE);
+ return true;
}
}
@@ -3676,7 +3676,7 @@ static bool_ run_test()
/* Looking to break left */
if (find_breakleft)
{
- return (TRUE);
+ return true;
}
}
}
@@ -3698,7 +3698,7 @@ static bool_ run_test()
/* Looking to break left */
if (find_breakleft)
{
- return (TRUE);
+ return true;
}
}
@@ -3708,7 +3708,7 @@ static bool_ run_test()
/* Looking to break right */
if (find_breakright)
{
- return (TRUE);
+ return true;
}
}
}
@@ -3721,7 +3721,7 @@ static bool_ run_test()
/* No options */
if (!option)
{
- return (TRUE);
+ return true;
}
/* One option */
@@ -3768,7 +3768,7 @@ static bool_ run_test()
/* STOP: we are next to an intersection or a room */
else
{
- return (TRUE);
+ return true;
}
}
@@ -3793,12 +3793,12 @@ static bool_ run_test()
/* About to hit a known wall, stop */
if (see_obstacle(find_current, p_ptr->py, p_ptr->px))
{
- return (TRUE);
+ return true;
}
/* Failure */
- return (FALSE);
+ return false;
}
@@ -3873,7 +3873,7 @@ void do_cmd_pet()
char power_desc[36][80];
- bool_ flag;
+ bool flag;
int ask;
@@ -3883,7 +3883,7 @@ void do_cmd_pet()
int pets = 0, pet_ctr = 0;
- bool_ all_pets = FALSE;
+ bool all_pets = false;
monster_type *m_ptr;
@@ -3950,7 +3950,7 @@ void do_cmd_pet()
}
/* Nothing chosen yet */
- flag = FALSE;
+ flag = false;
/* Build a prompt (accept all spells) */
if (num <= 26)
@@ -3968,7 +3968,7 @@ void do_cmd_pet()
}
/* Save the screen */
- character_icky = TRUE;
+ character_icky = true;
Term_save();
/* Show the list */
@@ -4019,7 +4019,7 @@ void do_cmd_pet()
}
else
{
- ask = FALSE; /* Can't uppercase digits */
+ ask = false; /* Can't uppercase digits */
i = choice - '0' + 26;
}
@@ -4044,12 +4044,12 @@ void do_cmd_pet()
}
/* Stop the loop */
- flag = TRUE;
+ flag = true;
}
/* Restore the screen */
Term_load();
- character_icky = FALSE;
+ character_icky = false;
/* Abort if needed */
if (!flag)
@@ -4120,7 +4120,7 @@ void do_cmd_pet()
{
int Dismissed = 0;
- if (get_check("Dismiss all pets? ")) all_pets = TRUE;
+ if (get_check("Dismiss all pets? ")) all_pets = true;
/* Process the monsters (backwards) */
for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
@@ -4131,13 +4131,13 @@ void do_cmd_pet()
if ((!(r_ptr->flags & RF_NO_DEATH)) && ((m_ptr->status == MSTATUS_PET) || (m_ptr->status == MSTATUS_FRIEND))) /* Get rid of it! */
{
- bool_ checked = FALSE;
+ bool checked = false;
char command;
- bool_ delete_this = FALSE;
+ bool delete_this = false;
if (all_pets)
{
- delete_this = TRUE;
+ delete_this = true;
}
else
{
@@ -4150,19 +4150,19 @@ void do_cmd_pet()
if (!get_com(check_friend, &command))
{
/* get out of loop */
- checked = TRUE;
+ checked = true;
pet_ctr = 0;
}
else switch (command)
{
case 'Y':
case 'y':
- delete_this = TRUE;
- checked = TRUE;
+ delete_this = true;
+ checked = true;
break;
case 'n':
case 'N':
- checked = TRUE;
+ checked = true;
break;
default:
bell();
@@ -4187,7 +4187,7 @@ void do_cmd_pet()
{
int Dismissed = 0;
- if (get_check("Dismiss all companions? ")) all_pets = TRUE;
+ if (get_check("Dismiss all companions? ")) all_pets = true;
/* Process the monsters (backwards) */
for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
@@ -4198,10 +4198,10 @@ void do_cmd_pet()
if ((!(r_ptr->flags & RF_NO_DEATH)) && ((m_ptr->status == MSTATUS_COMPANION))) /* Get rid of it! */
{
- bool_ delete_this = FALSE;
+ bool delete_this = false;
if (all_pets)
- delete_this = TRUE;
+ delete_this = true;
else
{
char friend_name[80], check_friend[80];
@@ -4209,7 +4209,7 @@ void do_cmd_pet()
strnfmt(check_friend, 80, "Dismiss %s? ", friend_name);
if (get_check(check_friend))
- delete_this = TRUE;
+ delete_this = true;
}
if (delete_this)
@@ -4433,7 +4433,7 @@ bool execute_inscription(byte i, byte y, byte x)
scatter(&yy, &xx, y, x, 3);
place_monster_one(yy, xx, test_monster_name("Dwarven Warrior"),
- 0, FALSE, MSTATUS_FRIEND);
+ 0, false, MSTATUS_FRIEND);
break;
}
@@ -4474,19 +4474,19 @@ bool execute_inscription(byte i, byte y, byte x)
/* Scan all objects in the grid */
for (auto const this_o_idx: object_idxs)
{
- bool_ plural = FALSE;
+ bool plural = false;
char o_name[80];
/* Acquire object */
object_type * o_ptr = &o_list[this_o_idx];
- if (o_ptr->number > 1) plural = TRUE;
+ if (o_ptr->number > 1) plural = true;
/* Effect "observed" */
if (o_ptr->marked)
{
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
}
/* Artifacts get to resist */
diff --git a/src/cmd1.hpp b/src/cmd1.hpp
index 0ecc742e..263cad38 100644
--- a/src/cmd1.hpp
+++ b/src/cmd1.hpp
@@ -8,7 +8,7 @@ void attack_special(monster_type *m_ptr, s32b special, int dam);
bool test_hit_fire(int chance, int ac, int vis);
bool test_hit_norm(int chance, int ac, int vis);
s16b critical_shot(int weight, int plus, int dam, int skill);
-s16b critical_norm(int weight, int plus, int dam, int weapon_tval, bool_ *done_crit);
+s16b critical_norm(int weight, int plus, int dam, int weapon_tval, bool *done_crit);
s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, s32b *special);
void search();
void carry(int pickup);
diff --git a/src/cmd2.cc b/src/cmd2.cc
index 7871c842..958e9784 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -67,23 +67,23 @@ void do_cmd_immovable_special();
/*
* Try to bash an altar
*/
-static bool_ do_cmd_bash_altar(int y, int x)
+static bool do_cmd_bash_altar(int y, int x)
{
msg_print("Are you mad? You want to anger the gods?");
- return (FALSE);
+ return false;
}
/*
* Try to bash a fountain
*/
-static bool_ do_cmd_bash_fountain(int y, int x)
+static bool do_cmd_bash_fountain(int y, int x)
{
auto const &r_info = game->edit_data.r_info;
int bash, temp;
- bool_ more = TRUE;
+ bool more = true;
auto r_ptr = &r_info[p_ptr->body_monster];
@@ -92,7 +92,7 @@ static bool_ do_cmd_bash_fountain(int y, int x)
{
msg_print("You cannot do that.");
- return (FALSE);
+ return false;
}
/* Take a turn */
@@ -120,7 +120,7 @@ static bool_ do_cmd_bash_fountain(int y, int x)
fire_ball(GF_WATER, 5, damroll(6, 8), 2);
cave_set_feat(y, x, FEAT_DEEP_WATER);
- more = FALSE;
+ more = false;
}
return (more);
@@ -129,10 +129,10 @@ static bool_ do_cmd_bash_fountain(int y, int x)
/*
* Stair hooks
*/
-static bool_ stair_hooks(stairs_direction direction)
+static bool stair_hooks(stairs_direction direction)
{
hook_stair_in in = { direction };
- hook_stair_out out = { TRUE }; /* Allow by default */
+ hook_stair_out out = { true }; /* Allow by default */
process_hooks_new(HOOK_STAIR, &in, &out);
return (!out.allow);
}
@@ -169,7 +169,7 @@ void do_cmd_go_up()
auto const &d_info = game->edit_data.d_info;
auto const &dungeon_flags = game->dungeon_flags;
- bool_ go_up = FALSE, go_up_many = FALSE, prob_traveling = FALSE;
+ bool go_up = false, go_up_many = false, prob_traveling = false;
cave_type *c_ptr;
@@ -192,7 +192,7 @@ void do_cmd_go_up()
{
if (!dun_level)
{
- go_up = TRUE;
+ go_up = true;
}
else if (dungeon_flags & DF_ASK_LEAVE)
{
@@ -200,7 +200,7 @@ void do_cmd_go_up()
}
else if (ask_leave())
{
- go_up = TRUE;
+ go_up = true;
}
}
@@ -209,7 +209,7 @@ void do_cmd_go_up()
{
if (dun_level == 1)
{
- go_up = TRUE;
+ go_up = true;
}
else if (dungeon_flags & DF_ASK_LEAVE)
{
@@ -217,7 +217,7 @@ void do_cmd_go_up()
}
else if (ask_leave())
{
- go_up_many = TRUE;
+ go_up_many = true;
}
}
@@ -251,11 +251,11 @@ void do_cmd_go_up()
return;
}
- prob_traveling = TRUE;
+ prob_traveling = true;
if (ask_leave())
{
- go_up = TRUE;
+ go_up = true;
}
}
else
@@ -287,9 +287,9 @@ void do_cmd_go_up()
/* Create a way back */
if (go_up_many)
- create_down_shaft = TRUE;
+ create_down_shaft = true;
else
- create_down_stair = TRUE;
+ create_down_stair = true;
/* New depth */
if (go_up)
@@ -315,9 +315,9 @@ void do_cmd_go_up()
/*
- * Returns TRUE if we are in the Between...
+ * Returns true if we are in the Between...
*/
-static bool_ between_effect()
+static bool between_effect()
{
byte bx, by;
@@ -336,14 +336,14 @@ static bool_ between_effect()
/* To avoid being teleported back */
energy_use = 100;
- return (TRUE);
+ return true;
}
else if (cave[p_ptr->py][p_ptr->px].feat == FEAT_BETWEEN2)
{
between_exit *be_ptr = &between_exits[cave[p_ptr->py][p_ptr->px].special];
- p_ptr->wild_mode = FALSE;
+ p_ptr->wild_mode = false;
p_ptr->wilderness_x = be_ptr->wild_x;
p_ptr->wilderness_y = be_ptr->wild_y;
p_ptr->oldpx = p_ptr->px = be_ptr->px;
@@ -352,10 +352,10 @@ static bool_ between_effect()
dun_level = be_ptr->level;
p_ptr->leaving = true;
- return (TRUE);
+ return true;
}
else
- return (FALSE);
+ return false;
}
/*
@@ -368,7 +368,7 @@ void do_cmd_go_down()
cave_type *c_ptr;
- bool_ go_down = FALSE, go_down_many = FALSE, prob_traveling = FALSE;
+ bool go_down = false, go_down_many = false, prob_traveling = false;
char i;
@@ -406,7 +406,7 @@ void do_cmd_go_down()
{
if (!dun_level)
{
- go_down = TRUE;
+ go_down = true;
/* Save old player position */
p_ptr->oldpx = p_ptr->px;
@@ -416,7 +416,7 @@ void do_cmd_go_down()
{
if (ask_leave())
{
- go_down_many = TRUE;
+ go_down_many = true;
}
}
}
@@ -430,7 +430,7 @@ void do_cmd_go_down()
}
if (!dun_level)
{
- go_down = TRUE;
+ go_down = true;
/* Save old player position */
p_ptr->oldpx = p_ptr->px;
@@ -440,7 +440,7 @@ void do_cmd_go_down()
{
if (ask_leave())
{
- go_down = TRUE;
+ go_down = true;
}
}
}
@@ -465,11 +465,11 @@ void do_cmd_go_down()
return;
}
- prob_traveling = TRUE;
+ prob_traveling = true;
if (ask_leave())
{
- go_down = TRUE;
+ go_down = true;
}
}
@@ -560,18 +560,18 @@ void do_cmd_go_down()
}
/*
- * Return TRUE if the given grid is an open door
+ * Return true if the given grid is an open door
*/
-static bool_ is_open(cave_type *c_ptr)
+static bool is_open(cave_type *c_ptr)
{
return (c_ptr->feat == FEAT_OPEN);
}
/*
- * Return TRUE if the given grid is a closed door
+ * Return true if the given grid is a closed door
*/
-static bool_ is_closed(cave_type *c_ptr)
+static bool is_closed(cave_type *c_ptr)
{
byte feat;
@@ -585,8 +585,8 @@ static bool_ is_closed(cave_type *c_ptr)
* Return the number of doors/traps around (or under)
* the character using the filter function 'test'
*/
-static int count_feats(int *y, int *x, bool_ (*test) (cave_type *c_ptr),
- bool_ under)
+static int count_feats(int *y, int *x, bool (*test) (cave_type *c_ptr),
+ bool under)
{
int d;
@@ -662,9 +662,9 @@ static int coords_to_dir(int y, int x)
*
* Assume there is no monster blocking the destination
*
- * Returns TRUE if repeated commands may continue
+ * Returns true if repeated commands may continue
*/
-static bool_ do_cmd_open_aux(int y, int x, int dir)
+static bool do_cmd_open_aux(int y, int x, int dir)
{
auto const &r_info = game->edit_data.r_info;
@@ -672,7 +672,7 @@ static bool_ do_cmd_open_aux(int y, int x, int dir)
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
auto r_ptr = &r_info[p_ptr->body_monster];
@@ -681,7 +681,7 @@ static bool_ do_cmd_open_aux(int y, int x, int dir)
{
msg_print("You cannot open doors.");
- return (FALSE);
+ return false;
}
/* Take a turn */
@@ -742,7 +742,7 @@ static bool_ do_cmd_open_aux(int y, int x, int dir)
msg_print("You failed to pick the lock.");
/* We may keep trying */
- more = TRUE;
+ more = true;
}
}
@@ -775,7 +775,7 @@ void do_cmd_open()
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
auto r_ptr = &r_info[p_ptr->body_monster];
@@ -790,7 +790,7 @@ void do_cmd_open()
/* Pick a direction if there's an obvious target */
{
/* Count closed doors (locked or jammed) */
- const int num_doors = count_feats(&y, &x, is_closed, FALSE);
+ const int num_doors = count_feats(&y, &x, is_closed, false);
/* There is nothing the player can open */
if (num_doors == 0)
@@ -874,15 +874,15 @@ void do_cmd_open()
*
* Assume there is no monster blocking the destination
*
- * Returns TRUE if repeated commands may continue
+ * Returns true if repeated commands may continue
*/
-static bool_ do_cmd_close_aux(int y, int x, int dir)
+static bool do_cmd_close_aux(int y, int x, int dir)
{
auto const &r_info = game->edit_data.r_info;
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
auto r_ptr = &r_info[p_ptr->body_monster];
@@ -891,7 +891,7 @@ static bool_ do_cmd_close_aux(int y, int x, int dir)
{
msg_print("You cannot close doors.");
- return (FALSE);
+ return false;
}
/* Take a turn */
@@ -931,7 +931,7 @@ void do_cmd_close()
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
/* Pick a direction if there's an obvious choice */
@@ -939,7 +939,7 @@ void do_cmd_close()
int num_doors;
/* Count open doors */
- num_doors = count_feats(&y, &x, is_open, FALSE);
+ num_doors = count_feats(&y, &x, is_open, false);
/* There are no doors the player can close */
if (num_doors == 0)
@@ -1017,7 +1017,7 @@ void do_cmd_close()
/*
* Determine if a given grid may be "tunneled"
*/
-static bool_ do_cmd_tunnel_test(int y, int x)
+static bool do_cmd_tunnel_test(int y, int x)
{
auto const &f_info = game->edit_data.f_info;
@@ -1028,7 +1028,7 @@ static bool_ do_cmd_tunnel_test(int y, int x)
msg_print("You see nothing there.");
/* Nope */
- return (FALSE);
+ return false;
}
/* Must be a wall/door/etc */
@@ -1038,7 +1038,7 @@ static bool_ do_cmd_tunnel_test(int y, int x)
msg_print("You see nothing there to tunnel.");
/* Nope */
- return (FALSE);
+ return false;
}
/* Must be tunnelable */
@@ -1048,11 +1048,11 @@ static bool_ do_cmd_tunnel_test(int y, int x)
msg_print(f_info[cave[y][x].feat].tunnel);
/* Nope */
- return (FALSE);
+ return false;
}
/* Okay */
- return (TRUE);
+ return true;
}
@@ -1066,13 +1066,13 @@ static bool_ do_cmd_tunnel_test(int y, int x)
* This will, however, produce grids which are NOT illuminated
* (or darkened) along with the rest of the room.
*/
-static bool_ twall(int y, int x, byte feat)
+static bool twall(int y, int x, byte feat)
{
cave_type *c_ptr = &cave[y][x];
/* Paranoia -- Require a wall or door or some such */
- if (cave_floor_bold(y, x)) return (FALSE);
+ if (cave_floor_bold(y, x)) return false;
/* Forget the wall */
c_ptr->info &= ~(CAVE_MARK);
@@ -1084,7 +1084,7 @@ static bool_ twall(int y, int x, byte feat)
p_ptr->update |= (PU_VIEW | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
/* Result */
- return (TRUE);
+ return true;
}
@@ -1097,9 +1097,9 @@ static bool_ twall(int y, int x, byte feat)
*
* Assumes that no monster is blocking the destination
*
- * Returns TRUE if repeated commands may continue
+ * Returns true if repeated commands may continue
*/
-static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
+static bool do_cmd_tunnel_aux(int y, int x, int dir)
{
auto const &d_info = game->edit_data.d_info;
auto const &f_info = game->edit_data.f_info;
@@ -1109,7 +1109,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
auto f_ptr = &f_info[c_ptr->feat];
- bool_ more = FALSE;
+ bool more = false;
/* Must be have something to dig with (except for sandwalls) */
@@ -1120,12 +1120,12 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
{
msg_print("You need to have a shovel or pick in your tool slot.");
- return (FALSE);
+ return false;
}
}
/* Verify legality */
- if (!do_cmd_tunnel_test(y, x)) return (FALSE);
+ if (!do_cmd_tunnel_test(y, x)) return false;
/* Take a turn */
energy_use = 100;
@@ -1154,7 +1154,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
{
/* We may continue chopping */
msg_print(f_ptr->tunnel);
- more = TRUE;
+ more = true;
}
}
@@ -1176,7 +1176,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
{
/* We may continue tunelling */
msg_print(f_ptr->tunnel);
- more = TRUE;
+ more = true;
}
}
@@ -1187,24 +1187,24 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
((c_ptr->feat >= FEAT_SANDWALL) &&
(c_ptr->feat <= FEAT_SANDWALL_K)))
{
- bool_ okay = FALSE;
- bool_ gold = FALSE;
- bool_ hard = FALSE;
- bool_ soft = FALSE;
+ bool okay = false;
+ bool gold = false;
+ bool hard = false;
+ bool soft = false;
/* Found gold */
if ((c_ptr->feat >= FEAT_MAGMA_H) &&
- (c_ptr->feat <= FEAT_QUARTZ_K)) gold = TRUE;
+ (c_ptr->feat <= FEAT_QUARTZ_K)) gold = true;
if ((c_ptr->feat == FEAT_SANDWALL_H) ||
(c_ptr->feat == FEAT_SANDWALL_K))
{
- gold = TRUE;
- soft = TRUE;
+ gold = true;
+ soft = true;
}
else
/* Extract "quartz" flag XXX XXX XXX */
- if ((c_ptr->feat - FEAT_MAGMA) & 0x01) hard = TRUE;
+ if ((c_ptr->feat - FEAT_MAGMA) & 0x01) hard = true;
/* Quartz */
if (hard)
@@ -1256,7 +1256,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
{
/* Message, continue digging */
msg_print(f_ptr->tunnel);
- more = TRUE;
+ more = true;
}
}
@@ -1276,7 +1276,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
if (rand_int(100) < 10)
{
/* Create a simple object */
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_RUBBLE);
+ place_object(y, x, false, false, OBJ_FOUND_RUBBLE);
/* Observe new object */
if (player_can_see_bold(y, x))
@@ -1290,7 +1290,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
{
/* Message, keep digging */
msg_print(f_ptr->tunnel);
- more = TRUE;
+ more = true;
}
}
@@ -1318,7 +1318,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
/* We may continue tunelling */
msg_print(f_info[feat].tunnel);
- more = TRUE;
+ more = true;
}
}
@@ -1338,7 +1338,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
{
/* We may continue tunelling */
msg_print(f_ptr->tunnel);
- more = TRUE;
+ more = true;
}
}
@@ -1347,7 +1347,7 @@ static bool_ do_cmd_tunnel_aux(int y, int x, int dir)
if (p_ptr->skill_dig < skill_req)
{
msg_print("You fail to make even the slightest of progress.");
- more = FALSE;
+ more = false;
}
else if (p_ptr->skill_dig < skill_req_1pct)
{
@@ -1382,7 +1382,7 @@ void do_cmd_tunnel()
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
if (p_ptr->wild_mode) return;
@@ -1449,9 +1449,9 @@ void do_cmd_tunnel()
*
* Assume there is no monster blocking the destination
*
- * Returns TRUE if repeated commands may continue
+ * Returns true if repeated commands may continue
*/
-static bool_ do_cmd_bash_aux(int y, int x, int dir)
+static bool do_cmd_bash_aux(int y, int x, int dir)
{
auto const &r_info = game->edit_data.r_info;
@@ -1459,7 +1459,7 @@ static bool_ do_cmd_bash_aux(int y, int x, int dir)
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
auto r_ptr = &r_info[p_ptr->body_monster];
@@ -1468,7 +1468,7 @@ static bool_ do_cmd_bash_aux(int y, int x, int dir)
{
msg_print("You cannot do that.");
- return (FALSE);
+ return false;
}
/* Take a turn */
@@ -1526,7 +1526,7 @@ static bool_ do_cmd_bash_aux(int y, int x, int dir)
msg_print("The door holds firm.");
/* Allow repeated bashing */
- more = TRUE;
+ more = true;
}
/* High dexterity yields coolness */
@@ -1566,7 +1566,7 @@ void do_cmd_bash()
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
auto r_ptr = &r_info[p_ptr->body_monster];
@@ -1665,7 +1665,7 @@ void do_cmd_alter()
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
/* Allow repeated command */
@@ -1734,7 +1734,7 @@ void do_cmd_alter()
*
* XXX XXX XXX Let user choose a pile of spikes, perhaps?
*/
-static bool_ get_spike(int *ip)
+static bool get_spike(int *ip)
{
int i;
@@ -1756,12 +1756,12 @@ static bool_ get_spike(int *ip)
(*ip) = i;
/* Success */
- return (TRUE);
+ return true;
}
}
/* Oops */
- return (FALSE);
+ return false;
}
@@ -1844,7 +1844,7 @@ static void do_cmd_walk_jump(int pickup)
int dir;
- bool_ more = FALSE;
+ bool more = false;
/* Allow repeated command */
@@ -1870,7 +1870,7 @@ static void do_cmd_walk_jump(int pickup)
move_player(dir, pickup);
/* Allow more walking */
- more = TRUE;
+ more = true;
}
/* Hack -- In small scale wilderness it takes MUCH more time to move */
@@ -1888,7 +1888,7 @@ static void do_cmd_walk_jump(int pickup)
change_wild_mode();
/* HACk -- set the encouter flag for the wilderness generation */
- generate_encounter = TRUE;
+ generate_encounter = true;
p_ptr->oldpx = MAX_WID / 2;
p_ptr->oldpy = MAX_HGT / 2;
@@ -1910,7 +1910,7 @@ static void do_cmd_unwalk()
cave_type *c_ptr;
- bool_ more = FALSE;
+ bool more = false;
if (!get_rep_dir(&dir)) return;
@@ -1964,7 +1964,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_x--;
p_ptr->oldpy = cur_hgt - 2;
p_ptr->oldpx = cur_wid - 2;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if ((y == 0) && (x == MAX_WID - 1))
@@ -1973,7 +1973,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_x++;
p_ptr->oldpy = cur_hgt - 2;
p_ptr->oldpx = 1;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if ((y == MAX_HGT - 1) && (x == 0))
@@ -1982,7 +1982,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_x--;
p_ptr->oldpy = 1;
p_ptr->oldpx = cur_wid - 2;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if ((y == MAX_HGT - 1) && (x == MAX_WID - 1))
@@ -1991,7 +1991,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_x++;
p_ptr->oldpy = 1;
p_ptr->oldpx = 1;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (y == 0)
@@ -1999,7 +1999,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_y--;
p_ptr->oldpy = cur_hgt - 2;
p_ptr->oldpx = x;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (y == cur_hgt - 1)
@@ -2007,7 +2007,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_y++;
p_ptr->oldpy = 1;
p_ptr->oldpx = x;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (x == 0)
@@ -2015,7 +2015,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_x--;
p_ptr->oldpx = cur_wid - 2;
p_ptr->oldpy = y;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
else if (x == cur_wid - 1)
@@ -2023,7 +2023,7 @@ static void do_cmd_unwalk()
p_ptr->wilderness_x++;
p_ptr->oldpx = 1;
p_ptr->oldpy = y;
- ambush_flag = FALSE;
+ ambush_flag = false;
}
p_ptr->leaving = true;
@@ -2043,7 +2043,7 @@ static void do_cmd_unwalk()
((feat >= FEAT_LESS) && (feat <= FEAT_MORE)))
{
move_player(dir, options->always_pickup);
- more = FALSE;
+ more = false;
}
/* Hack -- Ignore wilderness mofe. */
@@ -2431,7 +2431,7 @@ void do_cmd_fire()
object_type *j_ptr;
- bool_ hit_body = FALSE;
+ bool hit_body = false;
byte missile_attr;
@@ -2510,7 +2510,7 @@ void do_cmd_fire()
/* Describe the object */
- object_desc(o_name, q_ptr, FALSE, 3);
+ object_desc(o_name, q_ptr, false, 3);
/* Find the color and symbol for the object for throwing */
missile_attr = object_attr(q_ptr);
@@ -2579,7 +2579,7 @@ void do_cmd_fire()
handle_stuff();
oldtdam = tdam;
- while (TRUE)
+ while (true)
{
/* Reset after a piercing shot */
tdam = oldtdam;
@@ -2638,7 +2638,7 @@ void do_cmd_fire()
visible = m_ptr->ml;
/* Note the collision */
- hit_body = TRUE;
+ hit_body = true;
/* Did we hit it (penalize range) */
if (test_hit_fire(chance - cur_dis, m_ptr->ac, m_ptr->ml))
@@ -2794,7 +2794,7 @@ void do_cmd_fire()
(magik(45 + get_skill(SKILL_ARCHERY))))
{
num_pierce--;
- hit_body = FALSE;
+ hit_body = false;
/* If target isn't reached, continue moving to target */
if ( !((tx < x && x < bx) || (bx < x && x < tx)) &&
@@ -2859,9 +2859,9 @@ void do_cmd_throw()
object_type *q_ptr;
- bool_ hit_body = FALSE;
+ bool hit_body = false;
- bool_ hit_wall = FALSE;
+ bool hit_wall = false;
byte missile_attr;
@@ -2940,7 +2940,7 @@ void do_cmd_throw()
inc_stack_size(item, -1);
/* Description */
- object_desc(o_name, q_ptr, FALSE, 3);
+ object_desc(o_name, q_ptr, false, 3);
/* Find the color and symbol for the object for throwing */
missile_attr = object_attr(q_ptr);
@@ -3004,7 +3004,7 @@ void do_cmd_throw()
/* Stopped by walls/doors */
if (!cave_floor_bold(ny, nx))
{
- hit_wall = TRUE;
+ hit_wall = true;
break;
}
@@ -3048,7 +3048,7 @@ void do_cmd_throw()
visible = m_ptr->ml;
/* Note the collision */
- hit_body = TRUE;
+ hit_body = true;
/* Did we hit it (penalize range) */
if (test_hit_fire(chance - cur_dis, m_ptr->ac, m_ptr->ml))
@@ -3230,7 +3230,7 @@ void do_cmd_boomerang()
object_type *o_ptr;
- bool_ hit_body = FALSE;
+ bool hit_body = false;
byte missile_attr;
@@ -3261,7 +3261,7 @@ void do_cmd_boomerang()
q_ptr->number = 1;
/* Description */
- object_desc(o_name, q_ptr, FALSE, 3);
+ object_desc(o_name, q_ptr, false, 3);
/* Find the color and symbol for the object for throwing */
missile_attr = object_attr(q_ptr);
@@ -3372,7 +3372,7 @@ void do_cmd_boomerang()
visible = m_ptr->ml;
/* Note the collision */
- hit_body = TRUE;
+ hit_body = true;
/* Did we hit it (penalize range) */
if (test_hit_fire(chance - cur_dis, m_ptr->ac, m_ptr->ml))
@@ -3534,7 +3534,7 @@ void do_cmd_boomerang()
}
-static bool_ tport_vertically(bool_ how)
+static bool tport_vertically(bool how)
{
auto const &d_info = game->edit_data.d_info;
auto const &dungeon_flags = game->dungeon_flags;
@@ -3543,13 +3543,13 @@ static bool_ tport_vertically(bool_ how)
if (p_ptr->inside_quest)
{
msg_print("There is no effect.");
- return (FALSE);
+ return false;
}
if (dungeon_flags & DF_NO_EASY_MOVE)
{
msg_print("Some powerful force prevents you from teleporting.");
- return FALSE;
+ return false;
}
/* Go down */
@@ -3558,7 +3558,7 @@ static bool_ tport_vertically(bool_ how)
if (dun_level >= d_info[dungeon_type].maxdepth)
{
msg_print("The floor is impermeable.");
- return (FALSE);
+ return false;
}
msg_print("You sink through the floor.");
@@ -3570,7 +3570,7 @@ static bool_ tport_vertically(bool_ how)
if (dun_level < d_info[dungeon_type].mindepth)
{
msg_print("There is nothing above you but air.");
- return (FALSE);
+ return false;
}
msg_print("You rise through the ceiling.");
@@ -3578,7 +3578,7 @@ static bool_ tport_vertically(bool_ how)
p_ptr->leaving = true;
}
- return (TRUE);
+ return true;
}
@@ -3596,9 +3596,9 @@ void do_cmd_immovable_special()
int lose_hp = 0;
- bool_ did_act = FALSE;
+ bool did_act = false;
- bool_ did_load = FALSE;
+ bool did_load = false;
if (foo > 1)
@@ -3629,7 +3629,7 @@ void do_cmd_immovable_special()
}
/* Enter "icky" mode */
- character_icky = TRUE;
+ character_icky = true;
/* Save the screen */
Term_save();
@@ -3663,15 +3663,15 @@ void do_cmd_immovable_special()
if (i == 'a')
{
Term_load();
- character_icky = FALSE;
- did_load = TRUE;
+ character_icky = false;
+ did_load = true;
if (!tgt_pt(&ii, &ij)) break;
/* Teleport to the target */
teleport_player_to(ij, ii);
- did_act = TRUE;
+ did_act = true;
break;
}
@@ -3679,14 +3679,14 @@ void do_cmd_immovable_special()
else if (i == 'b')
{
Term_load();
- character_icky = FALSE;
- did_load = TRUE;
+ character_icky = false;
+ did_load = true;
if (!get_aim_dir(&dir)) return;
- fetch(dir, p_ptr->lev * 15, FALSE);
+ fetch(dir, p_ptr->lev * 15, false);
py_pickup_floor(options->always_pickup);
- did_act = TRUE;
+ did_act = true;
break;
}
@@ -3694,12 +3694,12 @@ void do_cmd_immovable_special()
else if (i == 'c')
{
Term_load();
- character_icky = FALSE;
- did_load = TRUE;
+ character_icky = false;
+ did_load = true;
- if (!tport_vertically(FALSE)) return;
+ if (!tport_vertically(false)) return;
- did_act = TRUE;
+ did_act = true;
break;
}
@@ -3707,12 +3707,12 @@ void do_cmd_immovable_special()
else if (i == 'd')
{
Term_load();
- character_icky = FALSE;
- did_load = TRUE;
+ character_icky = false;
+ did_load = true;
- if (!tport_vertically(TRUE)) return;
+ if (!tport_vertically(true)) return;
- did_act = TRUE;
+ did_act = true;
break;
}
@@ -3731,7 +3731,7 @@ void do_cmd_immovable_special()
Term_load();
/* Leave "icky" mode */
- character_icky = FALSE;
+ character_icky = false;
}
/* Apply stat losses if something was done */
@@ -3762,17 +3762,17 @@ static bool item_tester_hook_sacrificable(object_type const *o_ptr)
{
/* Corpses are */
if (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE_CORPSE)
- return (TRUE);
+ return true;
/* Books without any udun spells */
if ((o_ptr->tval == TV_BOOK) && udun_in_book(o_ptr->sval, o_ptr->pval) <= 0)
{
- return TRUE;
+ return true;
}
}
/* Assume not */
- return (FALSE);
+ return false;
}
/*
@@ -3844,7 +3844,7 @@ void do_cmd_sacrifice()
}
if (get_check(fmt::format("Do you want to worship {}? ", deity_info[agod].name)))
{
- follow_god(agod, FALSE);
+ follow_god(agod, false);
p_ptr->grace = -200;
inc_piety(p_ptr->pgod, 0);
}
@@ -3975,7 +3975,7 @@ std::vector<s16b> show_monster_inven(int m_idx)
/* Describe the object */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Hack -- enforce max length */
o_name[lim] = '\0';
@@ -4043,7 +4043,7 @@ void do_cmd_steal()
int dir = 0, item = -1, k = -1;
- bool_ done = FALSE;
+ bool done = false;
/* Only works on adjacent monsters */
if (!get_rep_dir(&dir)) return;
@@ -4099,7 +4099,7 @@ void do_cmd_steal()
{
case ESCAPE:
{
- done = TRUE;
+ done = true;
break;
}
@@ -4123,14 +4123,14 @@ void do_cmd_steal()
/* Verify the item */
if (ver && !verify("Try", -objects[k]))
{
- done = TRUE;
+ done = true;
break;
}
/* Accept that choice */
item = objects[k];
- done = TRUE;
+ done = true;
break;
}
@@ -4205,7 +4205,7 @@ void do_cmd_steal()
{
object_copy(o_ptr, &o_list[item]);
- inven_carry(o_ptr, FALSE);
+ inven_carry(o_ptr, false);
}
/* Delete source item */
diff --git a/src/cmd3.cc b/src/cmd3.cc
index c694e61f..6498d48b 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -57,7 +57,7 @@ void do_cmd_inven()
/* Note that we are in "p_ptr->inventory" mode */
- command_wrk = FALSE;
+ command_wrk = false;
/* Save the screen */
screen_save_no_flush();
@@ -109,7 +109,7 @@ void do_cmd_equip()
/* Note that we are in "equipment" mode */
- command_wrk = TRUE;
+ command_wrk = true;
/* Save the screen */
screen_save_no_flush();
@@ -174,19 +174,19 @@ static bool item_tester_hook_wear(object_type const *o_ptr)
if (object_flags(q_ptr) & TR_ULTIMATE)
{
- return (FALSE);
+ return false;
}
}
}
if ((slot < INVEN_WIELD) || ((p_ptr->body_parts[slot - INVEN_WIELD] == INVEN_WIELD) && (p_ptr->melee_style != SKILL_MASTERY)))
- return (FALSE);
+ return false;
/* Check for a usable slot */
- if (slot >= INVEN_WIELD) return (TRUE);
+ if (slot >= INVEN_WIELD) return true;
/* Assume not wearable */
- return (FALSE);
+ return false;
}
@@ -235,7 +235,7 @@ void do_cmd_wield()
if (cursed_p(&p_ptr->inventory[slot]))
{
/* Describe it */
- object_desc(o_name, &p_ptr->inventory[slot], FALSE, 0);
+ object_desc(o_name, &p_ptr->inventory[slot], false, 0);
/* Message */
msg_format("The %s you are %s appears to be cursed.",
@@ -251,7 +251,7 @@ void do_cmd_wield()
char dummy[512];
/* Describe it */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
strnfmt(dummy, 512, "Really use the %s {cursed}? ", o_name);
if (!(get_check(dummy)))
@@ -275,7 +275,7 @@ void do_cmd_wield()
(flags & TR_MUST2H) &&
(p_ptr->inventory[slot - INVEN_WIELD + INVEN_ARM].k_ptr))
{
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("You cannot wield your %s with a shield.", o_name);
return;
}
@@ -292,7 +292,7 @@ void do_cmd_wield()
i_ptr->k_ptr &&
(p_ptr->body_parts[slot - INVEN_WIELD] == INVEN_ARM))
{
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("You cannot wield your %s with a two-handed weapon.", o_name);
return;
}
@@ -343,7 +343,7 @@ void do_cmd_wield()
if (o_ptr->k_ptr)
{
/* Take off existing item */
- inven_takeoff(slot, 255, FALSE);
+ inven_takeoff(slot, 255, false);
}
}
else
@@ -353,7 +353,7 @@ void do_cmd_wield()
if (!object_similar(o_ptr, q_ptr))
{
/* Take off existing item */
- inven_takeoff(slot, 255, FALSE);
+ inven_takeoff(slot, 255, false);
}
else
{
@@ -400,7 +400,7 @@ void do_cmd_wield()
}
/* Describe the result */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Message */
msg_format("%s %s (%c).", act, o_name, index_to_label(slot));
@@ -415,7 +415,7 @@ void do_cmd_wield()
/* Take care of item sets */
if (o_ptr->name1)
{
- wield_set(o_ptr->name1, a_info[o_ptr->name1].set, FALSE);
+ wield_set(o_ptr->name1, a_info[o_ptr->name1].set, false);
}
/* Recalculate bonuses */
@@ -471,7 +471,7 @@ void do_cmd_takeoff()
energy_use = 50;
/* Take off the item */
- inven_takeoff(item, 255, FALSE);
+ inven_takeoff(item, 255, false);
/* Recalculate hitpoint */
p_ptr->update |= (PU_HP);
@@ -542,7 +542,7 @@ void do_cmd_drop()
energy_use = 50;
/* Drop (some of) the item */
- inven_drop(item, amt, p_ptr->py, p_ptr->px, FALSE);
+ inven_drop(item, amt, p_ptr->py, p_ptr->px, false);
}
@@ -553,14 +553,14 @@ void do_cmd_destroy()
{
int old_number;
- bool_ force = FALSE;
+ bool force = false;
char o_name[80];
char out_val[160];
/* Hack -- force destruction */
- if (command_arg > 0) force = TRUE;
+ if (command_arg > 0) force = true;
/* Get an item */
@@ -591,7 +591,7 @@ void do_cmd_destroy()
/* Describe the object */
old_number = o_ptr->number;
o_ptr->number = amt;
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
o_ptr->number = old_number;
/* Verify unless quantity given */
@@ -679,13 +679,13 @@ void do_cmd_observe()
/* Description */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Describe */
cmsg_format(TERM_L_BLUE, "%s", o_name);
/* Describe it fully */
- if (!object_out_desc(o_ptr, NULL, FALSE, TRUE)) msg_print("You see nothing special.");
+ if (!object_out_desc(o_ptr, NULL, false, true)) msg_print("You see nothing special.");
}
@@ -750,7 +750,7 @@ void do_cmd_inscribe()
/* Describe the activity */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Message */
msg_format("Inscribing %s.", o_name);
@@ -1324,19 +1324,19 @@ void do_cmd_query_symbol()
char buf[128];
- bool_ all = FALSE;
+ bool all = false;
- bool_ uniq = FALSE;
+ bool uniq = false;
- bool_ norm = FALSE;
+ bool norm = false;
- bool_ name = FALSE;
+ bool name = false;
char temp[80] = "";
- bool_ recall = FALSE;
+ bool recall = false;
bool (*sort_by)(int,int) = nullptr;
@@ -1354,22 +1354,22 @@ void do_cmd_query_symbol()
/* Describe */
if (sym == KTRL('A'))
{
- all = TRUE;
+ all = true;
strcpy(buf, "Full monster list.");
}
else if (sym == KTRL('U'))
{
- all = uniq = TRUE;
+ all = uniq = true;
strcpy(buf, "Unique monster list.");
}
else if (sym == KTRL('N'))
{
- all = norm = TRUE;
+ all = norm = true;
strcpy(buf, "Non-unique monster list.");
}
else if (sym == KTRL('M'))
{
- all = name = TRUE;
+ all = name = true;
if (!get_string("Name:", temp, 70)) return;
strnfmt(buf, 128, "Monsters with a name \"%s\"", temp);
strlower(temp);
@@ -1678,9 +1678,9 @@ void cli_add(const char *active, const char *trigger, const char *descr)
/*
* Get a string using CLI completion.
*/
-static bool_ get_string_cli(const char *prompt, char *buf, int len)
+static bool get_string_cli(const char *prompt, char *buf, int len)
{
- bool_ res;
+ bool res;
/* Paranoia XXX XXX XXX */
@@ -1778,14 +1778,14 @@ void do_cmd_cli_help()
void do_cmd_html_dump()
{
char tmp_val[81];
- bool_ html = TRUE;
+ bool html = true;
term_win *save;
/* Save the screen */
save = Term_save_to();
if (wizard && get_check("WIZARD MODE: Do an help file dump?"))
- html = FALSE;
+ html = false;
/* Ask for a file */
if (html)
diff --git a/src/cmd4.cc b/src/cmd4.cc
index b571e36e..f99055f6 100644
--- a/src/cmd4.cc
+++ b/src/cmd4.cc
@@ -504,7 +504,7 @@ static void interact_with_options(std::vector<option_type> const &options, char
/* Interact with the player */
size_t k = 0; /* Currently selected option index */
- while (TRUE)
+ while (true)
{
/* Prompt XXX XXX XXX */
char buf[80];
@@ -581,7 +581,7 @@ static void interact_with_options(std::vector<option_type> const &options, char
{
break;
}
- *(options[k].o_var) = TRUE;
+ *(options[k].o_var) = true;
k = (k + 1) % n;
break;
}
@@ -595,7 +595,7 @@ static void interact_with_options(std::vector<option_type> const &options, char
break;
}
- *(options[k].o_var) = FALSE;
+ *(options[k].o_var) = false;
k = (k + 1) % n;
break;
}
@@ -622,7 +622,7 @@ static void do_cmd_options_cheat(const char *info)
// Interact
interact_with_options(options->cheat_options, info, interaction_mode_t::READ_WRITE);
- // If user toggled any of the options to TRUE, then we add those cheats
+ // If user toggled any of the options to true, then we add those cheats
// to the player's "noscore" flags. Note that it doesn't matter what the
// previous value was -- we don't "unset" noscore flags anyway.
for (auto const &option: options->cheat_options)
@@ -671,7 +671,7 @@ static void do_cmd_options_autosave(const char *info)
Term_clear();
/* Interact with the player */
- while (TRUE)
+ while (true)
{
/* Prompt XXX XXX XXX */
strnfmt(buf, 80,
@@ -744,7 +744,7 @@ static void do_cmd_options_autosave(const char *info)
case 'Y':
case '6':
{
- (*options->autosave_options[k].o_var) = TRUE;
+ (*options->autosave_options[k].o_var) = true;
k = (k + 1) % n;
break;
@@ -754,7 +754,7 @@ static void do_cmd_options_autosave(const char *info)
case 'N':
case '4':
{
- (*options->autosave_options[k].o_var) = FALSE;
+ (*options->autosave_options[k].o_var) = false;
k = (k + 1) % n;
break;
@@ -783,7 +783,7 @@ static void do_cmd_options_autosave(const char *info)
/*
* Interact with some options
*/
-void do_cmd_options_aux(int page, const char *info, bool_ read_only)
+void do_cmd_options_aux(int page, const char *info, bool read_only)
{
// Scrape together all the options from the relevant page.
std::vector<option_type> page_options;
@@ -818,7 +818,7 @@ static void do_cmd_options_win()
char ch;
- bool_ go = TRUE;
+ bool go = true;
u32b old_flag[8];
@@ -899,7 +899,7 @@ static void do_cmd_options_win()
{
case ESCAPE:
{
- go = FALSE;
+ go = false;
break;
}
@@ -1223,7 +1223,7 @@ void do_cmd_options()
case '1':
{
/* Process the general options */
- do_cmd_options_aux(1, "User Interface Options", FALSE);
+ do_cmd_options_aux(1, "User Interface Options", false);
break;
}
@@ -1232,7 +1232,7 @@ void do_cmd_options()
case '2':
{
/* Spawn */
- do_cmd_options_aux(2, "Disturbance Options", FALSE);
+ do_cmd_options_aux(2, "Disturbance Options", false);
break;
}
@@ -1241,7 +1241,7 @@ void do_cmd_options()
case '3':
{
/* Spawn */
- do_cmd_options_aux(3, "Game-Play Options", FALSE);
+ do_cmd_options_aux(3, "Game-Play Options", false);
break;
}
@@ -1250,7 +1250,7 @@ void do_cmd_options()
case '4':
{
/* Spawn */
- do_cmd_options_aux(4, "Efficiency Options", FALSE);
+ do_cmd_options_aux(4, "Efficiency Options", false);
break;
}
@@ -1258,7 +1258,7 @@ void do_cmd_options()
/* ToME Options */
case '5':
{
- do_cmd_options_aux(5, "ToME Options", FALSE);
+ do_cmd_options_aux(5, "ToME Options", false);
break;
}
@@ -1266,7 +1266,7 @@ void do_cmd_options()
/* Birth Options - read only */
case '6':
{
- do_cmd_options_aux(6, "Birth Options(read only)", TRUE);
+ do_cmd_options_aux(6, "Birth Options(read only)", true);
break;
}
@@ -1483,7 +1483,7 @@ static errr macro_dump(const char *fname)
*
* Note that both "flush()" calls are extremely important.
*/
-static void do_cmd_macro_aux(char *buf, bool_ macro_screen)
+static void do_cmd_macro_aux(char *buf, bool macro_screen)
{
int i, n = 0;
@@ -1494,7 +1494,7 @@ static void do_cmd_macro_aux(char *buf, bool_ macro_screen)
flush();
/* Do not process macros */
- inkey_base = TRUE;
+ inkey_base = true;
/* First key */
i = inkey();
@@ -1506,7 +1506,7 @@ static void do_cmd_macro_aux(char *buf, bool_ macro_screen)
buf[n++] = i;
/* Do not process macros */
- inkey_base = TRUE;
+ inkey_base = true;
/* Attempt to read a key */
i = inkey_scan();
@@ -1753,7 +1753,7 @@ void do_cmd_macros()
prt("Trigger: ", 18, 0);
/* Get a macro trigger */
- do_cmd_macro_aux(buf, TRUE);
+ do_cmd_macro_aux(buf, true);
/* Acquire action */
k = macro_find_exact(buf);
@@ -1794,7 +1794,7 @@ void do_cmd_macros()
prt("Trigger: ", 18, 0);
/* Get a macro trigger */
- do_cmd_macro_aux(buf, TRUE);
+ do_cmd_macro_aux(buf, true);
/* Clear */
clear_from(20);
@@ -1829,7 +1829,7 @@ void do_cmd_macros()
prt("Trigger: ", 18, 0);
/* Get a macro trigger */
- do_cmd_macro_aux(buf, TRUE);
+ do_cmd_macro_aux(buf, true);
/* Link the macro */
macro_add(buf, buf);
@@ -2769,7 +2769,7 @@ void do_cmd_load_screen()
byte a = 0;
char c = ' ';
- bool_ okay = TRUE;
+ bool okay = true;
FILE *fff;
@@ -2800,7 +2800,7 @@ void do_cmd_load_screen()
for (y = 0; okay; y++)
{
/* Get a line of data */
- if (my_fgets(fff, buf, 1024)) okay = FALSE;
+ if (my_fgets(fff, buf, 1024)) okay = false;
/* Stop on blank line */
if (!buf[0]) break;
@@ -2826,7 +2826,7 @@ void do_cmd_load_screen()
for (y = 0; okay; y++)
{
/* Get a line of data */
- if (my_fgets(fff, buf, 1024)) okay = FALSE;
+ if (my_fgets(fff, buf, 1024)) okay = false;
/* Stop on blank line */
if (!buf[0]) break;
@@ -2983,7 +2983,7 @@ void do_cmd_knowledge_artifacts()
char base_name[80];
/* Scan the artifacts */
- std::vector<bool_> okay(a_info.size(), FALSE);
+ std::vector<bool> okay(a_info.size(), false);
for (std::size_t k = 0; k < a_info.size(); k++)
{
@@ -2996,7 +2996,7 @@ void do_cmd_knowledge_artifacts()
if (!a_ptr->cur_num) continue;
/* Assume okay */
- okay[k] = TRUE;
+ okay[k] = true;
}
std::unordered_set<int> okayk;
@@ -3043,7 +3043,7 @@ void do_cmd_knowledge_artifacts()
}
else
{
- okay[o_ptr->name1] = FALSE;
+ okay[o_ptr->name1] = false;
}
}
}
@@ -3074,7 +3074,7 @@ void do_cmd_knowledge_artifacts()
}
else
{
- okay[o_ptr->name1] = FALSE;
+ okay[o_ptr->name1] = false;
}
}
}
@@ -3103,7 +3103,7 @@ void do_cmd_knowledge_artifacts()
}
else
{
- okay[o_ptr->name1] = FALSE;
+ okay[o_ptr->name1] = false;
}
}
@@ -3147,7 +3147,7 @@ void do_cmd_knowledge_artifacts()
}
/* Describe the artifact */
- object_desc_store(base_name, q_ptr, FALSE, 0);
+ object_desc_store(base_name, q_ptr, false, 0);
}
/* Hack -- Build the artifact name */
@@ -3175,7 +3175,7 @@ void do_cmd_knowledge_artifacts()
object_prep(q_ptr, k);
/* Describe the artifact */
- object_desc_store(base_name, q_ptr, FALSE, 0);
+ object_desc_store(base_name, q_ptr, false, 0);
/* Hack -- Build the artifact name */
w.write(" The {}\n", base_name);
@@ -3249,7 +3249,7 @@ static void do_cmd_knowledge_uniques()
/* Only print Uniques */
if (r_ptr->flags & RF_UNIQUE)
{
- bool_ dead = (r_ptr->max_num == 0);
+ bool dead = (r_ptr->max_num == 0);
/* Print a message */
if (dead)
@@ -3479,7 +3479,7 @@ static void do_cmd_knowledge_kill_count()
if (r_ptr->flags & RF_UNIQUE)
{
- bool_ dead = (r_ptr->max_num == 0);
+ bool dead = (r_ptr->max_num == 0);
if (dead)
{
@@ -4021,7 +4021,7 @@ void macro_recorder_stop()
prt("Trigger: ", 0, 0);
/* Get a macro trigger */
- do_cmd_macro_aux(buf, FALSE);
+ do_cmd_macro_aux(buf, false);
/* Link the macro */
macro_add(buf, macro.c_str());
diff --git a/src/cmd4.hpp b/src/cmd4.hpp
index fbcfd78b..29f9134b 100644
--- a/src/cmd4.hpp
+++ b/src/cmd4.hpp
@@ -25,4 +25,4 @@ void do_cmd_checkquest();
void do_cmd_change_tactic(int i);
void do_cmd_change_movement(int i);
void do_cmd_time();
-void do_cmd_options_aux(int page, const char *info, bool_ read_only);
+void do_cmd_options_aux(int page, const char *info, bool read_only);
diff --git a/src/cmd5.cc b/src/cmd5.cc
index 1ac508a0..dbf533d3 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -265,7 +265,7 @@ static void do_poly_wounds()
s16b change = damroll(p_ptr->lev, 5);
- bool_ Nasty_effect = (randint(5) == 1);
+ bool Nasty_effect = (randint(5) == 1);
if (!(wounds || hit_p || Nasty_effect)) return;
@@ -319,7 +319,7 @@ void do_poly_self()
}
/* Deformities are discriminated against! */
- dec_stat(A_CHR, randint(6), TRUE);
+ dec_stat(A_CHR, randint(6), true);
if (effect_msg[0])
{
@@ -527,7 +527,7 @@ void fetch(int dir, int wgt, bool require_los)
/* Feedback */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, true, 0);
msg_format("%^s flies through the air to your feet.", o_name);
note_spot(p_ptr->py, p_ptr->px);
@@ -669,7 +669,7 @@ static std::tuple<int, int> choose_monster_power(monster_race const *r_ptr, bool
/* Get a spell from the user */
monster_power const *power = nullptr;
- bool_ flag = FALSE; // Nothing chosen yet
+ bool flag = false; // Nothing chosen yet
while (!flag)
{
/* Show the list */
@@ -729,7 +729,7 @@ static std::tuple<int, int> choose_monster_power(monster_race const *r_ptr, bool
char choice;
if (!get_com(out_val, &choice))
{
- flag = FALSE;
+ flag = false;
break;
}
@@ -754,7 +754,7 @@ static std::tuple<int, int> choose_monster_power(monster_race const *r_ptr, bool
else
{
/* Can't uppercase digits XXX XXX XXX */
- ask = FALSE;
+ ask = false;
i = choice - '0' + 26;
}
@@ -792,7 +792,7 @@ static std::tuple<int, int> choose_monster_power(monster_race const *r_ptr, bool
}
/* Stop the loop */
- flag = TRUE;
+ flag = true;
}
/* Restore the screen */
@@ -840,14 +840,14 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
case SF_MULTIPLY_IDX:
{
- do_cmd_wiz_named_friendly(p_ptr->body_monster, FALSE);
+ do_cmd_wiz_named_friendly(p_ptr->body_monster, false);
break;
}
case SF_S_ANIMAL_IDX:
{
- summon_specific_friendly(y, x, rlev, SUMMON_ANIMAL, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_ANIMAL, true);
break;
}
@@ -1467,7 +1467,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 4; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_ANIMAL, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_ANIMAL, true);
}
break;
@@ -1572,7 +1572,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_THUNDERLORD, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_THUNDERLORD, true);
}
break;
@@ -1585,7 +1585,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
for (int k = 0; k < 6; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_KIN, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_KIN, true);
}
break;
@@ -1595,7 +1595,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_HI_DEMON, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_HI_DEMON, true);
}
break;
@@ -1605,7 +1605,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, 0, TRUE);
+ summon_specific_friendly(y, x, rlev, 0, true);
}
break;
@@ -1615,7 +1615,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 6; k++)
{
- summon_specific_friendly(y, x, rlev, 0, TRUE);
+ summon_specific_friendly(y, x, rlev, 0, true);
}
break;
@@ -1625,7 +1625,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 6; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_ANT, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_ANT, true);
}
break;
@@ -1635,7 +1635,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 6; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_SPIDER, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_SPIDER, true);
}
break;
@@ -1645,7 +1645,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 6; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_HOUND, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_HOUND, true);
}
break;
@@ -1655,7 +1655,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 6; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_HYDRA, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_HYDRA, true);
}
break;
@@ -1665,7 +1665,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_ANGEL, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_ANGEL, true);
}
break;
@@ -1675,7 +1675,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_DEMON, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_DEMON, true);
}
break;
@@ -1685,7 +1685,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_UNDEAD, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_UNDEAD, true);
}
break;
@@ -1695,7 +1695,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 1; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_DRAGON, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_DRAGON, true);
}
break;
@@ -1705,7 +1705,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 8; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_HI_UNDEAD_NO_UNIQUES, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_HI_UNDEAD_NO_UNIQUES, true);
}
break;
@@ -1715,7 +1715,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 8; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_HI_DRAGON_NO_UNIQUES, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_HI_DRAGON_NO_UNIQUES, true);
}
break;
@@ -1725,7 +1725,7 @@ static void apply_monster_power(monster_race const *r_ptr, std::size_t monster_s
{
for (int k = 0; k < 8; k++)
{
- summon_specific_friendly(y, x, rlev, SUMMON_WRAITH, TRUE);
+ summon_specific_friendly(y, x, rlev, SUMMON_WRAITH, true);
}
break;
@@ -1898,7 +1898,7 @@ s32b get_school_spell(const char *do_what, s16b force_book)
int num = 0;
s32b where = 1;
int ask;
- bool_ flag;
+ bool flag;
char out_val[160];
object_type *o_ptr, forge;
int tmp;
@@ -1951,7 +1951,7 @@ s32b get_school_spell(const char *do_what, s16b force_book)
}
/* Nothing chosen yet */
- flag = FALSE;
+ flag = false;
/* Show choices */
window_stuff();
@@ -2000,7 +2000,7 @@ s32b get_school_spell(const char *do_what, s16b force_book)
/* Input */
if (!get_com(out_val, &choice))
{
- flag = FALSE;
+ flag = false;
break;
}
@@ -2042,7 +2042,7 @@ s32b get_school_spell(const char *do_what, s16b force_book)
}
/* Stop the loop */
- flag = TRUE;
+ flag = true;
}
}
}
@@ -2051,7 +2051,7 @@ s32b get_school_spell(const char *do_what, s16b force_book)
/* Require "okay" spells */
if (is_ok_spell(hack_force_spell, hack_force_spell_pval))
{
- flag = TRUE;
+ flag = true;
spell = hack_force_spell;
}
else
@@ -2101,7 +2101,7 @@ void cast_school_spell()
/* Actualy cast the choice */
if (spell != -1)
{
- lua_cast_school_spell(spell, FALSE);
+ lua_cast_school_spell(spell, false);
}
}
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 3aa0cf23..9bb1cc36 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -145,14 +145,14 @@ static select_by_name_t select_object_by_name(std::string const &prompt)
* Determine the effects of eating a corpse. A corpse can be
* eaten whole or cut into pieces for later.
*/
-static void corpse_effect(object_type *o_ptr, bool_ cutting)
+static void corpse_effect(object_type *o_ptr, bool cutting)
{
auto const &r_info = game->edit_data.r_info;
auto r_ptr = &r_info[o_ptr->pval2];
/* Assume no bad effects */
- bool_ harmful = FALSE;
+ bool harmful = false;
byte method, effect, d_dice, d_side;
@@ -240,7 +240,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
{
set_poisoned(p_ptr->poisoned + dam + idam + 10);
- harmful = TRUE;
+ harmful = true;
}
break;
@@ -257,7 +257,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
/* Take damage */
take_hit(dam, "acidic food");
- harmful = TRUE;
+ harmful = true;
}
else
{
@@ -278,7 +278,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
/* Take damage */
take_hit(dam, "a fiery meal");
- harmful = TRUE;
+ harmful = true;
}
else
{
@@ -550,7 +550,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
{
/* Take damage */
acid_dam(brdam, "a gush of acid");
- harmful = TRUE;
+ harmful = true;
}
o_ptr->pval = 1;
}
@@ -571,7 +571,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
{
/* Take damage */
elec_dam(brdam, "an electric shock");
- harmful = TRUE;
+ harmful = true;
}
o_ptr->weight = o_ptr->weight - brpow;
o_ptr->pval = o_ptr->weight;
@@ -593,7 +593,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
{
/* Take damage */
fire_dam(brdam, "an explosion");
- harmful = TRUE;
+ harmful = true;
}
o_ptr->pval = 1;
}
@@ -614,7 +614,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
{
/* Take damage */
cold_dam(brdam, "a chilling blast");
- harmful = TRUE;
+ harmful = true;
}
o_ptr->weight = o_ptr->weight - brpow;
o_ptr->pval = o_ptr->weight;
@@ -644,7 +644,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
take_hit(brdam, "toxic gases");
o_ptr->weight = o_ptr->weight - brpow;
o_ptr->pval = o_ptr->weight;
- harmful = TRUE;
+ harmful = true;
}
/* Nether */
@@ -679,7 +679,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
/* Take damage */
take_hit(brdam, "an unholy blast");
- harmful = TRUE;
+ harmful = true;
o_ptr->weight = o_ptr->weight - brpow;
o_ptr->pval = o_ptr->weight;
}
@@ -783,7 +783,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
/* Take damage */
take_hit(brdam, "an explosion");
- harmful = TRUE;
+ harmful = true;
o_ptr->pval = 1;
}
@@ -802,7 +802,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
/* Take damage */
take_hit(dam, "acidic food");
}
- harmful = TRUE;
+ harmful = true;
}
/*
@@ -816,7 +816,7 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
{
set_poisoned(p_ptr->poisoned + rand_int(15) + 10);
}
- harmful = TRUE;
+ harmful = true;
}
/*
@@ -882,75 +882,75 @@ static void corpse_effect(object_type *o_ptr, bool_ cutting)
}
if (r_ptr->spells & SF_S_THUNDERLORD)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_THUNDERLORD, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_THUNDERLORD, false);
}
if (r_ptr->spells & SF_S_DEMON)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DEMON, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DEMON, false);
}
if (r_ptr->spells & SF_S_KIN)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_KIN, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_KIN, false);
}
if (r_ptr->spells & SF_S_HI_DEMON)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_DEMON, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_DEMON, false);
}
if (r_ptr->spells & SF_S_MONSTER)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, 0, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, 0, false);
}
if (r_ptr->spells & SF_S_MONSTERS)
{
int k;
for (k = 0; k < 8; k++)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, 0, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, 0, false);
}
}
if (r_ptr->spells & SF_S_UNDEAD)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_UNDEAD, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_UNDEAD, false);
}
if (r_ptr->spells & SF_S_DRAGON)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DRAGON, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DRAGON, false);
}
if (r_ptr->spells & SF_S_ANT)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_ANT, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_ANT, false);
}
if (r_ptr->spells & SF_S_SPIDER)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_SPIDER, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_SPIDER, false);
}
if (r_ptr->spells & SF_S_HOUND)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HOUND, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HOUND, false);
}
if (r_ptr->spells & SF_S_HYDRA)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HYDRA, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HYDRA, false);
}
if (r_ptr->spells & SF_S_ANGEL)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_ANGEL, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_ANGEL, false);
}
if (r_ptr->spells & SF_S_HI_DRAGON)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_DRAGON, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_DRAGON, false);
}
if (r_ptr->spells & SF_S_HI_UNDEAD)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_UNDEAD, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_UNDEAD, false);
}
if (r_ptr->spells & SF_S_WRAITH)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_WRAITH, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_WRAITH, false);
}
if (r_ptr->spells & SF_S_UNIQUE)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_UNIQUE, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_UNIQUE, false);
}
}
}
@@ -981,7 +981,7 @@ void do_cmd_eat_food()
object_type *q_ptr, forge;
- bool_ destroy = TRUE;
+ bool destroy = true;
/* Get an item */
int item;
@@ -1167,26 +1167,26 @@ void do_cmd_eat_food()
case SV_FOOD_RESTORE_STR:
{
- do_res_stat(A_STR, TRUE);
+ do_res_stat(A_STR, true);
break;
}
case SV_FOOD_RESTORE_CON:
{
- do_res_stat(A_CON, TRUE);
+ do_res_stat(A_CON, true);
break;
}
case SV_FOOD_RESTORING:
{
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_CHR, true);
break;
}
@@ -1274,7 +1274,7 @@ void do_cmd_eat_food()
q_ptr = &forge;
object_prep(q_ptr, lookup_kind(TV_BOTTLE, 1));
q_ptr->number = 1;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
break;
}
@@ -1307,7 +1307,7 @@ void do_cmd_eat_food()
{
case SV_CORPSE_CORPSE:
{
- bool_ no_meat = FALSE;
+ bool no_meat = false;
/* Not all is edible. Apologies if messy. */
@@ -1316,7 +1316,7 @@ void do_cmd_eat_food()
{
if (o_ptr->weight <= (r_ptr->weight * 3) / 5)
{
- no_meat = TRUE;
+ no_meat = true;
}
}
@@ -1325,7 +1325,7 @@ void do_cmd_eat_food()
{
if (o_ptr->weight <= (r_ptr->weight * 7) / 20)
{
- no_meat = TRUE;
+ no_meat = true;
}
}
@@ -1347,7 +1347,7 @@ void do_cmd_eat_food()
o_ptr->weight -= 10;
/* Corpses still have meat on them */
- destroy = FALSE;
+ destroy = false;
break;
}
@@ -1361,7 +1361,7 @@ void do_cmd_eat_food()
o_ptr->weight -= 10;
/* Corpses still have meat on them */
- destroy = FALSE;
+ destroy = false;
break;
}
@@ -1384,7 +1384,7 @@ void do_cmd_eat_food()
}
}
- corpse_effect(o_ptr, FALSE);
+ corpse_effect(o_ptr, false);
/* Less nutritious than food rations, but much more of it. */
fval = (o_ptr->timeout) ? 2000 : 2500;
@@ -1531,7 +1531,7 @@ void do_cmd_cut_corpse()
msg_print("You hack some meat off the corpse.");
- corpse_effect(o_ptr, TRUE);
+ corpse_effect(o_ptr, true);
/* Get local object */
object_type object_type_body;
@@ -1548,7 +1548,7 @@ void do_cmd_cut_corpse()
if (inven_carry_okay(i_ptr))
{
- inven_carry(i_ptr, TRUE);
+ inven_carry(i_ptr, true);
}
else
{
@@ -1809,12 +1809,12 @@ static void quaff_potion(int tval, int sval, int pval, int pval2)
{
msg_print("Your nerves and muscles feel weak and lifeless!");
take_hit(damroll(10, 10), "a potion of Ruination");
- dec_stat(A_DEX, 25, TRUE);
- dec_stat(A_WIS, 25, TRUE);
- dec_stat(A_CON, 25, TRUE);
- dec_stat(A_STR, 25, TRUE);
- dec_stat(A_CHR, 25, TRUE);
- dec_stat(A_INT, 25, TRUE);
+ dec_stat(A_DEX, 25, true);
+ dec_stat(A_WIS, 25, true);
+ dec_stat(A_CON, 25, true);
+ dec_stat(A_STR, 25, true);
+ dec_stat(A_CHR, 25, true);
+ dec_stat(A_INT, 25, true);
break;
}
@@ -2003,12 +2003,12 @@ static void quaff_potion(int tval, int sval, int pval, int pval2)
set_image(0);
set_stun(0);
set_cut(0);
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_CHR, true);
if (p_ptr->black_breath)
{
msg_print("The hold of the Black Breath on you is broken!");
@@ -2039,37 +2039,37 @@ static void quaff_potion(int tval, int sval, int pval, int pval2)
case SV_POTION_RES_STR:
{
- do_res_stat(A_STR, TRUE);
+ do_res_stat(A_STR, true);
break;
}
case SV_POTION_RES_INT:
{
- do_res_stat(A_INT, TRUE);
+ do_res_stat(A_INT, true);
break;
}
case SV_POTION_RES_WIS:
{
- do_res_stat(A_WIS, TRUE);
+ do_res_stat(A_WIS, true);
break;
}
case SV_POTION_RES_DEX:
{
- do_res_stat(A_DEX, TRUE);
+ do_res_stat(A_DEX, true);
break;
}
case SV_POTION_RES_CON:
{
- do_res_stat(A_CON, TRUE);
+ do_res_stat(A_CON, true);
break;
}
case SV_POTION_RES_CHR:
{
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_CHR, true);
break;
}
@@ -2406,7 +2406,7 @@ static void do_cmd_fill_bottle()
object_prep(q_ptr, lookup_kind(tval, sval));
q_ptr->number = amt;
- inven_carry(q_ptr, TRUE);
+ inven_carry(q_ptr, true);
c_ptr->special2 -= amt;
@@ -2506,7 +2506,7 @@ static void curse_armor()
/* Describe */
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 3);
+ object_desc(o_name, o_ptr, false, 3);
/* Attempt a saving throw for artifacts */
if (artifact_p(o_ptr) && (rand_int(100) < 50))
@@ -2561,7 +2561,7 @@ static void curse_weapon()
/* Describe */
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 3);
+ object_desc(o_name, o_ptr, false, 3);
/* Attempt a saving throw */
if (artifact_p(o_ptr) && (rand_int(100) < 50))
@@ -2665,13 +2665,13 @@ void do_cmd_read_scroll()
energy_use = 100;
/* Assume the scroll will get used up */
- int used_up = TRUE;
+ int used_up = true;
/* Corruption */
if (player_has_corruption(CORRUPT_BALROG_AURA) && magik(5))
{
msg_print("Your demon aura burns the scroll before you read it!");
- used_up = TRUE;
+ used_up = true;
}
/* Scrolls */
@@ -2704,13 +2704,13 @@ void do_cmd_read_scroll()
if (!get_check("Do you really want to leave your body? "
"(beware, it'll be destroyed!) "))
{
- used_up = FALSE;
+ used_up = false;
break;
}
do_cmd_leave_body(false);
- used_up = TRUE;
+ used_up = true;
break;
}
@@ -2718,9 +2718,9 @@ void do_cmd_read_scroll()
/* original didn't set used_up flag ??? -- pelpel */
case SV_SCROLL_RESET_RECALL:
{
- if (!reset_recall(TRUE))
+ if (!reset_recall(true))
{
- used_up = FALSE;
+ used_up = false;
break;
}
@@ -2728,7 +2728,7 @@ void do_cmd_read_scroll()
d_info[p_ptr->recall_dungeon].name.c_str(),
max_dlv[p_ptr->recall_dungeon]);
- used_up = TRUE;
+ used_up = true;
break;
}
@@ -2752,7 +2752,7 @@ void do_cmd_read_scroll()
msg_print(NULL);
msg_print("The scroll disappears in a puff of smoke!");
- fates[i].know = TRUE;
+ fates[i].know = true;
break;
}
@@ -2803,7 +2803,7 @@ void do_cmd_read_scroll()
case SV_SCROLL_SUMMON_MINE:
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_MINE, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_MINE, false);
break;
}
@@ -2838,7 +2838,7 @@ void do_cmd_read_scroll()
{
if ((dungeon_flags & DF_ASK_LEAVE) && !get_check("Leave this unique level forever? "))
{
- used_up = FALSE;
+ used_up = false;
}
else
{
@@ -2870,7 +2870,7 @@ void do_cmd_read_scroll()
{
if (!enchant_spell(0, 0, 1, 0))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2879,7 +2879,7 @@ void do_cmd_read_scroll()
{
if (!enchant_spell(1, 0, 0, 0))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2888,7 +2888,7 @@ void do_cmd_read_scroll()
{
if (!enchant_spell(0, 1, 0, 0))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2897,7 +2897,7 @@ void do_cmd_read_scroll()
{
if (!enchant_spell(0, 0, 0, 1))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2906,7 +2906,7 @@ void do_cmd_read_scroll()
{
if (!enchant_spell(0, 0, randint(3) + 2, 0))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2915,7 +2915,7 @@ void do_cmd_read_scroll()
{
if (!enchant_spell(randint(3), randint(3), 0, 0))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2924,7 +2924,7 @@ void do_cmd_read_scroll()
{
if (!recharge(60))
{
- used_up = FALSE;
+ used_up = false;
}
break;
}
@@ -2996,7 +2996,7 @@ void do_cmd_read_scroll()
if (p_ptr->confusing == 0)
{
msg_print("Your hands begin to glow.");
- p_ptr->confusing = TRUE;
+ p_ptr->confusing = true;
}
break;
@@ -3049,13 +3049,13 @@ void do_cmd_read_scroll()
case SV_SCROLL_ACQUIREMENT:
{
- acquirement(p_ptr->py, p_ptr->px, 1, TRUE);
+ acquirement(p_ptr->py, p_ptr->px, 1, true);
break;
}
case SV_SCROLL_STAR_ACQUIREMENT:
{
- acquirement(p_ptr->py, p_ptr->px, randint(2) + 1, TRUE);
+ acquirement(p_ptr->py, p_ptr->px, randint(2) + 1, true);
break;
}
@@ -3157,7 +3157,7 @@ void do_cmd_read_scroll()
{
if (!artifact_scroll())
{
- used_up = FALSE;
+ used_up = false;
}
break;
@@ -3222,10 +3222,10 @@ void do_cmd_read_scroll()
/* Inscriptions become known upon reading */
if (o_ptr->sval >= 100)
{
- p_ptr->inscriptions[o_ptr->sval - 100] = TRUE;
+ p_ptr->inscriptions[o_ptr->sval - 100] = true;
}
- used_up = FALSE;
+ used_up = false;
}
}
@@ -3272,7 +3272,7 @@ void unset_stick_mode()
/*
* Activate a device
*/
-static void activate_stick(object_type *o_ptr, bool_ *use_charge)
+static void activate_stick(object_type *o_ptr, bool *use_charge)
{
spell_type *spell = spell_at(o_ptr->pval2);
@@ -3285,13 +3285,13 @@ static void activate_stick(object_type *o_ptr, bool_ *use_charge)
switch (ret)
{
case NO_CAST:
- *use_charge = FALSE;
+ *use_charge = false;
break;
case CAST:
- *use_charge = TRUE;
+ *use_charge = true;
break;
default:
- assert(FALSE);
+ assert(false);
}
}
@@ -3305,7 +3305,7 @@ static void activate_stick(object_type *o_ptr, bool_ *use_charge)
*/
void do_cmd_use_staff()
{
- bool_ use_charge;
+ bool use_charge;
/* No magic */
if (p_ptr->antimagic)
@@ -3424,7 +3424,7 @@ void do_cmd_use_staff()
/* Unstack the used item */
o_ptr->number--;
- item = inven_carry(q_ptr, FALSE);
+ item = inven_carry(q_ptr, false);
/* Message */
msg_print("You unstack your staff.");
@@ -3466,7 +3466,7 @@ void do_cmd_use_staff()
*/
void do_cmd_aim_wand()
{
- bool_ use_charge;
+ bool use_charge;
/* No magic */
if (p_ptr->antimagic)
@@ -3675,10 +3675,10 @@ void do_cmd_zap_rod()
int cost;
- bool_ require_dir;
+ bool require_dir;
/* Hack -- let perception get aborted */
- bool_ use_charge = TRUE;
+ bool use_charge = true;
/* No magic */
@@ -3722,7 +3722,7 @@ void do_cmd_zap_rod()
/* Non-directed rods */
if (o_ptr->pval < SV_ROD_MIN_DIRECTION)
{
- require_dir = FALSE;
+ require_dir = false;
}
/* Some rods always require direction */
@@ -3733,13 +3733,13 @@ void do_cmd_zap_rod()
case SV_ROD_HAVOC:
case SV_ROD_HOME:
{
- require_dir = FALSE;
+ require_dir = false;
break;
}
default:
{
- require_dir = TRUE;
+ require_dir = true;
break;
}
}
@@ -3846,7 +3846,7 @@ void do_cmd_zap_rod()
{
if ((dungeon_flags & DF_ASK_LEAVE) && !get_check("Leave this unique level forever? "))
{
- use_charge = FALSE;
+ use_charge = false;
}
else
{
@@ -3896,12 +3896,12 @@ void do_cmd_zap_rod()
case SV_ROD_RESTORATION:
{
restore_level();
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_CHR, true);
break;
}
@@ -4058,7 +4058,7 @@ int ring_of_power()
/* Select power to use */
- while (TRUE)
+ while (true)
{
if (!get_com("[S]ummon a wraith, [R]ule the world or "
"[C]ast a powerful attack? ", &ch))
@@ -4089,7 +4089,7 @@ int ring_of_power()
/* Rewrite this -- pelpel */
if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2),
(plev > 47 ? SUMMON_HI_UNDEAD_NO_UNIQUES : SUMMON_UNDEAD),
- (((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE)))
+ (((plev > 24) && (randint(3) == 1)) ? true : false)))
{
msg_print("Cold winds begin to blow around you, "
"carrying with them the stench of decay...");
@@ -4141,7 +4141,7 @@ int ring_of_power()
/*
* Enchant some bolts
*/
-bool_ brand_bolts()
+bool brand_bolts()
{
int i;
@@ -4170,13 +4170,13 @@ bool_ brand_bolts()
o_ptr->name2 = EGO_FLAME;
/* Apply the ego */
- apply_magic(o_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(o_ptr, dun_level, false, false, false);
/* Enchant */
enchant(o_ptr, rand_int(3) + 4, ENCH_TOHIT | ENCH_TODAM);
/* Notice */
- return (TRUE);
+ return true;
}
/* Flush */
@@ -4186,7 +4186,7 @@ bool_ brand_bolts()
msg_print("The fiery enchantment failed.");
/* Notice */
- return (TRUE);
+ return true;
}
@@ -4236,7 +4236,7 @@ static bool eternal_flame_item_tester_hook(object_type const *o_ptr)
if ((o_ptr->name1 > 0) ||
(o_ptr->name2 > 0))
{
- return FALSE;
+ return false;
}
return (get_eternal_artifact_idx(o_ptr) >= 0);
@@ -4264,7 +4264,7 @@ static bool activate_eternal_flame(int flame_item)
object_type *o_ptr = get_object(item);
o_ptr->name1 = artifact_idx;
- apply_magic(o_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(o_ptr, -1, true, true, true);
o_ptr->found = OBJ_FOUND_SELFMADE;
@@ -4298,12 +4298,12 @@ static void activate_radagast()
{
cmsg_print(TERM_GREEN, "The staff's power cleanses you completely!");
remove_all_curse();
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_CHR, true);
restore_level();
// clean_corruptions(); TODO: Do we want to implement this?
hp_player(5000);
@@ -4464,7 +4464,7 @@ void do_cmd_activate()
/* New mostly unified activation code
This has to be early to allow artifacts to override normal items -- neil */
- if ( activation_aux(o_ptr, TRUE, item) == NULL )
+ if ( activation_aux(o_ptr, true, item) == NULL )
{
/* Window stuff */
p_ptr->window |= (PW_INVEN | PW_EQUIP);
@@ -4507,7 +4507,7 @@ void do_cmd_activate()
msg_print("Oops. That object cannot be activated.");
}
-const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
+const char *activation_aux(object_type * o_ptr, bool doit, int item)
{
auto const &a_info = game->edit_data.a_info;
auto const &e_info = game->edit_data.e_info;
@@ -4517,7 +4517,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
int i = 0, ii = 0, ij = 0, k, dir, dummy = 0;
int chance;
- bool_ is_junkart = (o_ptr->tval == TV_RANDART);
+ bool is_junkart = (o_ptr->tval == TV_RANDART);
int spell = 0;
@@ -4928,7 +4928,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
{
if (!doit) return "summon the Legion of the Dawn every 500+d500 turns";
msg_print("You summon the Legion of the Dawn.");
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DAWN, TRUE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DAWN, true);
o_ptr->timeout = 500 + randint(500);
@@ -5017,7 +5017,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
else
{
if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2),
- SUMMON_THUNDERLORD, (plev == 50 ? TRUE : FALSE)))
+ SUMMON_THUNDERLORD, (plev == 50 ? true : false)))
{
msg_print("A Thunderlord comes from thin air!");
msg_print("'I will help you in your difficult task.'");
@@ -5048,7 +5048,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
msg_print("Your pick twists in your hands.");
if (!get_aim_dir(&dir)) break;
- if (passwall(dir, TRUE))
+ if (passwall(dir, true))
{
msg_print("A passage opens, and you step through.");
}
@@ -5107,7 +5107,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
msg_print("Your horn calls for help.");
for (i = 0; i < 15; i++)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), SUMMON_HUMAN, TRUE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), SUMMON_HUMAN, true);
}
o_ptr->timeout = 1000;
@@ -5679,7 +5679,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_SUMMON_ANIMAL:
{
if (!doit) return "summon animal every 200+d300 turns";
- summon_specific_friendly(p_ptr->py, p_ptr->px, plev, SUMMON_ANIMAL_RANGER, TRUE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, plev, SUMMON_ANIMAL_RANGER, true);
o_ptr->timeout = 200 + randint(300);
@@ -5690,7 +5690,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
{
if (!doit) return "summon phantasmal servant every 200+d200 turns";
msg_print("You summon a phantasmal servant.");
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_PHANTOM, TRUE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_PHANTOM, true);
o_ptr->timeout = 200 + randint(200);
@@ -5711,7 +5711,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
else
{
if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2),
- SUMMON_ELEMENTAL, (plev == 50 ? TRUE : FALSE)))
+ SUMMON_ELEMENTAL, (plev == 50 ? true : false)))
{
msg_print("An elemental materialises...");
msg_print("It seems obedient to you.");
@@ -5737,7 +5737,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
else
{
if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2),
- SUMMON_DEMON, (plev == 50 ? TRUE : FALSE)))
+ SUMMON_DEMON, (plev == 50 ? true : false)))
{
msg_print("The area fills with a stench of sulphur and brimstone.");
msg_print("'What is thy bidding... Master?'");
@@ -5765,7 +5765,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
{
if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2),
(plev > 47 ? SUMMON_HI_UNDEAD_NO_UNIQUES : SUMMON_UNDEAD),
- (((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE)))
+ (((plev > 24) && (randint(3) == 1)) ? true : false)))
{
msg_print("Cold winds begin to blow around you, carrying with them the stench of decay...");
msg_print("Ancient, long-dead forms arise from the ground to serve you!");
@@ -5829,12 +5829,12 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
{
if (!doit) return format("restore stats and life levels every %d turns", (is_junkart ? 200 : 750));
msg_print("It glows a deep green...");
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_CHR, true);
restore_level();
o_ptr->timeout = 750;
@@ -6170,12 +6170,12 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
msg_print("Your nerves and muscles feel weak and lifeless!");
take_hit(damroll(10, 10), "activating Ruination");
- dec_stat(A_DEX, 25, TRUE);
- dec_stat(A_WIS, 25, TRUE);
- dec_stat(A_CON, 25, TRUE);
- dec_stat(A_STR, 25, TRUE);
- dec_stat(A_CHR, 25, TRUE);
- dec_stat(A_INT, 25, TRUE);
+ dec_stat(A_DEX, 25, true);
+ dec_stat(A_WIS, 25, true);
+ dec_stat(A_CON, 25, true);
+ dec_stat(A_STR, 25, true);
+ dec_stat(A_CHR, 25, true);
+ dec_stat(A_INT, 25, true);
/* Timeout is set before return */
@@ -6195,7 +6195,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_UNINT:
{
if (!doit) return "decreasing Intelligence";
- dec_stat(A_INT, 25, FALSE);
+ dec_stat(A_INT, 25, false);
/* Timeout is set before return */
@@ -6205,7 +6205,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_UNSTR:
{
if (!doit) return "decreasing Strength";
- dec_stat(A_STR, 25, FALSE);
+ dec_stat(A_STR, 25, false);
/* Timeout is set before return */
@@ -6215,7 +6215,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_UNCON:
{
if (!doit) return "decreasing Constitution";
- dec_stat(A_CON, 25, FALSE);
+ dec_stat(A_CON, 25, false);
/* Timeout is set before return */
@@ -6225,7 +6225,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_UNCHR:
{
if (!doit) return "decreasing Charisma";
- dec_stat(A_CHR, 25, FALSE);
+ dec_stat(A_CHR, 25, false);
/* Timeout is set before return */
@@ -6235,7 +6235,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_UNDEX:
{
if (!doit) return "decreasing Dexterity";
- dec_stat(A_DEX, 25, FALSE);
+ dec_stat(A_DEX, 25, false);
/* Timeout is set before return */
@@ -6245,7 +6245,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_UNWIS:
{
if (!doit) return "decreasing Wisdom";
- dec_stat(A_WIS, 25, FALSE);
+ dec_stat(A_WIS, 25, false);
/* Timeout is set before return */
@@ -6255,12 +6255,12 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_STATLOSS:
{
if (!doit) return "stat loss";
- dec_stat(A_STR, 15, FALSE);
- dec_stat(A_INT, 15, FALSE);
- dec_stat(A_WIS, 15, FALSE);
- dec_stat(A_DEX, 15, FALSE);
- dec_stat(A_CON, 15, FALSE);
- dec_stat(A_CHR, 15, FALSE);
+ dec_stat(A_STR, 15, false);
+ dec_stat(A_INT, 15, false);
+ dec_stat(A_WIS, 15, false);
+ dec_stat(A_DEX, 15, false);
+ dec_stat(A_CON, 15, false);
+ dec_stat(A_CHR, 15, false);
/* Timeout is set before return */
@@ -6270,12 +6270,12 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_HISTATLOSS:
{
if (!doit) return "high stat loss";
- dec_stat(A_STR, 25, FALSE);
- dec_stat(A_INT, 25, FALSE);
- dec_stat(A_WIS, 25, FALSE);
- dec_stat(A_DEX, 25, FALSE);
- dec_stat(A_CON, 25, FALSE);
- dec_stat(A_CHR, 25, FALSE);
+ dec_stat(A_STR, 25, false);
+ dec_stat(A_INT, 25, false);
+ dec_stat(A_WIS, 25, false);
+ dec_stat(A_DEX, 25, false);
+ dec_stat(A_CON, 25, false);
+ dec_stat(A_CHR, 25, false);
/* Timeout is set before return */
@@ -6405,7 +6405,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_PET_SUMMON:
{
if (!doit) return "summon pet every 101 turns";
- summon_specific_friendly(p_ptr->py, p_ptr->px, max_dlv[dungeon_type], 0, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, max_dlv[dungeon_type], 0, false);
/* Timeout is set before return */
/*FINDME*/
@@ -6541,7 +6541,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
case ACT_ACQUIREMENT:
{
if (!doit) return "acquirement every 3000 turns";
- acquirement(p_ptr->py, p_ptr->px, 1, FALSE);
+ acquirement(p_ptr->py, p_ptr->px, 1, false);
/* Timeout is set before return */
@@ -6636,7 +6636,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
if (c_ptr->m_idx)
{
/* Update the monster */
- update_mon(c_ptr->m_idx, FALSE);
+ update_mon(c_ptr->m_idx, false);
}
/* Redraw */
@@ -7041,7 +7041,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item)
if (!doit) return "grow mushrooms every 50+d50 turns";
msg_print("You twirl and spores fly everywhere!");
for (i = 0; i < 8; i++)
- summon_specific_friendly(p_ptr->py, p_ptr->px, p_ptr->lev, SUMMON_BIZARRE1, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, p_ptr->lev, SUMMON_BIZARRE1, false);
o_ptr->timeout = randint(50) + 50;
diff --git a/src/cmd6.hpp b/src/cmd6.hpp
index ae66d987..2d17c6cf 100644
--- a/src/cmd6.hpp
+++ b/src/cmd6.hpp
@@ -11,7 +11,7 @@ void do_cmd_read_scroll();
void do_cmd_aim_wand();
void do_cmd_use_staff();
void do_cmd_zap_rod();
-const char *activation_aux(object_type *o_ptr, bool_ desc, int item);
+const char *activation_aux(object_type *o_ptr, bool desc, int item);
void do_cmd_activate();
void do_cmd_cut_corpse();
void do_cmd_cure_meat();
diff --git a/src/cmd7.cc b/src/cmd7.cc
index 0539f6b4..ac6ddd29 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -209,12 +209,12 @@ static void display_magic_powers(
/*
* Allow user to choose a magic power.
*
- * If a valid spell is chosen, saves it in '*sn' and returns TRUE
- * If the user hits escape, returns FALSE, and set '*sn' to -1
- * If there are no legal choices, returns FALSE, and sets '*sn' to -2
+ * If a valid spell is chosen, saves it in '*sn' and returns true
+ * If the user hits escape, returns false, and set '*sn' to -1
+ * If there are no legal choices, returns false, and sets '*sn' to -2
*
* The "prompt" should be "cast", "recite", or "study"
- * The "known" should be TRUE for cast/pray, FALSE for study
+ * The "known" should be true for cast/pray, false for study
*
* nb: This function has a (trivial) display bug which will be obvious
* when you run it. It's probably easy to fix but I haven't tried,
@@ -241,7 +241,7 @@ static bool get_magic_power(int *sn, magic_power *powers, int max_powers,
magic_power spell;
- bool_ flag;
+ bool flag;
/* Assume cancelled */
@@ -259,7 +259,7 @@ static bool get_magic_power(int *sn, magic_power *powers, int max_powers,
}
/* Nothing chosen yet */
- flag = FALSE;
+ flag = false;
/* Count number of powers that satisfies minimum plev requirement */
for (i = 0; i < max_powers; i++)
@@ -317,7 +317,7 @@ static bool get_magic_power(int *sn, magic_power *powers, int max_powers,
}
/* Stop the loop */
- flag = TRUE;
+ flag = true;
}
/* Restore the screen */
@@ -721,7 +721,7 @@ void do_cmd_mindcraft()
/* Damage WIS (possibly permanently) */
if (rand_int(100) < 50)
{
- bool_ perm = (rand_int(100) < 25);
+ bool perm = (rand_int(100) < 25);
/* Message */
msg_print("You have damaged your mind!");
@@ -859,11 +859,11 @@ void do_cmd_mimic()
magic_power spell;
- static bool_ added_hooks = FALSE;
+ static bool added_hooks = false;
if(!added_hooks)
{
add_hook_new(HOOK_FORBID_TRAVEL, mimic_forbid_travel, "mimic_forbid_travel", NULL);
- added_hooks = TRUE;
+ added_hooks = true;
}
/* No magic */
@@ -1121,7 +1121,7 @@ void do_cmd_mimic()
/* Damage WIS (possibly permanently) */
if (rand_int(100) < 50)
{
- bool_ perm = (rand_int(100) < 25);
+ bool perm = (rand_int(100) < 25);
/* Message */
msg_print("You have damaged your mind!");
@@ -1168,7 +1168,7 @@ void do_cmd_beastmaster()
/* XXX XXX */
if (rand_int(80-(plev) - p_ptr->stat_use[5]-p_ptr->to_s) < 20)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, plev, rand_int(plev / 2), FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, plev, rand_int(plev / 2), false);
}
}
else msg_print("You can't summon more pets");
@@ -1656,7 +1656,7 @@ void brand_ammo(int brand_type, int bolts_only)
o_ptr->name2 = aura_type;
/* Apply the ego */
- apply_magic(o_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(o_ptr, dun_level, false, false, false);
o_ptr->discount = 100;
enchant(o_ptr, rand_int(3) + 4, ENCH_TOHIT | ENCH_TODAM);
@@ -1677,7 +1677,7 @@ void summon_monster(int sumtype)
/* Take a turn */
energy_use = 100;
- if (summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level + randint(5), sumtype, TRUE))
+ if (summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level + randint(5), sumtype, true))
{
msg_print("You summon some help.");
}
@@ -1714,7 +1714,7 @@ void do_cmd_possessor()
}
- while (TRUE)
+ while (true)
{
if (!get_com("Use your [R]ace powers or your [I]ncarnating powers?", &ch))
{
@@ -1824,7 +1824,7 @@ void do_cmd_archer()
strnfmt(com, 80, "Create [S]hots? ");
}
- while (TRUE)
+ while (true)
{
if (!get_com(com, &ch))
{
@@ -1873,11 +1873,11 @@ void do_cmd_archer()
else
q_ptr->number = 1;
- apply_magic(q_ptr, dun_level, TRUE, TRUE, (magik(20)) ? TRUE : FALSE);
+ apply_magic(q_ptr, dun_level, true, true, (magik(20)) ? true : false);
q_ptr->discount = 90;
q_ptr->found = OBJ_FOUND_SELFMADE;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
msg_print("You make some ammo.");
@@ -1910,7 +1910,7 @@ void do_cmd_archer()
else
q_ptr->number = 1;
- apply_magic(q_ptr, dun_level, TRUE, TRUE, (magik(20)) ? TRUE : FALSE);
+ apply_magic(q_ptr, dun_level, true, true, (magik(20)) ? true : false);
q_ptr->discount = 90;
q_ptr->found = OBJ_FOUND_SELFMADE;
@@ -1918,7 +1918,7 @@ void do_cmd_archer()
inc_stack_size(item, -1);
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
/**********Create bolts*********/
@@ -1944,7 +1944,7 @@ void do_cmd_archer()
else
q_ptr->number = 1;
- apply_magic(q_ptr, dun_level, TRUE, TRUE, (magik(20)) ? TRUE : FALSE);
+ apply_magic(q_ptr, dun_level, true, true, (magik(20)) ? true : false);
q_ptr->discount = 90;
q_ptr->found = OBJ_FOUND_SELFMADE;
@@ -1952,7 +1952,7 @@ void do_cmd_archer()
inc_stack_size(item, -1);
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
}
@@ -1973,7 +1973,7 @@ void do_cmd_set_piercing()
strnfmt(com, 80, "Allow shots to pierce? ");
- while (TRUE)
+ while (true)
{
if (!get_com(com, &ch))
{
@@ -2201,10 +2201,10 @@ void do_cmd_necromancer()
object_type forge, *o_ptr = &forge;
int k_idx = test_item_name("& Necromantic Teeth~");
- k_info[k_idx]->allow_special = TRUE;
+ k_info[k_idx]->allow_special = true;
object_prep(o_ptr, k_idx);
- apply_magic(o_ptr, plev * 2, TRUE, TRUE, TRUE);
+ apply_magic(o_ptr, plev * 2, true, true, true);
o_ptr->art_flags |= TR_TEMPORARY;
o_ptr->timeout = dur;
@@ -2212,9 +2212,9 @@ void do_cmd_necromancer()
/* These objects are "storebought" */
o_ptr->number = 1;
- inven_carry(o_ptr, FALSE);
+ inven_carry(o_ptr, false);
- k_info[k_idx]->allow_special = FALSE;
+ k_info[k_idx]->allow_special = false;
break;
}
@@ -2307,7 +2307,7 @@ void do_cmd_necromancer()
/* Damage CON (possibly permanently) */
if (rand_int(100) < 50)
{
- bool_ perm = (rand_int(100) < 25);
+ bool perm = (rand_int(100) < 25);
/* Message */
msg_print("You have damaged your body!");
@@ -2382,7 +2382,7 @@ void do_cmd_unbeliever()
/* Select what to do */
- while (TRUE)
+ while (true)
{
if (!get_com("Disrupt [C]ontinuum or [D]estroy Doors", &ch))
{
@@ -2480,10 +2480,10 @@ void do_cmd_summoner_extract()
/* Get the item */
object_type *o_ptr = get_object(item);
- bool_ partial;
+ bool partial;
if (r_info[o_ptr->pval2].flags & RF_UNIQUE)
{
- partial = FALSE;
+ partial = false;
}
else
{
@@ -2510,7 +2510,7 @@ void do_cmd_summoner_extract()
q_ptr->pval2 = 0;
q_ptr->number = 1;
q_ptr->found = OBJ_FOUND_SELFMADE;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
msg_print("You extract a totem from the dead corpse.");
energy_use += 100;
@@ -2523,7 +2523,7 @@ void summon_true(int r_idx, int item)
int i, status, x = 1, y = 1, rx, ry = 0, chance;
- bool_ used;
+ bool used;
auto r_ptr = &r_info[r_idx];
@@ -2532,7 +2532,7 @@ void summon_true(int r_idx, int item)
if (r_ptr->flags & RF_UNIQUE)
{
/* Because it's unique, it will always be destroyed */
- used = TRUE;
+ used = true;
/* About twice as hard as non-uniques */
chance = (get_skill(SKILL_SUMMON) * 70 / (r_ptr->level + 1));
@@ -2552,16 +2552,16 @@ void summon_true(int r_idx, int item)
{
if (get_skill(SKILL_SUMMON) == 0)
{
- used = TRUE;
+ used = true;
}
else
{
/* It can be used multiple times */
- used = FALSE;
+ used = false;
/* But it is not 100% sure (note: skill > 0) */
chance = (r_ptr->level * 25 / get_skill(SKILL_SUMMON));
- if (magik(chance)) used = TRUE;
+ if (magik(chance)) used = true;
}
chance = (get_skill(SKILL_SUMMON) * 130 / (r_ptr->level + 1));
@@ -2597,7 +2597,7 @@ void summon_true(int r_idx, int item)
}
/* Summon the monster */
- bypass_r_ptr_max_num = TRUE;
+ bypass_r_ptr_max_num = true;
if (!(i = place_monster_one (y, x, r_idx, 0, 0, status)))
{
msg_print("The summoning fails.");
@@ -2607,7 +2607,7 @@ void summon_true(int r_idx, int item)
m_list[i].status = status;
m_list[i].mflag |= MFLAG_NO_DROP;
}
- bypass_r_ptr_max_num = FALSE;
+ bypass_r_ptr_max_num = false;
/* Destroy the totem if the used flag is set */
if (used)
@@ -2672,10 +2672,10 @@ void do_cmd_summoner_summon()
}
/* Summon the monster */
- bypass_r_ptr_max_num = TRUE;
- place_monster_one_no_drop = TRUE;
+ bypass_r_ptr_max_num = true;
+ place_monster_one_no_drop = true;
m_idx = place_monster_one(y, x, o_ptr->pval, 0, 0, MSTATUS_PET);
- bypass_r_ptr_max_num = FALSE;
+ bypass_r_ptr_max_num = false;
/* Failure. */
if (!m_idx)
@@ -2724,7 +2724,7 @@ void do_cmd_summoner()
}
/* Select what to do */
- while (TRUE)
+ while (true)
{
if (!get_com("[E]xtract a totem, [S]ummon", &ch))
{
@@ -2998,7 +2998,7 @@ void do_cmd_symbiotic()
if (d >= 100) return;
- if ((m_idx = place_monster_one(y, x, o_ptr->pval, 0, FALSE, MSTATUS_PET)) == 0) return;
+ if ((m_idx = place_monster_one(y, x, o_ptr->pval, 0, false, MSTATUS_PET)) == 0) return;
/* Have to be careful here; releasing the symbiote into a
* dungeon with leveled monsters will level the symbiote
@@ -3127,7 +3127,7 @@ void do_cmd_symbiotic()
/* Summon never-moving pet */
case 7:
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_MINE, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_MINE, false);
break;
}
@@ -3186,7 +3186,7 @@ void do_cmd_symbiotic()
/* Damage CON (possibly permanently) */
if (rand_int(100) < 50)
{
- bool_ perm = (rand_int(100) < 25);
+ bool perm = (rand_int(100) < 25);
/* Message */
msg_print("You have damaged your body!");
@@ -3236,7 +3236,7 @@ void do_cmd_create_boulder()
q_ptr->discount = 90;
q_ptr->found = OBJ_FOUND_SELFMADE;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
msg_print("You make some boulders.");
diff --git a/src/corrupt.cc b/src/corrupt.cc
index 41883693..95a29343 100644
--- a/src/corrupt.cc
+++ b/src/corrupt.cc
@@ -52,7 +52,7 @@ static void player_gain_vampire_teeth()
player_race_mod *rmp_ptr = NULL;
- switch_subrace(SUBRACE_SAVE, TRUE);
+ switch_subrace(SUBRACE_SAVE, true);
rmp_ptr = &race_mod_info[SUBRACE_SAVE];
subrace_add_power(rmp_ptr, PWR_VAMPIRISM);
@@ -677,9 +677,9 @@ bool player_has_corruption(int corruption_idx)
return p_ptr->corruptions[corruption_idx];
}
-static bool_ player_can_gain_corruption(int corruption_idx)
+static bool player_can_gain_corruption(int corruption_idx)
{
- bool_ allowed = TRUE; /* Allowed by default */
+ bool allowed = true; /* Allowed by default */
assert(corruption_idx >= 0);
@@ -688,7 +688,7 @@ static bool_ player_can_gain_corruption(int corruption_idx)
/* Ok trolls should not get this one. never. */
if (rp_ptr->title == "Troll")
{
- allowed = FALSE;
+ allowed = false;
}
}
@@ -699,14 +699,14 @@ static bool_ player_can_gain_corruption(int corruption_idx)
if (rp_ptr->title == "Maia")
{
/* We use a whitelist of corruptions for Maiar */
- bool_ allow = FALSE;
+ bool allow = false;
if ((corruption_idx == CORRUPT_BALROG_AURA) ||
(corruption_idx == CORRUPT_BALROG_WINGS) ||
(corruption_idx == CORRUPT_BALROG_STRENGTH) ||
(corruption_idx == CORRUPT_BALROG_FORM) ||
(corruption_idx == CORRUPT_DEMON_BREATH))
{
- allow = TRUE;
+ allow = true;
};
/* Mix result into 'allowed' flag */
@@ -718,10 +718,10 @@ static bool_ player_can_gain_corruption(int corruption_idx)
return allowed;
}
-static bool_ player_allow_corruption(int corruption_idx)
+static bool player_allow_corruption(int corruption_idx)
{
int i;
- bool_ found = FALSE;
+ bool found = false;
corruption_type *c_ptr = NULL;
assert(corruption_idx < CORRUPTIONS_MAX);
@@ -732,13 +732,13 @@ static bool_ player_allow_corruption(int corruption_idx)
{
if (c_ptr->modules[i] == game_module_idx)
{
- found = TRUE;
+ found = true;
}
}
if (!found)
{
- return FALSE;
+ return false;
}
/* Vampire teeth is special */
@@ -746,15 +746,15 @@ static bool_ player_allow_corruption(int corruption_idx)
{
if (race_flags_p(PR_NO_SUBRACE_CHANGE))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
static void player_set_corruption(int c, bool set)
@@ -799,7 +799,7 @@ static void player_lose_corruption(int corruption_idx)
* 3) have none of its opposing corruptions
* 4) pass the possible tests
*/
-static bool_ test_depend_corrupt(s16b corrupt_idx, bool can_gain)
+static bool test_depend_corrupt(s16b corrupt_idx, bool can_gain)
{
s16b i;
corruption_type *c_ptr = NULL;
@@ -813,12 +813,12 @@ static bool_ test_depend_corrupt(s16b corrupt_idx, bool can_gain)
{
if (p_ptr->corruptions[corrupt_idx])
{
- return FALSE;
+ return false;
}
} else {
if (!p_ptr->corruptions[corrupt_idx])
{
- return FALSE;
+ return false;
}
}
@@ -827,7 +827,7 @@ static bool_ test_depend_corrupt(s16b corrupt_idx, bool can_gain)
{
if (!test_depend_corrupt(c_ptr->depends[i], false))
{
- return FALSE;
+ return false;
}
}
@@ -836,7 +836,7 @@ static bool_ test_depend_corrupt(s16b corrupt_idx, bool can_gain)
{
if (test_depend_corrupt(c_ptr->opposes[i], false))
{
- return FALSE;
+ return false;
}
}
@@ -891,7 +891,7 @@ void lose_corruption()
max = 0;
for (i = 0; i < CORRUPTIONS_MAX; i++)
{
- bool_ is_removable = (corruptions[i].lose_text != NULL);
+ bool is_removable = (corruptions[i].lose_text != NULL);
if (test_depend_corrupt(i, false) && is_removable)
{
pos[max] = i;
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 92c0def5..389aa9a4 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -154,7 +154,7 @@ static void pattern_teleport()
/*
- * Returns TRUE if we are on the Straight Road...
+ * Returns true if we are on the Straight Road...
*/
static bool pattern_effect()
{
@@ -172,12 +172,12 @@ static bool pattern_effect()
set_cut(0);
set_blind(0);
set_afraid(0);
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_CHR, true);
restore_level();
hp_player(1000);
cave_set_feat(p_ptr->py, p_ptr->px, FEAT_PATTERN_OLD);
@@ -238,7 +238,7 @@ static void recharged_notice(object_type *o_ptr)
{
/* Describe (briefly) */
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/* Notify the player */
if (o_ptr->number > 1)
@@ -823,9 +823,9 @@ static bool is_light_safe(object_type const *o_ptr)
{
// Get the flags of the object; we don't bother with sets since we're only
// interested in "innate" flags on the light source itself.
- object_flags_no_set = TRUE;
+ object_flags_no_set = true;
auto flags = object_flags(o_ptr);
- object_flags_no_set = FALSE;
+ object_flags_no_set = false;
// We only allow really badly cursed items. This is to provide
// an "out" in case of severely bad luck, but these lights cannot
@@ -1195,10 +1195,10 @@ static void process_world()
{
if ((turn % (static_cast<s32b>(options->autosave_freq) * 10)) == 0)
{
- is_autosave = TRUE;
+ is_autosave = true;
msg_print("Autosaving the game...");
do_cmd_save_game();
- is_autosave = FALSE;
+ is_autosave = false;
}
}
@@ -1288,7 +1288,7 @@ static void process_world()
/* Make a new monster */
if (!(dungeon_flags & DF_NO_NEW_MONSTER))
{
- alloc_monster(MAX_SIGHT + 5, FALSE);
+ alloc_monster(MAX_SIGHT + 5, false);
}
}
@@ -1328,14 +1328,14 @@ static void process_world()
char ouch [80];
/* Get an object description */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("The %s scorches your undead flesh!", o_name);
cave_no_regen = true;
/* Get an object description */
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, true, 0);
sprintf(ouch, "wielding %s", o_name);
take_hit(1, ouch);
@@ -1710,7 +1710,7 @@ static void process_world()
p_ptr->stat_cnt[i]--;
if (p_ptr->stat_cnt[i] == 0)
{
- do_res_stat(i, FALSE);
+ do_res_stat(i, false);
}
}
}
@@ -1775,13 +1775,13 @@ static void process_world()
}
/* No longer a winner */
- total_winner = FALSE;
+ total_winner = false;
/* Leaving */
p_ptr->leaving = true;
/* Note death */
- death = TRUE;
+ death = true;
options->quick_messages = false;
if (get_check("Make a last screenshot? "))
@@ -1830,11 +1830,11 @@ static void process_world()
/* Timed breath */
if (p_ptr->tim_water_breath)
{
- set_tim_breath(p_ptr->tim_water_breath - 1, FALSE);
+ set_tim_breath(p_ptr->tim_water_breath - 1, false);
}
if (p_ptr->tim_magic_breath)
{
- set_tim_breath(p_ptr->tim_magic_breath - 1, TRUE);
+ set_tim_breath(p_ptr->tim_magic_breath - 1, true);
}
/* Timed precognition */
@@ -2618,7 +2618,7 @@ static void process_world()
int my = p_ptr->py + 1;
get_pos_player(5, &my, &mx);
msg_print("Your egg hatches!");
- place_monster_aux(my, mx, o_ptr->pval2, FALSE, FALSE, MSTATUS_PET);
+ place_monster_aux(my, mx, o_ptr->pval2, false, false, MSTATUS_PET);
monster_type *m_ptr = &m_list[cave[my][mx].m_idx];
auto const r_ptr = m_ptr->race();
@@ -2736,7 +2736,7 @@ static void process_world()
my = o_ptr->iy;
get_pos_player(5, &my, &mx);
msg_print("An egg hatches!");
- place_monster_one(my, mx, o_ptr->pval2, 0, FALSE, MSTATUS_ENEMY);
+ place_monster_one(my, mx, o_ptr->pval2, 0, false, MSTATUS_ENEMY);
floor_item_increase(i, -1);
floor_item_describe(i);
floor_item_optimize(i);
@@ -2947,12 +2947,12 @@ static void process_command()
{
if (wizard)
{
- wizard = FALSE;
+ wizard = false;
msg_print("Wizard mode off.");
}
else if (enter_wizard_mode())
{
- wizard = TRUE;
+ wizard = true;
msg_print("Wizard mode on.");
}
@@ -3717,7 +3717,7 @@ static void process_command()
/* Hack -- Save and don't quit */
case KTRL('S'):
{
- is_autosave = FALSE;
+ is_autosave = false;
do_cmd_save_game();
break;
}
@@ -3731,7 +3731,7 @@ static void process_command()
/* Save and quit */
case KTRL('X'):
{
- alive = FALSE;
+ alive = false;
/* Leaving */
p_ptr->leaving = true;
@@ -3964,7 +3964,7 @@ static void process_player()
if (!p_ptr->wild_mode && dun_level == 0)
{
auto &wilderness = game->wilderness;
- wilderness(p_ptr->wilderness_x, p_ptr->wilderness_y).known = TRUE;
+ wilderness(p_ptr->wilderness_x, p_ptr->wilderness_y).known = true;
}
@@ -3990,7 +3990,7 @@ static void process_player()
/* Describe */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Message */
msg_format("You drop %s (%c).", o_name, index_to_label(item));
@@ -4057,7 +4057,7 @@ static void process_player()
* instead of using running commands when s/he follows
* Eru and do the opposite for the other deities -- pelpel
*/
- /* p_ptr->did_nothing = TRUE; */
+ /* p_ptr->did_nothing = true; */
}
/* Repeated command */
@@ -4073,7 +4073,7 @@ static void process_player()
redraw_stuff();
/* Hack -- Assume messages were seen */
- msg_flag = FALSE;
+ msg_flag = false;
/* Clear the top line */
prt("", 0, 0);
@@ -4091,7 +4091,7 @@ static void process_player()
move_cursor_relative(p_ptr->py, p_ptr->px);
/* Get a command (normal) */
- request_command(FALSE);
+ request_command(false);
/* Process the command */
process_command();
@@ -4115,7 +4115,7 @@ static void process_player()
if (!options->avoid_other && shimmer_monsters)
{
/* Clear the flag */
- shimmer_monsters = FALSE;
+ shimmer_monsters = false;
/* Shimmer multi-hued monsters */
for (i = 1; i < m_max; i++)
@@ -4133,7 +4133,7 @@ static void process_player()
if (!(r_ptr->flags & RF_ATTR_MULTI)) continue;
/* Reset the flag */
- shimmer_monsters = TRUE;
+ shimmer_monsters = true;
/* Redraw regardless */
lite_spot(m_ptr->fy, m_ptr->fx);
@@ -4144,7 +4144,7 @@ static void process_player()
if (!options->avoid_other && !options->avoid_shimmer && shimmer_objects)
{
/* Clear the flag */
- shimmer_objects = FALSE;
+ shimmer_objects = false;
/* Shimmer multi-hued objects */
for (i = 1; i < o_max; i++)
@@ -4159,7 +4159,7 @@ static void process_player()
if (!(o_ptr->k_ptr->flags & TR_ATTR_MULTI)) continue;
/* Reset the flag */
- shimmer_objects = TRUE;
+ shimmer_objects = true;
/* Redraw regardless */
lite_spot(o_ptr->iy, o_ptr->ix);
@@ -4205,7 +4205,7 @@ static void process_player()
if (repair_monsters)
{
/* Reset the flag */
- repair_monsters = FALSE;
+ repair_monsters = false;
/* Rotate detection flags */
for (i = 1; i < m_max; i++)
@@ -4235,7 +4235,7 @@ static void process_player()
m_ptr->mflag &= ~(MFLAG_SHOW);
/* Still need repairs */
- repair_monsters = TRUE;
+ repair_monsters = true;
}
/* Remove detection */
@@ -4245,10 +4245,10 @@ static void process_player()
m_ptr->mflag &= ~(MFLAG_MARK);
/* Assume invisible */
- m_ptr->ml = FALSE;
+ m_ptr->ml = false;
/* Update the monster */
- update_mon(i, FALSE);
+ update_mon(i, false);
/* Redraw regardless */
lite_spot(m_ptr->fy, m_ptr->fx);
@@ -4293,7 +4293,7 @@ static void dungeon()
auto const &dungeon_flags = game->dungeon_flags;
/* Reset various flags */
- hack_mind = FALSE;
+ hack_mind = false;
/* Not leaving */
p_ptr->leaving = false;
@@ -4316,9 +4316,9 @@ static void dungeon()
/* Check visual effects */
- shimmer_monsters = TRUE;
- shimmer_objects = TRUE;
- repair_monsters = TRUE;
+ shimmer_monsters = true;
+ shimmer_objects = true;
+ repair_monsters = true;
/* Disturb */
@@ -4339,21 +4339,21 @@ static void dungeon()
/* No stairs down from Quest */
if (is_quest(dun_level) && !p_ptr->astral)
{
- create_down_stair = FALSE;
- create_down_shaft = FALSE;
+ create_down_stair = false;
+ create_down_shaft = false;
}
/* Paranoia -- no stairs from town or wilderness */
- if (!dun_level) create_down_stair = create_up_stair = FALSE;
- if (!dun_level) create_down_shaft = create_up_shaft = FALSE;
+ if (!dun_level) create_down_stair = create_up_stair = false;
+ if (!dun_level) create_down_shaft = create_up_shaft = false;
/* Option -- no connected stairs */
- if (!options->dungeon_stair) create_down_stair = create_up_stair = FALSE;
- if (!options->dungeon_stair) create_down_shaft = create_up_shaft = FALSE;
+ if (!options->dungeon_stair) create_down_stair = create_up_stair = false;
+ if (!options->dungeon_stair) create_down_shaft = create_up_shaft = false;
/* no connecting stairs on special levels */
- if (!(dungeon_flags & DF_NO_STAIR)) create_down_stair = create_up_stair = FALSE;
- if (!(dungeon_flags & DF_NO_STAIR)) create_down_shaft = create_up_shaft = FALSE;
+ if (!(dungeon_flags & DF_NO_STAIR)) create_down_stair = create_up_stair = false;
+ if (!(dungeon_flags & DF_NO_STAIR)) create_down_shaft = create_up_shaft = false;
/* Make a stairway. */
if ((create_up_stair || create_down_stair ||
@@ -4386,8 +4386,8 @@ static void dungeon()
}
/* Cancel the stair request */
- create_down_stair = create_up_stair = FALSE;
- create_down_shaft = create_up_shaft = FALSE;
+ create_down_stair = create_up_stair = false;
+ create_down_shaft = create_up_shaft = false;
}
/* Hack - Assume invalid panel */
@@ -4485,7 +4485,7 @@ static void dungeon()
/* Reset the object generation level */
object_level = dun_level;
- hack_mind = TRUE;
+ hack_mind = true;
/* Mega Hack, if needed wipe all stairs */
if (dungeon_type == DUNGEON_DEATH)
@@ -4520,7 +4520,7 @@ static void dungeon()
}
/* Main loop */
- while (TRUE)
+ while (true)
{
/* Hack -- Compact the monster list occasionally */
if (m_cnt + 32 > max_m_idx) compact_monsters(64);
@@ -4707,13 +4707,13 @@ void play_game(program_args const &args)
int i, tmp_dun;
- bool cheat_death = FALSE;
+ bool cheat_death = false;
/* Initialize player */
p_ptr = new player_type();
/* Hack -- Character is "icky" */
- character_icky = TRUE;
+ character_icky = true;
/* Make sure main term is active */
@@ -4807,12 +4807,12 @@ void play_game(program_args const &args)
Term_fresh();
/* Be sure to not bother the player */
- calc_powers_silent = TRUE;
+ calc_powers_silent = true;
/* Hack -- Enter wizard mode */
if (args.wizard && enter_wizard_mode())
{
- wizard = TRUE;
+ wizard = true;
}
/* Flavor the objects */
@@ -4874,21 +4874,21 @@ void play_game(program_args const &args)
process_hooks_new(HOOK_GAME_START, NULL, NULL);
/* Character is now "complete" */
- character_generated = TRUE;
+ character_generated = true;
/* Hack -- Character is no longer "icky" */
- character_icky = FALSE;
+ character_icky = false;
/* Start game */
- alive = TRUE;
+ alive = true;
/* Hack -- Enforce "delayed death" */
- if (p_ptr->chp < 0) death = TRUE;
+ if (p_ptr->chp < 0) death = true;
/* Process */
- while (TRUE)
+ while (true)
{
/* Save the level */
old_dun_level = dun_level;
@@ -5081,7 +5081,7 @@ void play_game(program_args const &args)
game->died_from = "Cheating death";
/* Do not die */
- death = FALSE;
+ death = false;
/* New depth -KMW- */
/* dun_level = 0; */
diff --git a/src/dungeon_info_type.hpp b/src/dungeon_info_type.hpp
index 60be2578..afee2c52 100644
--- a/src/dungeon_info_type.hpp
+++ b/src/dungeon_info_type.hpp
@@ -43,7 +43,7 @@ struct dungeon_info_type
s16b mindepth = 0; /* Minimal depth */
s16b maxdepth = 0; /* Maximal depth */
- bool_ principal = 0; /* If it's a part of the main dungeon */
+ bool principal = 0; /* If it's a part of the main dungeon */
byte min_plev = 0; /* Minimal plev needed to enter -- it's an anti-cheating mesure */
int min_m_alloc_level = 0; /* Minimal number of monsters per level */
diff --git a/src/fate.hpp b/src/fate.hpp
index 2f501e4b..948adb51 100644
--- a/src/fate.hpp
+++ b/src/fate.hpp
@@ -17,6 +17,6 @@ struct fate
s16b r_idx; /* Monster to find */
s16b count; /* Number of things */
s16b time; /* Turn before */
- bool_ know; /* Has it been predicted? */
- bool_ icky; /* Hackish runtime-only flag */
+ bool know; /* Has it been predicted? */
+ bool icky; /* Hackish runtime-only flag */
};
diff --git a/src/files.cc b/src/files.cc
index a6b28106..a0551b48 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -668,7 +668,7 @@ errr process_pref_file_aux(char *buf)
{
if (option.o_var && equals(option.o_text, buf + 2))
{
- *option.o_var = FALSE;
+ *option.o_var = false;
return 0;
}
}
@@ -681,7 +681,7 @@ errr process_pref_file_aux(char *buf)
{
if (option.o_var && equals(option.o_text, buf + 2))
{
- *option.o_var = TRUE;
+ *option.o_var = true;
return 0;
}
}
@@ -929,7 +929,7 @@ errr process_pref_file(std::string const &name)
errr err = 0;
- bool_ bypass = FALSE;
+ bool bypass = false;
/* Build the filename -- Allow users to override system pref files */
path_build(buf, 1024, ANGBAND_DIR_USER, name.c_str());
@@ -982,7 +982,7 @@ errr process_pref_file(std::string const &name)
v = process_pref_file_expr(&s, &f);
/* Set flag */
- bypass = (equals(v, "0") ? TRUE : FALSE);
+ bypass = (equals(v, "0") ? true : false);
/* Continue */
continue;
@@ -2373,20 +2373,20 @@ std::string describe_player_location()
*
* Figure out if a row on the grid is empty
*/
-static bool_ file_character_print_grid_check_row(const char *buf)
+static bool file_character_print_grid_check_row(const char *buf)
{
- if (strstr(buf + 12, "+")) return TRUE;
- if (strstr(buf + 12, "*")) return TRUE;
- if (strstr(buf + 12, "1")) return TRUE;
- if (strstr(buf + 12, "2")) return TRUE;
- if (strstr(buf + 12, "3")) return TRUE;
- if (strstr(buf + 12, "4")) return TRUE;
- if (strstr(buf + 12, "5")) return TRUE;
- if (strstr(buf + 12, "6")) return TRUE;
- if (strstr(buf + 12, "7")) return TRUE;
- if (strstr(buf + 12, "8")) return TRUE;
- if (strstr(buf + 12, "9")) return TRUE;
- return FALSE;
+ if (strstr(buf + 12, "+")) return true;
+ if (strstr(buf + 12, "*")) return true;
+ if (strstr(buf + 12, "1")) return true;
+ if (strstr(buf + 12, "2")) return true;
+ if (strstr(buf + 12, "3")) return true;
+ if (strstr(buf + 12, "4")) return true;
+ if (strstr(buf + 12, "5")) return true;
+ if (strstr(buf + 12, "6")) return true;
+ if (strstr(buf + 12, "7")) return true;
+ if (strstr(buf + 12, "8")) return true;
+ if (strstr(buf + 12, "9")) return true;
+ return false;
}
/*
@@ -2394,7 +2394,7 @@ static bool_ file_character_print_grid_check_row(const char *buf)
*
* Prints the big ugly grid
*/
-static void file_character_print_grid(FILE *fff, bool_ show_gaps, bool_ show_legend)
+static void file_character_print_grid(FILE *fff, bool show_gaps, bool show_legend)
{
static const char *blank_line = " ";
static char buf[1024];
@@ -2441,9 +2441,9 @@ static void file_character_print_item(FILE *fff, char label, object_type *obj)
static char o_name[80];
static const char *paren = ")";
- object_desc(o_name, obj, TRUE, 3);
+ object_desc(o_name, obj, true, 3);
fprintf(fff, "%c%s %s\n", label, paren, o_name);
- object_out_desc(obj, fff, TRUE, TRUE);
+ object_out_desc(obj, fff, true, true);
}
/*
@@ -2481,7 +2481,7 @@ static void file_character_print_store(FILE *fff, wilderness_type_info const *pl
* was not already there. XXX This is an ugly workaround for the double Gondolin
* problem.
*/
-static bool_ file_character_check_stores(std::unordered_set<store_type *> *seen_stores, wilderness_type_info const *place, int store)
+static bool file_character_check_stores(std::unordered_set<store_type *> *seen_stores, wilderness_type_info const *place, int store)
{
town_type *town = &town_info[place->entrance];
store_type *st_ptr = &town->store[store];
@@ -2489,12 +2489,12 @@ static bool_ file_character_check_stores(std::unordered_set<store_type *> *seen_
// Already seen store?
if (seen_stores->find(st_ptr) != seen_stores->end())
{
- return FALSE;
+ return false;
}
// Add
seen_stores->insert(st_ptr);
- return TRUE;
+ return true;
}
/*
@@ -2682,7 +2682,7 @@ errr file_character(const char *name)
if (r_ptr->flags & RF_UNIQUE)
{
- bool_ dead = (r_ptr->max_num == 0);
+ bool dead = (r_ptr->max_num == 0);
if (dead)
{
Total++;
@@ -2721,19 +2721,19 @@ errr file_character(const char *name)
/* adds and slays */
display_player(1);
- file_character_print_grid(fff, FALSE, TRUE);
+ file_character_print_grid(fff, false, true);
/* sustains and resistances */
display_player(2);
- file_character_print_grid(fff, TRUE, FALSE);
+ file_character_print_grid(fff, true, false);
/* stuff */
display_player(3);
- file_character_print_grid(fff, FALSE, FALSE);
+ file_character_print_grid(fff, false, false);
/* a little bit of stuff */
display_player(4);
- file_character_print_grid(fff, FALSE, FALSE);
+ file_character_print_grid(fff, false, false);
/* Dump corruptions */
fprintf(fff, "\n%s\n", dump_corruptions(false, true).c_str());
@@ -2833,7 +2833,7 @@ errr file_character(const char *name)
/*
* Recursive file perusal.
*
- * Return FALSE on "ESCAPE", otherwise TRUE.
+ * Return false on "ESCAPE", otherwise true.
*
* Process various special text in the input file, including
* the "menu" structures used by the "help file" system.
@@ -2872,7 +2872,7 @@ struct hyperlink
typedef struct hyperlink hyperlink_type;
-static bool_ show_file_aux(const char *name, const char *what, int line)
+static bool show_file_aux(const char *name, const char *what, int line)
{
int i, k, x;
@@ -2891,7 +2891,7 @@ static bool_ show_file_aux(const char *name, const char *what, int line)
byte color = TERM_WHITE;
/* This screen has sub-screens */
- bool_ menu = FALSE;
+ bool menu = false;
/* Current help file */
FILE *fff = NULL;
@@ -2980,12 +2980,12 @@ static bool_ show_file_aux(const char *name, const char *what, int line)
msg_print(NULL);
/* Oops */
- return (TRUE);
+ return true;
}
/* Pre-Parse the file */
- while (TRUE)
+ while (true)
{
/* Read a line or stop */
if (my_fgets(fff, h_ptr->rbuf, 1024)) break;
@@ -3083,7 +3083,7 @@ static bool_ show_file_aux(const char *name, const char *what, int line)
/* Display the file */
- while (TRUE)
+ while (true)
{
/* Clear screen */
Term_clear();
@@ -3106,7 +3106,7 @@ static bool_ show_file_aux(const char *name, const char *what, int line)
/* Oops */
if (!fff)
{
- return (FALSE);
+ return false;
}
/* File has been restarted */
@@ -3447,10 +3447,10 @@ static bool_ show_file_aux(const char *name, const char *what, int line)
my_fclose(fff);
/* Escape */
- if (k == ESCAPE) return (FALSE);
+ if (k == ESCAPE) return false;
/* Normal return */
- return (TRUE);
+ return true;
}
void show_string(const char *lines, const char *title, int line)
@@ -3827,10 +3827,10 @@ void do_cmd_suicide()
}
/* Stop playing */
- alive = FALSE;
+ alive = false;
/* Kill the player */
- death = TRUE;
+ death = true;
/* Leaving */
p_ptr->leaving = true;
@@ -3845,7 +3845,7 @@ void do_cmd_suicide()
* when the game is loaded again
* Alternatively forget_view() and update_view() can be used
*/
-void remove_cave_view(bool_ remove)
+void remove_cave_view(bool remove)
{
int i;
cave_type *c_ptr;
@@ -3874,7 +3874,7 @@ void remove_cave_view(bool_ remove)
*/
void do_cmd_save_game()
{
- remove_cave_view(TRUE);
+ remove_cave_view(true);
/* Save the current level if in a persistent level */
save_dungeon();
@@ -3913,7 +3913,7 @@ void do_cmd_save_game()
prt("Saving game... failed!", 0, 0);
}
- remove_cave_view(FALSE);
+ remove_cave_view(false);
/* Refresh */
Term_fresh();
@@ -3929,10 +3929,10 @@ void autosave_checkpoint()
{
if (options->autosave_l)
{
- is_autosave = TRUE;
+ is_autosave = true;
msg_print("Autosaving the game...");
do_cmd_save_game();
- is_autosave = FALSE;
+ is_autosave = false;
}
}
@@ -3997,7 +3997,7 @@ static long total_points()
if (r_ptr->flags & RF_UNIQUE)
{
- bool_ dead = (r_ptr->max_num == 0);
+ bool dead = (r_ptr->max_num == 0);
if (dead)
{
@@ -4108,7 +4108,7 @@ static void show_info()
prt("Then, hit RETURN to see the character, or ESC to abort.", 22, 0);
/* Dump character records as requested */
- while (TRUE)
+ while (true)
{
char out_val[160];
@@ -4194,7 +4194,7 @@ static void show_info()
prt(tmp_val, j + 2, 4);
/* Display object description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
c_put_str(tval_to_attr[o_ptr->tval], o_name, j + 2, 7);
}
@@ -4840,7 +4840,7 @@ out:
}
-void predict_score_gui(bool_ *initialized_p, bool_ *game_in_progress_p)
+void predict_score_gui(bool *initialized_p, bool *game_in_progress_p)
{
char buf[1024];
int highscore_fd;
@@ -4868,7 +4868,7 @@ void predict_score_gui(bool_ *initialized_p, bool_ *game_in_progress_p)
}
/* Mega-Hack - prevent various functions XXX XXX XXX */
- *initialized_p = FALSE;
+ *initialized_p = false;
/* Save screen */
screen_save();
@@ -4895,7 +4895,7 @@ void predict_score_gui(bool_ *initialized_p, bool_ *game_in_progress_p)
Term_fresh();
/* Mega-Hack - We are ready again */
- *initialized_p = TRUE;
+ *initialized_p = true;
}
@@ -5000,7 +5000,7 @@ void close_game()
/* Hack -- Character is now "icky" */
- character_icky = TRUE;
+ character_icky = true;
/* Handle death */
@@ -5053,7 +5053,7 @@ void close_game()
/* Still alive */
else
{
- is_autosave = FALSE;
+ is_autosave = false;
/* Save the game */
do_cmd_save_game();
diff --git a/src/files.hpp b/src/files.hpp
index 531f088d..e3e8154a 100644
--- a/src/files.hpp
+++ b/src/files.hpp
@@ -42,4 +42,4 @@ std::string process_player_name(std::string const &);
void set_player_base(std::string const &name);
void do_cmd_save_game();
-void predict_score_gui(bool_ *initialized, bool_ *game_in_progress);
+void predict_score_gui(bool *initialized, bool *game_in_progress);
diff --git a/src/generate.cc b/src/generate.cc
index ffb764fd..9c8ec9e6 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -298,10 +298,10 @@ struct dun_data
int col_rooms;
/* Array of which blocks are used */
- bool_ room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL];
+ bool room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL];
/* Hack -- there is a pit/nest on this level */
- bool_ crowded;
+ bool crowded;
};
/*
@@ -425,7 +425,7 @@ static void place_down_stairs(int y, int x)
* Helper function for place_new_way. Determine if y, x is one of
* floor features of the current dungeon
*/
-static bool_ is_safe_floor(int y, int x)
+static bool is_safe_floor(int y, int x)
{
auto const &d_info = game->edit_data.d_info;
@@ -433,12 +433,12 @@ static bool_ is_safe_floor(int y, int x)
byte feat = cave[y][x].feat;
/* One of the legal floor types */
- if (feat == d_ptr->floor1) return (TRUE);
- if (feat == d_ptr->floor2) return (TRUE);
- if (feat == d_ptr->floor3) return (TRUE);
+ if (feat == d_ptr->floor1) return true;
+ if (feat == d_ptr->floor2) return true;
+ if (feat == d_ptr->floor3) return true;
/* Assume non-floor */
- return (FALSE);
+ return false;
}
@@ -453,13 +453,13 @@ void place_new_way(int *y, int *x)
int x0, x1, x2;
int y0, y1, y2;
cave_type *c_ptr;
- bool_ ok;
+ bool ok;
int i, way_n;
byte way_x[MAX_WID], way_y[MAX_WID];
/* Find valid location XXX XXX XXX */
- while (TRUE)
+ while (true)
{
/* A way on vertical edge */
if (rand_int(cur_hgt + cur_wid) < cur_hgt)
@@ -570,17 +570,17 @@ void place_new_way(int *y, int *x)
way_n = 0;
/* Assume bad location */
- ok = FALSE;
+ ok = false;
/* Check if it connects to current dungeon */
while (in_bounds(yy, xx))
{
/* Check grids ahead */
- if (is_safe_floor(yy + y0, xx + x0)) ok = TRUE;
+ if (is_safe_floor(yy + y0, xx + x0)) ok = true;
/* Check side grids */
- if (is_safe_floor(yy + y1, xx + x1)) ok = TRUE;
- if (is_safe_floor(yy + y2, xx + x2)) ok = TRUE;
+ if (is_safe_floor(yy + y1, xx + x1)) ok = true;
+ if (is_safe_floor(yy + y2, xx + x2)) ok = true;
/* Connected */
if (ok) break;
@@ -592,7 +592,7 @@ void place_new_way(int *y, int *x)
if (c_ptr->feat == FEAT_PERM_OUTER)
{
/* Comment this out if you find any problems... */
- ok = TRUE;
+ ok = true;
break;
}
@@ -648,7 +648,7 @@ void place_new_way(int *y, int *x)
way_n++;
}
- ok = TRUE;
+ ok = true;
break;
}
@@ -681,7 +681,7 @@ void place_new_way(int *y, int *x)
/*
* Returns random co-ordinates for player/monster/object
*/
-bool_ new_player_spot(int branch)
+bool new_player_spot(int branch)
{
auto const &dungeon_flags = game->dungeon_flags;
@@ -714,7 +714,7 @@ bool_ new_player_spot(int branch)
}
/* Should be -1, actually if we failed... */
- if (max_attempts < 1) return (FALSE);
+ if (max_attempts < 1) return false;
/* Save the new player grid */
@@ -743,7 +743,7 @@ bool_ new_player_spot(int branch)
}
}
- return (TRUE);
+ return true;
}
@@ -848,7 +848,7 @@ static void place_between(int y, int x)
cave_type *c_ptr = &cave[y][x], *c1_ptr;
int gx, gy;
- while (TRUE)
+ while (true)
{
/* Location */
gy = rand_int(cur_hgt);
@@ -1077,7 +1077,7 @@ static void alloc_object(int set, int typ, int num)
/* Pick a "legal" spot */
while (dummy < SAFE_MAX_ATTEMPTS)
{
- bool_ room;
+ bool room;
dummy++;
@@ -1089,7 +1089,7 @@ static void alloc_object(int set, int typ, int num)
if (!cave_naked_bold(y, x)) continue;
/* Check for "room" */
- room = (cave[y][x].info & (CAVE_ROOM)) ? TRUE : FALSE;
+ room = (cave[y][x].info & (CAVE_ROOM)) ? true : false;
/* Require corridor? */
if ((set == ALLOC_SET_CORR) && room) continue;
@@ -1129,7 +1129,7 @@ static void alloc_object(int set, int typ, int num)
case ALLOC_TYP_OBJECT:
{
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y, x, false, false, OBJ_FOUND_FLOOR);
break;
}
@@ -1466,7 +1466,7 @@ static void build_streamer2(int feat, int killwall)
/* Place streamer into dungeon */
if (poolchance > 2)
{
- while (TRUE)
+ while (true)
{
/* One grid per density */
for (i = 0; i < (DUN_STR_DWLW + 1); i++)
@@ -1663,17 +1663,17 @@ static void destroy_level()
/*
* Function that sees if a square is a floor (Includes range checking)
*/
-static bool_ get_is_floor(int x, int y)
+static bool get_is_floor(int x, int y)
{
auto const &f_info = game->edit_data.f_info;
/* Out of bounds */
- if (!in_bounds(y, x)) return (FALSE);
+ if (!in_bounds(y, x)) return false;
/* Do the real check: */
- if (f_info[cave[y][x].feat].flags & FF_FLOOR) return (TRUE);
+ if (f_info[cave[y][x].feat].flags & FF_FLOOR) return true;
- return (FALSE);
+ return false;
}
@@ -1685,7 +1685,7 @@ static void check_room_boundary(int x1, int y1, int x2, int y2)
auto const &dungeon_flags = game->dungeon_flags;
int count, x, y;
- bool_ old_is_floor, new_is_floor;
+ bool old_is_floor, new_is_floor;
/* Avoid doing this in irrelevant places -- pelpel */
if (!(dungeon_flags & DF_CAVERN)) return;
@@ -1802,7 +1802,7 @@ static void vault_objects(int y, int x, int num)
/* Place an item */
if (rand_int(100) < 75)
{
- place_object(j, k, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(j, k, false, false, OBJ_FOUND_FLOOR);
}
/* Place gold */
@@ -1841,7 +1841,7 @@ static void vault_monsters(int y1, int x1, int num)
/* Place the monster (allow groups) */
monster_level = dun_level + 2;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
}
}
@@ -1857,7 +1857,7 @@ static void vault_monsters(int y1, int x1, int num)
* cx, cy are the returned center of the allocated room in coordinates for
* cave.feat and cave.info etc.
*/
-bool_ room_alloc(int width, int height, bool_ crowded, int by0, int bx0, int *cx, int *cy)
+bool room_alloc(int width, int height, bool crowded, int by0, int bx0, int *cx, int *cy)
{
int temp, eby, ebx, by, bx;
@@ -1868,7 +1868,7 @@ bool_ room_alloc(int width, int height, bool_ crowded, int by0, int bx0, int *cx
for (ebx = bx0 + temp; bx0 > 0 && ebx > dun->col_rooms; bx0--, ebx--);
- if (ebx > dun->col_rooms) return (FALSE);
+ if (ebx > dun->col_rooms) return false;
/* Total number along height */
temp = ((height - 1) / BLOCK_HGT) + 1;
@@ -1876,14 +1876,14 @@ bool_ room_alloc(int width, int height, bool_ crowded, int by0, int bx0, int *cx
for (eby = by0 + temp; by0 > 0 && eby > dun->row_rooms; by0--, eby--);
/* Never run off the screen */
- if (eby > dun->row_rooms) return (FALSE);
+ if (eby > dun->row_rooms) return false;
/* Verify open space */
for (by = by0; by < eby; by++)
{
for (bx = bx0; bx < ebx; bx++)
{
- if (dun->room_map[by][bx]) return (FALSE);
+ if (dun->room_map[by][bx]) return false;
}
}
@@ -1909,12 +1909,12 @@ bool_ room_alloc(int width, int height, bool_ crowded, int by0, int bx0, int *cx
{
for (bx = bx0; bx < ebx; bx++)
{
- dun->room_map[by][bx] = TRUE;
+ dun->room_map[by][bx] = true;
}
}
/* Count "crowded" rooms */
- if (crowded) dun->crowded = TRUE;
+ if (crowded) dun->crowded = true;
/*
* Hack -- See if room will cut off a cavern.
@@ -1925,7 +1925,7 @@ bool_ room_alloc(int width, int height, bool_ crowded, int by0, int bx0, int *cx
*cx + width / 2 + 1, *cy + height / 2 + 1);
/* Success */
- return (TRUE);
+ return true;
}
/*
@@ -1962,7 +1962,7 @@ static void build_type1(int by0, int bx0)
ysize = y1 + y2;
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(xsize + 2, ysize + 2, FALSE, by0, bx0, &xval, &yval)) return;
+ if (!room_alloc(xsize + 2, ysize + 2, false, by0, bx0, &xval, &yval)) return;
/* Get corner values */
y1 = yval - ysize / 2;
@@ -2027,7 +2027,7 @@ static void build_type2(int by0, int bx0)
int y1b, x1b, y2b, x2b;
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(25, 11, FALSE, by0, bx0, &xval, &yval)) return;
+ if (!room_alloc(25, 11, false, by0, bx0, &xval, &yval)) return;
/* Determine extents of the first room */
y1a = yval - randint(4);
@@ -2091,7 +2091,7 @@ static void build_type3(int by0, int bx0)
int yval, xval;
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(25, 11, FALSE, by0, bx0, &xval, &yval)) return;
+ if (!room_alloc(25, 11, false, by0, bx0, &xval, &yval)) return;
/* For now, always 3x3 */
wx = wy = 1;
@@ -2182,7 +2182,7 @@ static void build_type3(int by0, int bx0)
}
/* Place a treasure in the vault */
- place_object(yval, xval, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(yval, xval, false, false, OBJ_FOUND_FLOOR);
/* Let's guard the treasure well */
vault_monsters(yval, xval, rand_int(2) + 3);
@@ -2260,7 +2260,7 @@ static void build_type4(int by0, int bx0)
int y2, x2, tmp, yval, xval;
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(25, 11, FALSE, by0, bx0, &xval, &yval)) return;
+ if (!room_alloc(25, 11, false, by0, bx0, &xval, &yval)) return;
/* Large room */
y1 = yval - 4;
@@ -2368,7 +2368,7 @@ static void build_type4(int by0, int bx0)
/* Object (80%) */
if (rand_int(100) < 80)
{
- place_object(yval, xval, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(yval, xval, false, false, OBJ_FOUND_FLOOR);
}
/* Stairs (20%) */
@@ -2449,8 +2449,8 @@ static void build_type4(int by0, int bx0)
vault_monsters(yval, xval + 2, randint(2));
/* Objects */
- if (rand_int(3) == 0) place_object(yval, xval - 2, FALSE, FALSE, OBJ_FOUND_FLOOR);
- if (rand_int(3) == 0) place_object(yval, xval + 2, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ if (rand_int(3) == 0) place_object(yval, xval - 2, false, false, OBJ_FOUND_FLOOR);
+ if (rand_int(3) == 0) place_object(yval, xval + 2, false, false, OBJ_FOUND_FLOOR);
}
break;
@@ -2734,12 +2734,12 @@ static void build_type5(int by0, int bx0)
int y, x, y1, x1, y2, x2, xval, yval;
int tmp, i;
const char *name;
- bool_ empty = FALSE;
+ bool empty = false;
bool (*old_get_monster_hook)(monster_race const *);
s16b what[64];
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(25, 11, TRUE, by0, bx0, &xval, &yval)) return;
+ if (!room_alloc(25, 11, true, by0, bx0, &xval, &yval)) return;
/* Large room */
y1 = yval - 4;
@@ -2881,7 +2881,7 @@ static void build_type5(int by0, int bx0)
what[i] = get_mon_num(dun_level + 10);
/* Notice failure */
- if (!what[i]) empty = TRUE;
+ if (!what[i]) empty = true;
}
/* Remove restriction */
@@ -2906,7 +2906,7 @@ static void build_type5(int by0, int bx0)
/* (Sometimes) Cause a "special feeling" (for "Monster Nests") */
if ((dun_level <= 40) && (randint(dun_level * dun_level + 50) < 300))
{
- good_item_flag = TRUE;
+ good_item_flag = true;
}
/* Place some monsters */
@@ -2917,7 +2917,7 @@ static void build_type5(int by0, int bx0)
int r_idx = what[rand_int(64)];
/* Place that "random" monster (no groups) */
- place_monster_aux(y, x, r_idx, FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, x, r_idx, false, false, MSTATUS_ENEMY);
}
}
}
@@ -2973,12 +2973,12 @@ static void build_type6(int by0, int bx0)
int tmp, what[16];
int i, j, y, x, y1, x1, y2, x2, xval, yval;
- bool_ empty = FALSE;
+ bool empty = false;
const char *name;
bool (*old_get_monster_hook)(monster_race const *);
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(25, 11, TRUE, by0, bx0, &xval, &yval)) return;
+ if (!room_alloc(25, 11, true, by0, bx0, &xval, &yval)) return;
/* Large room */
y1 = yval - 4;
@@ -3174,7 +3174,7 @@ static void build_type6(int by0, int bx0)
what[i] = get_mon_num(dun_level + 10);
/* Notice failure */
- if (!what[i]) empty = TRUE;
+ if (!what[i]) empty = true;
}
/* Remove restriction */
@@ -3239,57 +3239,57 @@ static void build_type6(int by0, int bx0)
/* (Sometimes) Cause a "special feeling" (for "Monster Pits") */
if ((dun_level <= 40) && (randint(dun_level * dun_level + 50) < 300))
{
- good_item_flag = TRUE;
+ good_item_flag = true;
}
/* Top and bottom rows */
for (x = xval - 9; x <= xval + 9; x++)
{
- place_monster_aux(yval - 2, x, what[0], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(yval + 2, x, what[0], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(yval - 2, x, what[0], false, false, MSTATUS_ENEMY);
+ place_monster_aux(yval + 2, x, what[0], false, false, MSTATUS_ENEMY);
}
/* Middle columns */
for (y = yval - 1; y <= yval + 1; y++)
{
- place_monster_aux(y, xval - 9, what[0], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 9, what[0], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 9, what[0], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 9, what[0], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 8, what[1], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 8, what[1], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 8, what[1], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 8, what[1], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 7, what[1], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 7, what[1], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 7, what[1], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 7, what[1], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 6, what[2], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 6, what[2], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 6, what[2], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 6, what[2], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 5, what[2], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 5, what[2], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 5, what[2], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 5, what[2], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 4, what[3], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 4, what[3], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 4, what[3], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 4, what[3], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 3, what[3], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 3, what[3], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 3, what[3], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 3, what[3], false, false, MSTATUS_ENEMY);
- place_monster_aux(y, xval - 2, what[4], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(y, xval + 2, what[4], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(y, xval - 2, what[4], false, false, MSTATUS_ENEMY);
+ place_monster_aux(y, xval + 2, what[4], false, false, MSTATUS_ENEMY);
}
/* Above/Below the center monster */
for (x = xval - 1; x <= xval + 1; x++)
{
- place_monster_aux(yval + 1, x, what[5], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(yval - 1, x, what[5], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(yval + 1, x, what[5], false, false, MSTATUS_ENEMY);
+ place_monster_aux(yval - 1, x, what[5], false, false, MSTATUS_ENEMY);
}
/* Next to the center monster */
- place_monster_aux(yval, xval + 1, what[6], FALSE, FALSE, MSTATUS_ENEMY);
- place_monster_aux(yval, xval - 1, what[6], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(yval, xval + 1, what[6], false, false, MSTATUS_ENEMY);
+ place_monster_aux(yval, xval - 1, what[6], false, false, MSTATUS_ENEMY);
/* Center monster */
- place_monster_aux(yval, xval, what[7], FALSE, FALSE, MSTATUS_ENEMY);
+ place_monster_aux(yval, xval, what[7], false, false, MSTATUS_ENEMY);
}
/*
@@ -3359,7 +3359,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
{
if (rand_int(100) < 75)
{
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_VAULT);
+ place_object(y, x, false, false, OBJ_FOUND_VAULT);
}
else
{
@@ -3426,7 +3426,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
case '&':
{
monster_level = dun_level + 5;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
break;
}
@@ -3435,7 +3435,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
case '@':
{
monster_level = dun_level + 11;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
break;
}
@@ -3444,10 +3444,10 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
case '9':
{
monster_level = dun_level + 9;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
object_level = dun_level + 7;
- place_object(y, x, TRUE, FALSE, OBJ_FOUND_VAULT);
+ place_object(y, x, true, false, OBJ_FOUND_VAULT);
object_level = dun_level;
break;
}
@@ -3456,10 +3456,10 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
case '8':
{
monster_level = dun_level + 40;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
object_level = dun_level + 20;
- place_object(y, x, TRUE, TRUE, OBJ_FOUND_VAULT);
+ place_object(y, x, true, true, OBJ_FOUND_VAULT);
object_level = dun_level;
break;
}
@@ -3470,13 +3470,13 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
if (rand_int(100) < 50)
{
monster_level = dun_level + 3;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
}
if (rand_int(100) < 50)
{
object_level = dun_level + 7;
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_VAULT);
+ place_object(y, x, false, false, OBJ_FOUND_VAULT);
object_level = dun_level;
}
break;
@@ -3527,7 +3527,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, std::string cons
case 'A':
{
object_level = dun_level + 12;
- place_object(y, x, TRUE, FALSE, OBJ_FOUND_VAULT);
+ place_object(y, x, true, false, OBJ_FOUND_VAULT);
object_level = dun_level;
break;
}
@@ -3590,7 +3590,7 @@ static void build_type7(int by0, int bx0)
/* Try to allocate space for room. If fails, exit */
int xval;
int yval;
- if (!room_alloc(v_ptr->wid, v_ptr->hgt, FALSE, by0, bx0, &xval, &yval))
+ if (!room_alloc(v_ptr->wid, v_ptr->hgt, false, by0, bx0, &xval, &yval))
{
if (options->cheat_room)
{
@@ -3622,7 +3622,7 @@ static void build_type7(int by0, int bx0)
if ((dun_level <= 50) ||
(randint((dun_level - 40) * (dun_level - 40) + 50) < 400))
{
- good_item_flag = TRUE;
+ good_item_flag = true;
}
/* Hack -- Build the vault */
@@ -3656,7 +3656,7 @@ static void build_type8(int by0, int bx0)
/* Try to allocate space for room. If fails, exit */
int xval;
int yval;
- if (!room_alloc(v_ptr->wid, v_ptr->hgt, FALSE, by0, bx0, &xval, &yval))
+ if (!room_alloc(v_ptr->wid, v_ptr->hgt, false, by0, bx0, &xval, &yval))
{
if (options->cheat_room)
{
@@ -3688,7 +3688,7 @@ static void build_type8(int by0, int bx0)
if ((dun_level <= 50) ||
(randint((dun_level - 40) * (dun_level - 40) + 50) < 400))
{
- good_item_flag = TRUE;
+ good_item_flag = true;
}
/* Hack -- Build the vault */
@@ -3711,7 +3711,7 @@ static void build_type9(int by0, int bx0)
rad = 2 + rand_int(8);
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(rad*2 + 1, rad*2 + 1, FALSE, by0, bx0, &x0, &y0)) return;
+ if (!room_alloc(rad*2 + 1, rad*2 + 1, false, by0, bx0, &x0, &y0)) return;
info = (randint(dun_level) <= 5) ? (CAVE_ROOM|CAVE_GLOW) : CAVE_ROOM;
@@ -4012,12 +4012,12 @@ void generate_hmap(int y0, int x0, int xsiz, int ysiz, int grd,
/*
* Convert from height-map back to the normal Angband cave format
*/
-static bool_ hack_isnt_wall(int y, int x, int cutoff)
+static bool hack_isnt_wall(int y, int x, int cutoff)
{
/* Already done */
if (cave[y][x].info & CAVE_ICKY)
{
- return (FALSE);
+ return false;
}
else
@@ -4029,14 +4029,14 @@ static bool_ hack_isnt_wall(int y, int x, int cutoff)
if (cave[y][x].feat <= cutoff)
{
place_floor(y, x);
- return (TRUE);
+ return true;
}
/* If greater than cutoff then is a wall */
else
{
cave_set_feat(y, x, feat_wall_outer);
- return (FALSE);
+ return false;
}
}
}
@@ -4366,7 +4366,7 @@ static void build_type10(int by0, int bx0)
ysize = randint(15) * 2 + 6;
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(xsize + 1, ysize + 1, FALSE, by0, bx0, &x0, &y0)) return;
+ if (!room_alloc(xsize + 1, ysize + 1, false, by0, bx0, &x0, &y0)) return;
bool const light = (dun_level <= randint(25));
@@ -4543,27 +4543,27 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
{
/* Meanest monster + treasure */
monster_level = dun_level + 40;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
object_level = dun_level + 20;
- place_object(y, x, TRUE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y, x, true, false, OBJ_FOUND_FLOOR);
object_level = dun_level;
}
else if (value < 5)
{
/* Mean monster +treasure */
monster_level = dun_level + 20;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
object_level = dun_level + 10;
- place_object(y, x, TRUE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y, x, true, false, OBJ_FOUND_FLOOR);
object_level = dun_level;
}
else if (value < 10)
{
/* Monster */
monster_level = dun_level + 9;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
}
else if (value < 17)
@@ -4582,14 +4582,14 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
/* Object or trap */
if (rand_int(100) < 25)
{
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y, x, false, false, OBJ_FOUND_FLOOR);
}
}
else if (value < 30)
{
/* Monster */
monster_level = dun_level + 5;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
}
else if (value < 40)
@@ -4598,13 +4598,13 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
if (rand_int(100) < 50)
{
monster_level = dun_level + 3;
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
monster_level = dun_level;
}
if (rand_int(100) < 50)
{
object_level = dun_level + 7;
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y, x, false, false, OBJ_FOUND_FLOOR);
object_level = dun_level;
}
}
@@ -4619,7 +4619,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
/* 20% monster, 40% trap, 20% object, 20% blank space */
if (rand_int(100) < 20)
{
- place_monster(y, x, TRUE, TRUE);
+ place_monster(y, x, true, true);
}
else if (rand_int(100) < 50)
{
@@ -4627,7 +4627,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
}
else if (rand_int(100) < 50)
{
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y, x, false, false, OBJ_FOUND_FLOOR);
}
}
@@ -4660,7 +4660,7 @@ static void build_bubble_vault(int x0, int y0, int xsize, int ysize)
int i, j, k, x = 0, y = 0;
u16b min1, min2, temp;
- bool_ done;
+ bool done;
/* Offset from center to top left hand corner */
int xhsize = xsize / 2;
@@ -4677,12 +4677,12 @@ static void build_bubble_vault(int x0, int y0, int xsize, int ysize)
for (i = 1; i < BUBBLENUM; i++)
{
- done = FALSE;
+ done = false;
/* Get center and check to see if it is unique */
for (k = 0; !done && (k < 2000); k++)
{
- done = TRUE;
+ done = true;
x = randint(xsize - 3) + 1;
y = randint(ysize - 3) + 1;
@@ -4690,7 +4690,7 @@ static void build_bubble_vault(int x0, int y0, int xsize, int ysize)
for (j = 0; j < i; j++)
{
/* Rough test to see if there is an overlap */
- if ((x == center[j].x) || (y == center[j].y)) done = FALSE;
+ if ((x == center[j].x) || (y == center[j].y)) done = false;
}
}
@@ -4936,7 +4936,7 @@ static void build_cave_vault(int x0, int y0, int xsiz, int ysiz)
msg_print("Cave Vault");
}
- bool done = FALSE;
+ bool done = false;
while (!done)
{
/* Testing values for these parameters feel free to adjust */
@@ -5095,7 +5095,7 @@ static void build_maze_vault(int x0, int y0, int xsize, int ysize)
int y, x, dy, dx;
int y1, x1, y2, x2;
int m, n, num_vertices;
- bool_ light;
+ bool light;
cave_type *c_ptr;
@@ -5544,13 +5544,13 @@ static void add_outer_wall(int x, int y, int light, int x1, int y1,
else if (cave[y][x].feat == FEAT_WALL_EXTRA)
{
cave[y][x].feat = feat_wall_outer;
- if (light == TRUE) cave[y][x].info |= CAVE_GLOW;
+ if (light == true) cave[y][x].info |= CAVE_GLOW;
}
/* Set bounding walls */
else if (cave[y][x].feat == FEAT_PERM_OUTER)
{
- if (light == TRUE) cave[y][x].info |= CAVE_GLOW;
+ if (light == true) cave[y][x].info |= CAVE_GLOW;
}
}
@@ -5657,7 +5657,7 @@ static void build_target_vault(int x0, int y0, int xsize, int ysize)
}
/* Find visible outer walls and set to be FEAT_OUTER */
- add_outer_wall(x0, y0, FALSE, x0 - rad - 1, y0 - rad - 1,
+ add_outer_wall(x0, y0, false, x0 - rad - 1, y0 - rad - 1,
x0 + rad + 1, y0 + rad + 1);
/* Add inner wall */
@@ -5733,7 +5733,7 @@ static void build_type11(int by0, int bx0)
ysize = randint(11) + 11;
/* Allocate in room_map. If will not fit, exit */
- if (!room_alloc(xsize + 2, ysize + 2, FALSE, by0, bx0, &x0, &y0)) return;
+ if (!room_alloc(xsize + 2, ysize + 2, false, by0, bx0, &x0, &y0)) return;
/*
* Boost the rating -- Higher than lesser vaults and lower than
@@ -5745,7 +5745,7 @@ static void build_type11(int by0, int bx0)
if ((dun_level <= 50) ||
(randint((dun_level - 40) * (dun_level - 40) + 1) < 400))
{
- good_item_flag = TRUE;
+ good_item_flag = true;
}
/* Select type of vault */
@@ -5820,7 +5820,7 @@ static void build_type11(int by0, int bx0)
static void build_type12(int by0, int bx0)
{
int light, rad, x, y, x0, y0;
- bool_ emptyflag = TRUE;
+ bool emptyflag = true;
int h1, h2, h3, h4;
/* Make a random metric */
@@ -5830,12 +5830,12 @@ static void build_type12(int by0, int bx0)
h4 = randint(32) - 16;
/* Occasional light */
- light = (randint(dun_level) <= 5) ? TRUE : FALSE;
+ light = (randint(dun_level) <= 5) ? true : false;
rad = randint(9);
/* Allocate in room_map. If will not fit, exit */
- if (!room_alloc(rad * 2 + 3, rad * 2 + 3, FALSE, by0, bx0, &x0, &y0)) return;
+ if (!room_alloc(rad * 2 + 3, rad * 2 + 3, false, by0, bx0, &x0, &y0)) return;
/* Make floor */
for (x = x0 - rad; x <= x0 + rad; x++)
@@ -5882,7 +5882,7 @@ static void build_type12(int by0, int bx0)
if (!get_is_floor(x, y))
{
/* Wall in the way */
- emptyflag = FALSE;
+ emptyflag = false;
}
}
}
@@ -5893,7 +5893,7 @@ static void build_type12(int by0, int bx0)
build_small_room(x0, y0);
/* Place a treasure in the vault */
- place_object(y0, x0, FALSE, FALSE, OBJ_FOUND_FLOOR);
+ place_object(y0, x0, false, false, OBJ_FOUND_FLOOR);
/* Let's guard the treasure well */
vault_monsters(y0, x0, rand_int(2) + 3);
@@ -5935,7 +5935,7 @@ static void build_type12(int by0, int bx0)
* FEAT_PERM_OUTER -- outer room walls (perma)
* FEAT_PERM_SOLID -- dungeon border (perma)
*/
-static void build_tunnel(int row1, int col1, int row2, int col2, bool_ water)
+static void build_tunnel(int row1, int col1, int row2, int col2, bool water)
{
auto const &d_info = game->edit_data.d_info;
auto const &dungeon_flags = game->dungeon_flags;
@@ -5946,7 +5946,7 @@ static void build_tunnel(int row1, int col1, int row2, int col2, bool_ water)
int start_row, start_col;
int main_loop_count = 0;
- bool_ door_flag = FALSE;
+ bool door_flag = false;
cave_type *c_ptr;
@@ -6092,7 +6092,7 @@ static void build_tunnel(int row1, int col1, int row2, int col2, bool_ water)
}
/* Allow door in next grid */
- door_flag = FALSE;
+ door_flag = false;
}
/* Handle corridor intersections or overlaps */
@@ -6114,7 +6114,7 @@ static void build_tunnel(int row1, int col1, int row2, int col2, bool_ water)
}
/* No door in next grid */
- door_flag = TRUE;
+ door_flag = true;
}
/* Hack -- allow pre-emptive tunnel termination */
@@ -6239,7 +6239,7 @@ static int next_to_corr(int y1, int x1)
*
* Assumes "in_bounds(y,x)"
*/
-static bool_ possible_doorway(int y, int x)
+static bool possible_doorway(int y, int x)
{
auto const &f_info = game->edit_data.f_info;
@@ -6250,19 +6250,19 @@ static bool_ possible_doorway(int y, int x)
if ((f_info[cave[y - 1][x].feat].flags & FF_WALL) &&
(f_info[cave[y + 1][x].feat].flags & FF_WALL))
{
- return (TRUE);
+ return true;
}
/* Check Horizontal */
if ((f_info[cave[y][x - 1].feat].flags & FF_WALL) &&
(f_info[cave[y][x + 1].feat].flags & FF_WALL))
{
- return (TRUE);
+ return true;
}
}
/* No doorway */
- return (FALSE);
+ return false;
}
@@ -6274,7 +6274,7 @@ static void try_doors(int y, int x)
auto const &f_info = game->edit_data.f_info;
auto const &dungeon_flags = game->dungeon_flags;
- bool_ dir_ok[4];
+ bool dir_ok[4];
int i, k, n;
int yy, xx;
@@ -6291,7 +6291,7 @@ static void try_doors(int y, int x)
for (i = 0; i < 4; i++)
{
/* Assume NG */
- dir_ok[i] = FALSE;
+ dir_ok[i] = false;
/* Access location */
yy = y + ddy_ddd[i];
@@ -6310,7 +6310,7 @@ static void try_doors(int y, int x)
if (!possible_doorway(yy, xx)) continue;
/* Accept the direction */
- dir_ok[i] = TRUE;
+ dir_ok[i] = true;
/* Count good spots */
n++;
@@ -6344,11 +6344,11 @@ static void try_doors(int y, int x)
if (n == 4)
{
/* Clear OK flags XXX */
- for (i = 0; i < 4; i++) dir_ok[i] = FALSE;
+ for (i = 0; i < 4; i++) dir_ok[i] = false;
/* Put one or two locked doors */
- dir_ok[rand_int(4)] = TRUE;
- dir_ok[rand_int(4)] = TRUE;
+ dir_ok[rand_int(4)] = true;
+ dir_ok[rand_int(4)] = true;
}
/* A T-shaped intersection or two possible doorways */
@@ -6360,7 +6360,7 @@ static void try_doors(int y, int x)
for (i = 0; i < 4; i++)
{
/* Reject all but k'th OK direction */
- if (dir_ok[i] && (k-- != 0)) dir_ok[i] = FALSE;
+ if (dir_ok[i] && (k-- != 0)) dir_ok[i] = false;
}
}
@@ -6387,13 +6387,13 @@ static void try_doors(int y, int x)
* Note that we restrict the number of "crowded" rooms to reduce
* the chance of overflowing the monster list during level creation.
*/
-static bool_ room_build(int y, int x, int typ)
+static bool room_build(int y, int x, int typ)
{
/* Restrict level */
- if ((dun_level < roomdep[typ]) && !options->ironman_rooms) return (FALSE);
+ if ((dun_level < roomdep[typ]) && !options->ironman_rooms) return false;
/* Restrict "crowded" rooms */
- if (dun->crowded && ((typ == 5) || (typ == 6))) return (FALSE);
+ if (dun->crowded && ((typ == 5) || (typ == 6))) return false;
/* Build a room */
switch (typ)
@@ -6438,17 +6438,17 @@ static bool_ room_build(int y, int x, int typ)
/* Paranoia */
default:
- return (FALSE);
+ return false;
}
/* Success */
- return (TRUE);
+ return true;
}
/*
* Set level boundaries
*/
-static void set_bounders(bool_ empty_level)
+static void set_bounders(bool empty_level)
{
int y, x;
@@ -6498,7 +6498,7 @@ static void set_bounders(bool_ empty_level)
}
/* Needed to refill empty levels */
-static void fill_level(bool_ use_floor, byte smooth);
+static void fill_level(bool use_floor, byte smooth);
/*
* Generate a normal dungeon level
@@ -6513,9 +6513,9 @@ bool level_generate_dungeon()
int max_vault_ok = 2;
- bool_ destroyed = FALSE;
- bool_ empty_level = FALSE;
- bool_ cavern = FALSE;
+ bool destroyed = false;
+ bool empty_level = false;
+ bool cavern = false;
s16b town_level = 0;
/* Is it a town level ? */
@@ -6528,7 +6528,7 @@ bool level_generate_dungeon()
if ((dungeon_flags & DF_EMPTY) ||
(options->empty_levels && (rand_int(EMPTY_LEVEL) == 0)))
{
- empty_level = TRUE;
+ empty_level = true;
if (options->cheat_room || p_ptr->precognition)
{
@@ -6542,7 +6542,7 @@ bool level_generate_dungeon()
/* Possible cavern */
if ((dungeon_flags & DF_CAVERN) && (rand_int(dun_level / 2) > DUN_CAVERN))
{
- cavern = TRUE;
+ cavern = true;
/* Make a large fractal cave in the middle of the dungeon */
if (options->cheat_room)
@@ -6556,17 +6556,17 @@ bool level_generate_dungeon()
/* Possible "destroyed" level */
if ((dun_level > 10) && (rand_int(DUN_DEST) == 0))
{
- destroyed = TRUE;
+ destroyed = true;
}
/* Hack -- No destroyed "quest" levels */
- if (is_quest(dun_level)) destroyed = FALSE;
+ if (is_quest(dun_level)) destroyed = false;
/* Hack -- No destroyed "small" levels */
- if ((cur_wid != MAX_WID) || (cur_hgt != MAX_HGT)) destroyed = FALSE;
+ if ((cur_wid != MAX_WID) || (cur_hgt != MAX_HGT)) destroyed = false;
/* Hack -- No destroyed levels */
- if (dungeon_flags & DF_NO_DESTROY) destroyed = FALSE;
+ if (dungeon_flags & DF_NO_DESTROY) destroyed = false;
/* Actual maximum number of rooms on this level */
dun->row_rooms = cur_hgt / BLOCK_HGT;
@@ -6578,12 +6578,12 @@ bool level_generate_dungeon()
{
for (x = 0; x < dun->col_rooms; x++)
{
- dun->room_map[y][x] = FALSE;
+ dun->room_map[y][x] = false;
}
}
/* No "crowded" rooms yet */
- dun->crowded = FALSE;
+ dun->crowded = false;
/* No rooms yet */
dun->cent_n = 0;
@@ -6773,7 +6773,7 @@ bool level_generate_dungeon()
for (i = 0; i < dun->cent_n; i++)
{
/* Connect the room to the previous room */
- build_tunnel(dun->cent[i].y, dun->cent[i].x, y, x, FALSE);
+ build_tunnel(dun->cent[i].y, dun->cent[i].x, y, x, false);
/* Remember the "previous" room */
y = dun->cent[i].y;
@@ -6860,7 +6860,7 @@ bool level_generate_dungeon()
if (dungeon_flags & DF_WATER_RIVERS)
{
int max = 3 + rand_int(2);
- bool_ said = FALSE;
+ bool said = false;
for (i = 0; i < max; i++)
{
@@ -6871,7 +6871,7 @@ bool level_generate_dungeon()
{
msg_print("Rivers of water.");
}
- said = TRUE;
+ said = true;
}
}
}
@@ -6879,7 +6879,7 @@ bool level_generate_dungeon()
if (dungeon_flags & DF_LAVA_RIVERS)
{
int max = 2 + rand_int(2);
- bool_ said = FALSE;
+ bool said = false;
for (i = 0; i < max; i++)
{
@@ -6890,7 +6890,7 @@ bool level_generate_dungeon()
{
msg_print("Rivers of lava.");
}
- said = TRUE;
+ said = true;
}
}
}
@@ -7140,7 +7140,7 @@ static void init_feat_info()
/*
* Fill a level with wall type specified in A: or L: line of d_info.txt
*
- * 'use_floor', when it is TRUE, tells the function to use floor type
+ * 'use_floor', when it is true, tells the function to use floor type
* terrains (L:) instead of walls (A:).
*
* Filling behaviour can be controlled by the second parameter 'smooth',
@@ -7172,7 +7172,7 @@ static void init_feat_info()
*/
#define MAX_SHIFTS 14
-static void fill_level(bool_ use_floor, byte smooth)
+static void fill_level(bool use_floor, byte smooth)
{
auto const &d_info = game->edit_data.d_info;
@@ -7263,7 +7263,7 @@ static void fill_level(bool_ use_floor, byte smooth)
/* Repeat subdivision until all the grids are filled in */
while ((step = step >> 1) > 0)
{
- bool_ y_even, x_even;
+ bool y_even, x_even;
s16b y_wrap, x_wrap;
s16b y_sel, x_sel;
u32b selector = 0;
@@ -7439,7 +7439,7 @@ static bool cave_gen()
int max_vault_ok = 2;
- bool_ empty_level = FALSE;
+ bool empty_level = false;
dun_data dun_body;
@@ -7562,7 +7562,7 @@ static bool cave_gen()
/* Put some monsters in the dungeon */
for (i = i + k; i > 0; i--)
{
- alloc_monster(0, TRUE);
+ alloc_monster(0, true);
}
}
@@ -7579,7 +7579,7 @@ static bool cave_gen()
if ((!fates[i].serious) && (randint(2) != 1)) continue;
/* Player meets his/her fate now... */
- fate_flag = TRUE;
+ fate_flag = true;
switch (fates[i].fate)
{
@@ -7596,7 +7596,7 @@ static bool cave_gen()
object_prep(q_ptr, fates[i].o_idx);
/* Mega-Hack */
- apply_magic(q_ptr, dun_level, TRUE, TRUE, fates[i].serious);
+ apply_magic(q_ptr, dun_level, true, true, fates[i].serious);
get_pos_player(10, &oy, &ox);
@@ -7604,7 +7604,7 @@ static bool cave_gen()
drop_near(q_ptr, -1, oy, ox);
/* Make it icky */
- fates[i].icky = TRUE;
+ fates[i].icky = true;
break;
}
case FATE_FIND_R:
@@ -7616,7 +7616,7 @@ static bool cave_gen()
place_monster_one(oy, ox, fates[i].r_idx, 0, fates[i].serious, MSTATUS_ENEMY);
- fates[i].icky = TRUE;
+ fates[i].icky = true;
break;
}
case FATE_FIND_A:
@@ -7688,13 +7688,13 @@ static bool cave_gen()
/* Save the name */
q_ptr->name1 = fates[i].a_idx;
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
/* Drop the artifact from heaven */
drop_near(q_ptr, -1, oy, ox);
}
- fates[i].icky = TRUE;
+ fates[i].icky = true;
break;
}
}
@@ -7707,12 +7707,12 @@ static bool cave_gen()
{
case FATE_FIND_A:
{
- if (a_info[fates[i].a_idx].cur_num == 1) fates[i].icky = TRUE;
+ if (a_info[fates[i].a_idx].cur_num == 1) fates[i].icky = true;
break;
}
case FATE_FIND_R:
{
- if ((r_info[fates[i].r_idx].cur_num == 1) && (r_info[fates[i].r_idx].flags & RF_UNIQUE)) fates[i].icky = TRUE;
+ if ((r_info[fates[i].r_idx].cur_num == 1) && (r_info[fates[i].r_idx].flags & RF_UNIQUE)) fates[i].icky = true;
break;
}
}
@@ -7765,9 +7765,9 @@ static bool cave_gen()
}
/* Place the guardian */
- m_allow_special[d_ptr->final_guardian] = TRUE;
- place_monster_one(oy, ox, d_ptr->final_guardian, 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[d_ptr->final_guardian] = FALSE;
+ m_allow_special[d_ptr->final_guardian] = true;
+ place_monster_one(oy, ox, d_ptr->final_guardian, 0, false, MSTATUS_ENEMY);
+ m_allow_special[d_ptr->final_guardian] = false;
m_idx = cave[oy][ox].m_idx;
@@ -7791,7 +7791,7 @@ static bool cave_gen()
/* Proceed only if there's an object slot available */
if (o_idx)
{
- a_allow_special[d_ptr->final_artifact] = TRUE;
+ a_allow_special[d_ptr->final_artifact] = true;
/* Get local object */
q_ptr = &forge;
@@ -7809,7 +7809,7 @@ static bool cave_gen()
q_ptr->name1 = d_ptr->final_artifact;
/* Actually create it */
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
/* Where it is found ? */
q_ptr->found = OBJ_FOUND_MONSTER;
@@ -7818,7 +7818,7 @@ static bool cave_gen()
q_ptr->found_aux3 = dungeon_type;
q_ptr->found_aux4 = level_or_feat(dungeon_type, dun_level);
- a_allow_special[d_ptr->final_artifact] = FALSE;
+ a_allow_special[d_ptr->final_artifact] = false;
/* Get the item */
o_ptr = &o_list[o_idx];
@@ -7839,7 +7839,7 @@ static bool cave_gen()
{
auto k_ptr = k_info.at(d_ptr->final_object);
- if (k_ptr->artifact == FALSE)
+ if (k_ptr->artifact == false)
{
/* Get new object */
int o_idx = o_pop();
@@ -7851,14 +7851,14 @@ static bool cave_gen()
object_type forge;
object_type *q_ptr = &forge;
- k_info[d_ptr->final_object]->allow_special = TRUE;
+ k_info[d_ptr->final_object]->allow_special = true;
/* Wipe the object */
object_wipe(q_ptr);
/* Create the final object */
object_prep(q_ptr, d_ptr->final_object);
- apply_magic(q_ptr, 1, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, 1, false, false, false);
/* Where it is found ? */
q_ptr->found = OBJ_FOUND_MONSTER;
@@ -7867,8 +7867,8 @@ static bool cave_gen()
q_ptr->found_aux3 = dungeon_type;
q_ptr->found_aux4 = level_or_feat(dungeon_type, dun_level);
- k_ptr->allow_special = FALSE;
- k_ptr->artifact = TRUE;
+ k_ptr->allow_special = false;
+ k_ptr->artifact = true;
/* Get the item */
object_type *o_ptr = &o_list[o_idx];
@@ -7933,7 +7933,7 @@ static bool cave_gen()
/* Mega-Hack */
#define REGEN_HACK 0x02
-bool_ build_special_level()
+bool build_special_level()
{
auto const &d_info = game->edit_data.d_info;
auto &level_markers = game->level_markers;
@@ -7941,20 +7941,20 @@ bool_ build_special_level()
/* No special levels on the surface */
if (!dun_level)
{
- return FALSE;
+ return false;
}
auto const level = dun_level - d_info[dungeon_type].mindepth;
if ((!get_dungeon_save_extension()) && !is_normal_level(level_markers[level][dungeon_type]))
{
- return FALSE;
+ return false;
}
auto map_name = get_dungeon_map_name();
if (!map_name)
{
- return FALSE;
+ return false;
}
/* Big town */
@@ -7986,13 +7986,13 @@ bool_ build_special_level()
init_flags = INIT_CREATE_DUNGEON | INIT_POSITION;
int ystart = 2;
int xstart = 2;
- process_dungeon_file(map_name->c_str(), &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file(map_name->c_str(), &ystart, &xstart, cur_hgt, cur_wid, true, true);
game->level_markers[level][dungeon_type] = level_marker::REGENERATE;
game->generate_special_feeling = true;
/* Special feeling because it's special */
- good_item_flag = TRUE;
+ good_item_flag = true;
/*
* Hack -- It's better/more dangerous than a greater vault.
@@ -8000,7 +8000,7 @@ bool_ build_special_level()
*/
rating += 40;
- return TRUE;
+ return true;
}
/*
@@ -8084,11 +8084,11 @@ static void finalise_special_level()
static void generate_grid_mana()
{
int y, x, mana, mult;
- bool_ xtra_magic = FALSE;
+ bool xtra_magic = false;
if (randint(XTRA_MAGIC) == 1)
{
- xtra_magic = TRUE;
+ xtra_magic = true;
if (options->cheat_room || p_ptr->precognition)
{
@@ -8212,9 +8212,9 @@ void generate_cave()
}
/* Generate */
- for (num = 0; TRUE; num++)
+ for (num = 0; true; num++)
{
- bool_ okay = TRUE;
+ bool okay = true;
const char *why = NULL;
@@ -8245,16 +8245,16 @@ void generate_cave()
object_level = dun_level;
/* Nothing special here yet */
- good_item_flag = FALSE;
+ good_item_flag = false;
/* Nothing good here yet */
rating = 0;
/* No ambush here yet */
- ambush_flag = FALSE;
+ ambush_flag = false;
/* No fated level here yet */
- fate_flag = FALSE;
+ fate_flag = false;
/* Quest levels -KMW- */
if (p_ptr->inside_quest)
@@ -8301,7 +8301,7 @@ void generate_cave()
}
- okay = TRUE;
+ okay = true;
}
/* Build a dungeon level */
@@ -8408,7 +8408,7 @@ void generate_cave()
if (!cave_gen())
{
why = "could not place player";
- okay = FALSE;
+ okay = false;
}
}
@@ -8440,7 +8440,7 @@ void generate_cave()
why = "too many objects";
/* Message */
- okay = FALSE;
+ okay = false;
}
/* Prevent monster over-flow */
@@ -8450,7 +8450,7 @@ void generate_cave()
why = "too many monsters";
/* Message */
- okay = FALSE;
+ okay = false;
}
/* Mega-Hack -- "auto-scum" */
@@ -8472,7 +8472,7 @@ void generate_cave()
}
/* Try again */
- okay = FALSE;
+ okay = false;
}
}
@@ -8489,7 +8489,7 @@ void generate_cave()
wipe_m_list();
/* Clear the fate icky flags */
- for (i = 0; i < MAX_FATES; i++) fates[i].icky = FALSE;
+ for (i = 0; i < MAX_FATES; i++) fates[i].icky = false;
/*
* Mega-Hack -- Reset special level flag if necessary
@@ -8519,7 +8519,7 @@ void generate_cave()
a_info[fates[i].a_idx].cur_num = 1;
}
fates[i].fate = FATE_NONE;
- fates[i].icky = FALSE;
+ fates[i].icky = false;
}
}
diff --git a/src/generate.hpp b/src/generate.hpp
index 2fbe6cc2..d3d2b9b5 100644
--- a/src/generate.hpp
+++ b/src/generate.hpp
@@ -2,11 +2,11 @@
#include "h-basic.hpp"
-bool_ new_player_spot(int branch);
-void add_level_generator(const char *name, bool_ (*generator)());
+bool new_player_spot(int branch);
+void add_level_generator(const char *name, bool (*generator)());
bool level_generate_dungeon();
bool generate_fracave(int y0, int x0, int xsize, int ysize, int cutoff, bool light, bool room);
void generate_hmap(int y0, int x0,int xsiz,int ysiz,int grd,int roug,int cutoff);
-bool_ room_alloc(int x,int y,bool_ crowded,int by0,int bx0,int *xx,int *yy);
+bool room_alloc(int x,int y,bool crowded,int by0,int bx0,int *xx,int *yy);
void generate_cave();
void build_rectangle(int y1, int x1, int y2, int x2, int feat, int info);
diff --git a/src/gods.cc b/src/gods.cc
index 0efcee19..41b99233 100644
--- a/src/gods.cc
+++ b/src/gods.cc
@@ -56,7 +56,7 @@ void abandon_god(int god)
/*
* Check if god may be followed by player
*/
-static bool_ may_follow_god(int god)
+static bool may_follow_god(int god)
{
if (god == GOD_MELKOR)
{
@@ -69,18 +69,18 @@ static bool_ may_follow_god(int god)
{
msg_print("The One Ring has corrupted "
"you, and you are rejected.");
- return FALSE;
+ return false;
}
}
}
/* Default is to allow */
- return TRUE;
+ return true;
}
/*
* Get a religion
*/
-void follow_god(int god, bool_ silent)
+void follow_god(int god, bool silent)
{
auto &s_info = game->s_info;
@@ -114,7 +114,7 @@ void follow_god(int god, bool_ silent)
/*
* Show religious info.
*/
-bool_ show_god_info()
+bool show_god_info()
{
int pgod = p_ptr->pgod;
@@ -124,7 +124,7 @@ bool_ show_god_info()
{
msg_print("You don't worship anyone.");
msg_print(NULL);
- return FALSE;
+ return false;
}
else
{
@@ -146,7 +146,7 @@ bool_ show_god_info()
screen_load_no_flush();
}
- return TRUE;
+ return true;
}
/*
@@ -178,7 +178,7 @@ deity_type *god_at(byte god_idx)
/*
* Check if god is enabled for the current module
*/
-bool_ god_enabled(struct deity_type *deity)
+bool god_enabled(struct deity_type *deity)
{
int i;
@@ -186,11 +186,11 @@ bool_ god_enabled(struct deity_type *deity)
{
if (deity->modules[i] == game_module_idx)
{
- return TRUE;
+ return true;
}
}
/* Not enabled */
- return FALSE;
+ return false;
}
/* Find a god by name */
diff --git a/src/gods.hpp b/src/gods.hpp
index 7ff972a5..f8e4ca9a 100644
--- a/src/gods.hpp
+++ b/src/gods.hpp
@@ -6,8 +6,8 @@ void inc_piety(int god, s32b amt);
void abandon_god(int god);
int wisdom_scale(int max);
int find_god(const char *name);
-void follow_god(int god, bool_ silent);
-bool_ god_enabled(struct deity_type *deity);
+void follow_god(int god, bool silent);
+bool god_enabled(struct deity_type *deity);
deity_type *god_at(byte god_idx);
-bool_ show_god_info();
+bool show_god_info();
bool praying_to(int god);
diff --git a/src/h-basic.hpp b/src/h-basic.hpp
index 9dd51e9c..6de1a4fa 100644
--- a/src/h-basic.hpp
+++ b/src/h-basic.hpp
@@ -101,11 +101,6 @@ typedef int errr;
/* An unsigned byte of memory */
typedef unsigned char byte;
-/* Note that a bool is smaller than a full "int" */
-/* Simple True/False type */
-typedef char bool_;
-
-
/* Signed/Unsigned 16 bit value */
typedef signed short s16b;
typedef unsigned short u16b;
@@ -139,19 +134,6 @@ typedef unsigned long u32b;
#endif /* NULL */
-/*
- * The constants "TRUE" and "FALSE"
- */
-
-#undef TRUE
-#define TRUE 1
-
-#undef FALSE
-#define FALSE 0
-
-
-
-
/**** Simple "Macros" ****/
/*
diff --git a/src/hiscore.cc b/src/hiscore.cc
index acbbbe28..09530e37 100644
--- a/src/hiscore.cc
+++ b/src/hiscore.cc
@@ -49,7 +49,7 @@ int highscore_where(int highscore_fd, high_score *score)
int highscore_add(int highscore_fd, high_score *score)
{
int i, slot;
- bool_ done = FALSE;
+ bool done = false;
high_score the_score, tmpscore;
@@ -71,7 +71,7 @@ int highscore_add(int highscore_fd, high_score *score)
{
/* Read the old guy, note errors */
if (highscore_seek(highscore_fd, i)) return ( -1);
- if (highscore_read(highscore_fd, &tmpscore)) done = TRUE;
+ if (highscore_read(highscore_fd, &tmpscore)) done = true;
/* Back up and dump the score we were holding */
if (highscore_seek(highscore_fd, i)) return ( -1);
diff --git a/src/hook_stair_out.hpp b/src/hook_stair_out.hpp
index b9c42189..b3470bc0 100644
--- a/src/hook_stair_out.hpp
+++ b/src/hook_stair_out.hpp
@@ -3,5 +3,5 @@
#include "h-basic.hpp"
struct hook_stair_out {
- bool_ allow;
+ bool allow;
};
diff --git a/src/hooks.cc b/src/hooks.cc
index 6d755c5e..cd09e64e 100644
--- a/src/hooks.cc
+++ b/src/hooks.cc
@@ -37,7 +37,7 @@ public:
/**
* Invoke the hook with the given input and output pointers.
*/
- bool_ invoke(void *in, void *out) const {
+ bool invoke(void *in, void *out) const {
return m_hook_func(m_hook_data, in, out);
}
};
@@ -49,7 +49,7 @@ std::unordered_map<size_t, std::vector<hook_data>> &hooks_instance()
}
-int process_hooks_restart = FALSE;
+int process_hooks_restart = false;
static std::vector<hook_data>::iterator find_hook(std::vector<hook_data> &hooks, hook_func_t hook_func)
{
@@ -91,7 +91,7 @@ bool process_hooks_new(int h_idx, void *in, void *out)
auto &hook_data = *hooks_it;
/* Invoke hook function; stop processing if the hook
- returns TRUE */
+ returns true */
if (hook_data.invoke(in, out))
{
return true;
@@ -101,7 +101,7 @@ bool process_hooks_new(int h_idx, void *in, void *out)
if (process_hooks_restart)
{
hooks_it = hooks.begin();
- process_hooks_restart = FALSE;
+ process_hooks_restart = false;
}
else
{
diff --git a/src/init1.cc b/src/init1.cc
index ad81f4c8..850a7be9 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -639,7 +639,7 @@ static void strappend(char **s, const char *t)
/*
* Grab one race flag from a textual string
*/
-static bool_ unknown_shut_up = FALSE;
+static bool unknown_shut_up = false;
static errr grab_one_class_flag(std::array<u32b, 2> &choice, const char *what)
{
auto const &class_info = game->edit_data.class_info;
@@ -3404,7 +3404,7 @@ static ego_flag_set lookup_ego_flag(const char *what)
*
* We explicitly allow nullptr for the "ego" parameter.
*/
-static bool_ grab_one_ego_item_flag(object_flag_set *flags, ego_flag_set *ego, const char *what)
+static bool grab_one_ego_item_flag(object_flag_set *flags, ego_flag_set *ego, const char *what)
{
/* Lookup as an object_flag */
if (auto f = object_flag_set_from_string(what))
@@ -4503,7 +4503,7 @@ errr init_re_info_txt(FILE *fp)
re_ptr->rarity = rar;
re_ptr->weight = (wt << 2) + monster_ego_modify(mwt);
re_ptr->mexp = (exp << 2) + monster_ego_modify(mexp);
- re_ptr->before = (pos == 'B') ? TRUE : FALSE;
+ re_ptr->before = (pos == 'B') ? true : false;
/* Next... */
continue;
@@ -5314,22 +5314,22 @@ errr init_d_info_txt(FILE *fp)
static errr grab_one_race_flag(owner_type *ow_ptr, int state, const char *what)
{
/* Scan race flags */
- unknown_shut_up = TRUE;
+ unknown_shut_up = true;
if (!grab_one_race_allow_flag(ow_ptr->races[state], what))
{
- unknown_shut_up = FALSE;
+ unknown_shut_up = false;
return (0);
}
/* Scan classes flags */
if (!grab_one_class_flag(ow_ptr->classes[state], what))
{
- unknown_shut_up = FALSE;
+ unknown_shut_up = false;
return (0);
}
/* Oops */
- unknown_shut_up = FALSE;
+ unknown_shut_up = false;
msg_format("Unknown race/class flag '%s'.", what);
/* Failure */
@@ -6007,17 +6007,17 @@ struct dungeon_grid
int bx, by; /* For between gates */
int mimic; /* Mimiced features */
s32b mflag; /* monster's mflag */
- bool_ ok;
- bool_ defined;
+ bool ok;
+ bool defined;
};
-static bool_ meta_sleep = TRUE;
+static bool meta_sleep = true;
static dungeon_grid letter[255];
/*
* Parse a sub-file of the "extra info"
*/
-static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalstart, int ymax, int xmax, bool_ full)
+static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalstart, int ymax, int xmax, bool full)
{
auto &wilderness = game->wilderness;
auto &wf_info = game->edit_data.wf_info;
@@ -6047,7 +6047,7 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
if (buf[0] == '%')
{
/* Attempt to Process the given file */
- return (process_dungeon_file(buf + 2, yval, xval, ymax, xmax, FALSE, full));
+ return (process_dungeon_file(buf + 2, yval, xval, ymax, xmax, false, full));
}
/* Process "N:<sleep>" */
@@ -6083,8 +6083,8 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
letter[index].random = 0;
letter[index].mimic = 0;
letter[index].mflag = 0;
- letter[index].ok = TRUE;
- letter[index].defined = TRUE;
+ letter[index].ok = true;
+ letter[index].defined = true;
if (num > 1)
{
@@ -6297,16 +6297,16 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
monster_level = quest[p_ptr->inside_quest].level + monster_index;
- m_idx = place_monster(y, x, meta_sleep, FALSE);
+ m_idx = place_monster(y, x, meta_sleep, false);
monster_level = level;
}
else if (monster_index)
{
/* Place it */
- m_allow_special[monster_index] = TRUE;
- m_idx = place_monster_aux(y, x, monster_index, meta_sleep, FALSE, MSTATUS_ENEMY);
- m_allow_special[monster_index] = FALSE;
+ m_allow_special[monster_index] = true;
+ m_idx = place_monster_aux(y, x, monster_index, meta_sleep, false, MSTATUS_ENEMY);
+ m_allow_special[monster_index] = false;
}
/* Set the mflag of the monster */
@@ -6322,25 +6322,25 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
object_level = quest[p_ptr->inside_quest].level + object_index;
if (rand_int(100) < 75)
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_SPECIAL);
+ place_object(y, x, false, false, OBJ_FOUND_SPECIAL);
else if (rand_int(100) < 80)
- place_object(y, x, TRUE, FALSE, OBJ_FOUND_SPECIAL);
+ place_object(y, x, true, false, OBJ_FOUND_SPECIAL);
else
- place_object(y, x, TRUE, TRUE, OBJ_FOUND_SPECIAL);
+ place_object(y, x, true, true, OBJ_FOUND_SPECIAL);
object_level = level;
}
else if (rand_int(100) < 75)
{
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_SPECIAL);
+ place_object(y, x, false, false, OBJ_FOUND_SPECIAL);
}
else if (rand_int(100) < 80)
{
- place_object(y, x, TRUE, FALSE, OBJ_FOUND_SPECIAL);
+ place_object(y, x, true, false, OBJ_FOUND_SPECIAL);
}
else
{
- place_object(y, x, TRUE, TRUE, OBJ_FOUND_SPECIAL);
+ place_object(y, x, true, true, OBJ_FOUND_SPECIAL);
}
}
else if (object_index)
@@ -6348,17 +6348,17 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
/* Get local object */
object_type *o_ptr = &object_type_body;
- k_info[object_index]->allow_special = TRUE;
+ k_info[object_index]->allow_special = true;
/* Create the item */
object_prep(o_ptr, object_index);
/* Apply magic (no messages, no artifacts) */
- apply_magic(o_ptr, dun_level, FALSE, TRUE, FALSE);
+ apply_magic(o_ptr, dun_level, false, true, false);
o_ptr->found = OBJ_FOUND_SPECIAL;
- k_info[object_index]->allow_special = FALSE;
+ k_info[object_index]->allow_special = false;
drop_near(o_ptr, -1, y, x);
}
@@ -6374,7 +6374,7 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
object_type forge;
object_type *q_ptr = &forge;
- a_allow_special[artifact_index] = TRUE;
+ a_allow_special[artifact_index] = true;
/* Wipe the object */
object_wipe(q_ptr);
@@ -6403,7 +6403,7 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst
a_info[artifact_index].cur_num = 1;
- a_allow_special[artifact_index] = FALSE;
+ a_allow_special[artifact_index] = false;
/* It's amazing that this "creating objects anywhere"
junk ever worked.
@@ -6735,7 +6735,7 @@ static const char *process_dungeon_file_expr(char **sp, char *fp)
/* Other */
else
{
- bool_ text_mode = FALSE;
+ bool text_mode = false;
/* Accept all printables except spaces and brackets */
while (isprint(*s))
@@ -6841,7 +6841,7 @@ static const char *process_dungeon_file_expr(char **sp, char *fp)
}
-errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int xmax, bool_ init, bool_ full)
+errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int xmax, bool init, bool full)
{
FILE *fp = 0;
@@ -6851,19 +6851,19 @@ errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int
errr err = 0;
- bool_ bypass = FALSE;
+ bool bypass = false;
/* Save the start since it ought to be modified */
int xmin = *xval;
if (init)
{
- meta_sleep = TRUE;
+ meta_sleep = true;
for (i = 0; i < 255; i++)
{
- letter[i].defined = FALSE;
- if (i == ' ') letter[i].ok = TRUE;
- else letter[i].ok = FALSE;
+ letter[i].defined = false;
+ if (i == ' ') letter[i].ok = true;
+ else letter[i].ok = false;
letter[i].bx = 0;
letter[i].by = 0;
}
@@ -6913,7 +6913,7 @@ errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int
v = process_dungeon_file_expr(&s, &f);
/* Set flag */
- bypass = (equals(v, "0") ? TRUE : FALSE);
+ bypass = (equals(v, "0") ? true : false);
/* Continue */
continue;
@@ -6927,7 +6927,7 @@ errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int
if (buf[0] == '%')
{
/* Process that file if allowed */
- process_dungeon_file(buf + 2, yval, xval, ymax, xmax, FALSE, full);
+ process_dungeon_file(buf + 2, yval, xval, ymax, xmax, false, full);
/* Continue */
continue;
diff --git a/src/init1.hpp b/src/init1.hpp
index aaa51d49..577c5b00 100644
--- a/src/init1.hpp
+++ b/src/init1.hpp
@@ -24,4 +24,4 @@ errr init_st_info_txt(FILE *fp);
errr init_ow_info_txt(FILE *fp);
errr init_wf_info_txt(FILE *fp);
errr grab_one_dungeon_flag(dungeon_flag_set *flags, const char *str);
-errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int xmax, bool_ init, bool_ full);
+errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int xmax, bool init, bool full);
diff --git a/src/init2.cc b/src/init2.cc
index a05d29fd..0afaa5ce 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -507,7 +507,7 @@ static void init_basic()
/* Macro variables */
macro__pat = make_array<char *>(MACRO_MAX);
macro__act = make_array<char *>(MACRO_MAX);
- macro__cmd = make_array<bool_>(MACRO_MAX);
+ macro__cmd = make_array<bool>(MACRO_MAX);
/* Macro action buffer */
macro__buf = make_array<char>(1024);
@@ -529,7 +529,7 @@ static errr init_misc()
{
int xstart = 0;
int ystart = 0;
- process_dungeon_file("misc.txt", &ystart, &xstart, 0, 0, TRUE, FALSE);
+ process_dungeon_file("misc.txt", &ystart, &xstart, 0, 0, true, false);
}
/* Initialize timers */
@@ -597,7 +597,7 @@ void create_stores_stock(int t)
st_ptr->stock.reserve(st_ptr->stock_size);
}
- t_ptr->stocked = TRUE;
+ t_ptr->stocked = true;
}
/*
@@ -613,8 +613,8 @@ static errr init_other()
/*** Prepare the "dungeon" information ***/
/* Allocate and Wipe the special gene flags */
- m_allow_special = make_array<bool_>(r_info.size());
- a_allow_special = make_array<bool_>(a_info.size());
+ m_allow_special = make_array<bool>(r_info.size());
+ a_allow_special = make_array<bool>(a_info.size());
/*** Prepare "vinfo" array ***/
diff --git a/src/joke.cc b/src/joke.cc
index 07149b3f..72bc403d 100644
--- a/src/joke.cc
+++ b/src/joke.cc
@@ -15,7 +15,7 @@ static void gen_joke_place_monster(int r_idx)
int x = randint(cur_hgt - 4) + 2;
int y = randint(cur_wid - 4) + 2;
- if (place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY))
+ if (place_monster_one(y, x, r_idx, 0, false, MSTATUS_ENEMY))
{
return;
}
@@ -30,11 +30,11 @@ bool gen_joke_monsters(void *data, void *in, void *out)
(dun_level == 72))
{
int r_idx = test_monster_name("Neil, the Sorceror");
- m_allow_special[r_idx] = TRUE;
+ m_allow_special[r_idx] = true;
gen_joke_place_monster(r_idx);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = false;
}
}
- return FALSE;
+ return false;
}
diff --git a/src/loadsave.cc b/src/loadsave.cc
index 70bc2df5..8fddc553 100644
--- a/src/loadsave.cc
+++ b/src/loadsave.cc
@@ -134,7 +134,7 @@ static void do_char(char *c, ls_flag_t flag)
do_byte((byte *) c, flag);
}
-static void do_bool(bool_ *f, ls_flag_t flag)
+static void do_bool(bool *f, ls_flag_t flag)
{
byte b = *f;
do_byte(&b, flag);
@@ -621,7 +621,7 @@ static void do_level_marker(level_marker *marker, ls_flag_t flag)
/*
* Misc. other data
*/
-static bool_ do_extra(ls_flag_t flag)
+static bool do_extra(ls_flag_t flag)
{
auto const &d_info = game->edit_data.d_info;
auto &s_info = game->s_info;
@@ -990,7 +990,7 @@ static bool_ do_extra(ls_flag_t flag)
/* Current turn */
do_s32b(&turn, flag);
- return TRUE;
+ return true;
}
@@ -1052,7 +1052,7 @@ static void do_monster(monster_type *m_ptr, ls_flag_t flag)
/*
* Determine if an item can be wielded/worn (e.g. helmet, sword, bow, arrow)
*/
-static bool_ wearable_p(object_type *o_ptr)
+static bool wearable_p(object_type *o_ptr)
{
/* Valid "tval" codes */
switch (o_ptr->tval)
@@ -1092,12 +1092,12 @@ static bool_ wearable_p(object_type *o_ptr)
case TV_DAEMON_BOOK:
case TV_TOOL:
{
- return (TRUE);
+ return true;
}
}
/* Nope */
- return (FALSE);
+ return false;
}
@@ -1535,7 +1535,7 @@ static bool do_monsters(ls_flag_t flag, bool no_companions)
* The monsters/objects must be loaded in the same order
* that they were stored, since the actual indexes matter.
*/
-static bool_ do_dungeon(ls_flag_t flag, bool no_companions)
+static bool do_dungeon(ls_flag_t flag, bool no_companions)
{
auto &dungeon_flags = game->dungeon_flags;
auto &effects = game->lasting_effects;
@@ -1583,14 +1583,14 @@ static bool_ do_dungeon(ls_flag_t flag, bool no_companions)
int ystart = 0;
/* Init the wilderness */
process_dungeon_file("w_info.txt", &ystart, &xstart, cur_hgt, cur_wid,
- TRUE, FALSE);
+ true, false);
/* Init the town */
xstart = 0;
ystart = 0;
init_flags = 0;
process_dungeon_file("t_info.txt", &ystart, &xstart, cur_hgt, cur_wid,
- TRUE, FALSE);
+ true, false);
}
do_grid(flag);
@@ -1598,13 +1598,13 @@ static bool_ do_dungeon(ls_flag_t flag, bool no_companions)
/*** Objects ***/
if (!do_objects(flag, no_companions))
{
- return FALSE;
+ return false;
}
/*** Monsters ***/
if (!do_monsters(flag, no_companions))
{
- return FALSE;
+ return false;
}
/*** Success ***/
@@ -1616,7 +1616,7 @@ static bool_ do_dungeon(ls_flag_t flag, bool no_companions)
}
/* Success */
- return (TRUE);
+ return true;
}
/* Save the current persistent dungeon -SC- */
@@ -1910,7 +1910,7 @@ static bool do_inventory(ls_flag_t flag)
/* Take care of item sets */
if (q_ptr->name1)
{
- wield_set(q_ptr->name1, a_info[q_ptr->name1].set, TRUE);
+ wield_set(q_ptr->name1, a_info[q_ptr->name1].set, true);
}
/* One more item */
@@ -1997,7 +1997,7 @@ static void do_messages(ls_flag_t flag)
}
}
-/* Returns TRUE if we successfully load the dungeon */
+/* Returns true if we successfully load the dungeon */
bool load_dungeon(std::string const &ext)
{
byte old_dungeon_type = dungeon_type;
@@ -2351,7 +2351,7 @@ static bool do_player_hd(ls_flag_t flag)
/*
* Actually read the savefile
*/
-static bool_ do_savefile_aux(ls_flag_t flag)
+static bool do_savefile_aux(ls_flag_t flag)
{
auto &class_info = game->edit_data.class_info;
auto const &race_info = game->edit_data.race_info;
@@ -2363,7 +2363,7 @@ static bool_ do_savefile_aux(ls_flag_t flag)
if (vernum != SAVEFILE_VERSION)
{
note("Incompatible save file version");
- return FALSE;
+ return false;
}
}
@@ -2399,7 +2399,7 @@ static bool_ do_savefile_aux(ls_flag_t flag)
note(fmt::format("Bad game module. Savefile was saved with module '{:s}' but game is '{:s}'.",
loaded_game_module,
game_module).c_str());
- return FALSE;
+ return false;
}
}
}
@@ -2421,57 +2421,57 @@ static bool_ do_savefile_aux(ls_flag_t flag)
if (!do_monster_lore(flag))
{
- return FALSE;
+ return false;
}
if (!do_object_lore(flag))
{
- return FALSE;
+ return false;
}
if (!do_towns(flag))
{
- return FALSE;
+ return false;
}
if (!do_quests(flag))
{
- return FALSE;
+ return false;
}
if (!do_wilderness(flag))
{
- return FALSE;
+ return false;
}
if (!do_randarts(flag))
{
- return FALSE;
+ return false;
}
if (!do_artifacts(flag))
{
- return FALSE;
+ return false;
}
if (!do_fates(flag))
{
- return FALSE;
+ return false;
}
if (!do_floor_inscriptions(flag))
{
- return FALSE;
+ return false;
}
if (!do_extra(flag))
{
- return FALSE;
+ return false;
}
if (!do_player_hd(flag))
{
- return FALSE;
+ return false;
}
if (flag == ls_flag_t::LOAD)
@@ -2498,7 +2498,7 @@ static bool_ do_savefile_aux(ls_flag_t flag)
if (flag == ls_flag_t::LOAD)
{
note("Unable to read inventory");
- return FALSE;
+ return false;
}
}
@@ -2517,7 +2517,7 @@ static bool_ do_savefile_aux(ls_flag_t flag)
if ((flag == ls_flag_t::LOAD) && (!do_dungeon(ls_flag_t::LOAD, false)))
{
note("Error reading dungeon data");
- return FALSE;
+ return false;
}
if (flag == ls_flag_t::SAVE)
@@ -2527,7 +2527,7 @@ static bool_ do_savefile_aux(ls_flag_t flag)
}
/* Success */
- return TRUE;
+ return true;
}
@@ -2567,7 +2567,7 @@ static errr rd_savefile()
* the player loads a savefile belonging to someone else, and then is not
* allowed to save his game when he quits.
*
- * We return "TRUE" if the savefile was usable, and we set the global
+ * We return "true" if the savefile was usable, and we set the global
* flag "character_loaded" if a real, living, character was loaded.
*
* Note that we always try to load the "current" savefile, even if
@@ -2583,7 +2583,7 @@ bool load_player(program_args const &args)
turn = 0;
/* Paranoia */
- death = FALSE;
+ death = false;
/* Save file */
auto savefile = name_file_save();
@@ -2668,7 +2668,7 @@ bool load_player(program_args const &args)
if (death)
{
/* Player is no longer "dead" */
- death = FALSE;
+ death = false;
/* Cheat death (unless the character retired) */
if (args.wizard && !total_winner)
@@ -2716,9 +2716,9 @@ bool load_player(program_args const &args)
/*
* Medium level player saver
*/
-static bool_ save_player_aux(char const *name)
+static bool save_player_aux(char const *name)
{
- bool_ ok = FALSE;
+ bool ok = false;
int fd = -1;
int mode = 0644;
@@ -2741,10 +2741,10 @@ static bool_ save_player_aux(char const *name)
if (fff)
{
/* Write the savefile */
- if (do_savefile_aux(ls_flag_t::SAVE)) ok = TRUE;
+ if (do_savefile_aux(ls_flag_t::SAVE)) ok = true;
/* Attempt to close it */
- if (my_fclose(fff)) ok = FALSE;
+ if (my_fclose(fff)) ok = false;
}
/* "broken" savefile */
@@ -2756,18 +2756,18 @@ static bool_ save_player_aux(char const *name)
}
/* Failure */
- if (!ok) return (FALSE);
+ if (!ok) return false;
/* Success */
- return (TRUE);
+ return true;
}
/*
* Attempt to save the player in a savefile
*/
-bool_ save_player()
+bool save_player()
{
- int result = FALSE;
+ int result = false;
auto savefile = name_file_save();
@@ -2799,7 +2799,7 @@ bool_ save_player()
character_loaded = true;
/* Success */
- result = TRUE;
+ result = true;
}
save_savefile_names();
diff --git a/src/loadsave.hpp b/src/loadsave.hpp
index 20eb8092..ec0ae66f 100644
--- a/src/loadsave.hpp
+++ b/src/loadsave.hpp
@@ -8,4 +8,4 @@
bool load_dungeon(std::string const &ext);
bool load_player(program_args const &);
void save_dungeon();
-bool_ save_player();
+bool save_player();
diff --git a/src/lua_bind.cc b/src/lua_bind.cc
index e4db2afe..bc4f1eae 100644
--- a/src/lua_bind.cc
+++ b/src/lua_bind.cc
@@ -101,7 +101,7 @@ static s32b get_level_school_1(spell_type *spell, s32b max, s32b min)
s32b level;
bool na;
get_level_school(spell, max, min, &level, &na);
- // Note: It is tempting to add an assertion here for "na == FALSE" here,
+ // Note: It is tempting to add an assertion here for "na == false" here,
// but there are cases where we haven't actually checked if the spell is
// really castable before calling this function (indirectly). Thus we
// MUST NOT assert anything about "na" as the code currently stands.
@@ -215,7 +215,7 @@ void get_map_size(const char *name, int *ysize, int *xsize)
*xsize = 0;
*ysize = 0;
init_flags = INIT_GET_SIZE;
- process_dungeon_file(name, ysize, xsize, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file(name, ysize, xsize, cur_hgt, cur_wid, true, true);
}
void load_map(const char *name, int *y, int *x)
@@ -227,7 +227,7 @@ void load_map(const char *name, int *y, int *x)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file(name, y, x, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file(name, y, x, cur_hgt, cur_wid, true, true);
}
void increase_mana(int delta)
diff --git a/src/main-gcu.cc b/src/main-gcu.cc
index ac2d220b..0b509070 100644
--- a/src/main-gcu.cc
+++ b/src/main-gcu.cc
@@ -223,12 +223,12 @@ static int active = 0;
/*
* Software flag -- we are allowed to use color
*/
-static int can_use_color = FALSE;
+static int can_use_color = false;
/*
* Software flag -- we are allowed to change the colors
*/
-static int can_fix_color = FALSE;
+static int can_fix_color = false;
/*
* Simple Angband to Curses color conversion table
@@ -608,7 +608,7 @@ static void Term_xtra_gcu(void *data, int n, int v)
/* Flush events */
case TERM_XTRA_FLUSH:
- while (!Term_xtra_gcu_event(FALSE));
+ while (!Term_xtra_gcu_event(false));
return;
/* React to events */
@@ -719,7 +719,7 @@ int init_gcu(int argc, char **argv)
int num_term = MAX_TERM_DATA, next_win = 0;
- bool_ use_big_screen = FALSE;
+ bool use_big_screen = false;
/* Parse args */
@@ -727,7 +727,7 @@ int init_gcu(int argc, char **argv)
{
if (starts_with(argv[i], "-b"))
{
- use_big_screen = TRUE;
+ use_big_screen = true;
continue;
}
diff --git a/src/main-gtk2.cc b/src/main-gtk2.cc
index e5c25864..f6ae81a8 100644
--- a/src/main-gtk2.cc
+++ b/src/main-gtk2.cc
@@ -95,7 +95,7 @@ struct term_data
GdkFont *font;
GdkGC *gc;
- bool_ shown;
+ bool shown;
byte last_attr;
int font_wid;
@@ -146,9 +146,9 @@ static guint32 angband_colours[16];
/*
- * Set to TRUE when a game is in progress
+ * Set to true when a game is in progress
*/
-static bool_ game_in_progress = FALSE;
+static bool game_in_progress = false;
/*
@@ -158,7 +158,7 @@ static bool_ game_in_progress = FALSE;
* with the MIT Shm extention which is usually active if you run
* Angband locally, because it reduces amount of memory-to-memory copy.
*/
-static bool_ use_backing_store = TRUE;
+static bool use_backing_store = true;
@@ -198,7 +198,7 @@ static const char *get_default_font(int term)
/*
* New global flag to indicate if it's safe to save now
*/
-#define can_save TRUE
+#define can_save true
@@ -332,7 +332,7 @@ static errr Term_wipe_gtk(term_data *td, int x, int y, int n)
gdk_draw_rectangle(
TERM_DATA_DRAWABLE(td),
td->drawing_area->style->black_gc,
- TRUE,
+ true,
x * td->font_wid,
y * td->font_hgt,
n * td->font_wid,
@@ -408,7 +408,7 @@ static void Term_curs_gtk(void *data, int x, int y)
gdk_draw_rectangle(
TERM_DATA_DRAWABLE(td),
td->gc,
- FALSE,
+ false,
x * td->font_wid,
y * td->font_hgt,
td->font_wid * cells - 1,
@@ -425,7 +425,7 @@ static void Term_curs_gtk(void *data, int x, int y)
* Process an event, if there's none block when wait is set true,
* return immediately otherwise.
*/
-static void CheckEvent(bool_ wait)
+static void CheckEvent(bool wait)
{
/* Process an event */
(void)gtk_main_iteration_do(wait);
@@ -469,7 +469,7 @@ static void Term_xtra_gtk(void *term_data_ctx, int n, int v)
/* Process random events */
case TERM_XTRA_BORED:
{
- CheckEvent(FALSE);
+ CheckEvent(false);
return;
}
@@ -624,7 +624,7 @@ static void term_data_set_backing_store(term_data *td)
gdk_draw_rectangle(
td->backing_store,
td->drawing_area->style->black_gc,
- TRUE,
+ true,
0,
0,
td->cols * td->font_wid,
@@ -649,7 +649,7 @@ static void save_game_gtk(void)
}
/* Hack -- Forget messages */
- msg_flag = FALSE;
+ msg_flag = false;
/* Save the game */
do_cmd_save_game();
@@ -689,7 +689,7 @@ static void gtk_message(const char *msg)
label);
/* And make it modal */
- gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
+ gtk_window_set_modal(GTK_WINDOW(dialog), true);
/* Show the dialog */
gtk_widget_show_all(dialog);
@@ -877,7 +877,7 @@ static gboolean delete_event_handler(
save_game_gtk();
/* Don't prevent closure */
- return (FALSE);
+ return false;
}
@@ -895,17 +895,17 @@ static gboolean keypress_event_handler(
char msg[128];
/* Hack - do not do anything until the player picks from the menu */
- if (!game_in_progress) return (TRUE);
+ if (!game_in_progress) return true;
/* Hack - Ignore parameters */
(void) widget;
(void) user_data;
/* Extract four "modifier flags" */
- mc = (event->state & GDK_CONTROL_MASK) ? TRUE : FALSE;
- ms = (event->state & GDK_SHIFT_MASK) ? TRUE : FALSE;
- mo = (event->state & GDK_MOD1_MASK) ? TRUE : FALSE;
- mx = (event->state & GDK_MOD3_MASK) ? TRUE : FALSE;
+ mc = (event->state & GDK_CONTROL_MASK) ? true : false;
+ ms = (event->state & GDK_SHIFT_MASK) ? true : false;
+ mo = (event->state & GDK_MOD1_MASK) ? true : false;
+ mx = (event->state & GDK_MOD3_MASK) ? true : false;
/*
* Hack XXX
@@ -927,7 +927,7 @@ static gboolean keypress_event_handler(
macro_add(msg, event->string);
}
- return (TRUE);
+ return true;
}
/* Normal keys with no modifiers */
@@ -937,7 +937,7 @@ static gboolean keypress_event_handler(
for (i = 0; i < event->length; i++) Term_keypress(event->string[i]);
/* All done */
- return (TRUE);
+ return true;
}
@@ -947,26 +947,26 @@ static gboolean keypress_event_handler(
case GDK_Escape:
{
Term_keypress(ESCAPE);
- return (TRUE);
+ return true;
}
case GDK_Return:
{
Term_keypress('\r');
- return (TRUE);
+ return true;
}
case GDK_Tab:
{
Term_keypress('\t');
- return (TRUE);
+ return true;
}
case GDK_Delete:
case GDK_BackSpace:
{
Term_keypress('\010');
- return (TRUE);
+ return true;
}
case GDK_Shift_L:
@@ -985,7 +985,7 @@ static gboolean keypress_event_handler(
case GDK_Hyper_R:
{
/* Hack - do nothing to control characters */
- return (TRUE);
+ return true;
}
}
@@ -1005,7 +1005,7 @@ static gboolean keypress_event_handler(
macro_add(msg, event->string);
}
- return (TRUE);
+ return true;
}
@@ -1038,7 +1038,7 @@ static void realize_event_handler(
gdk_draw_rectangle(
widget->window,
widget->style->black_gc,
- TRUE,
+ true,
0,
0,
td->cols * td->font_wid,
@@ -1056,7 +1056,7 @@ static void show_event_handler(
term_data *td = (term_data *)user_data;
/* Set the shown flag */
- td->shown = TRUE;
+ td->shown = true;
}
@@ -1070,7 +1070,7 @@ static void hide_event_handler(
term_data *td = (term_data *)user_data;
/* Set the shown flag */
- td->shown = FALSE;
+ td->shown = false;
}
@@ -1154,7 +1154,7 @@ static gboolean expose_event_handler(
/* Paranoia */
- if (td == NULL) return (TRUE);
+ if (td == NULL) return true;
/* The window has a backing store */
if (td->backing_store)
@@ -1218,7 +1218,7 @@ static gboolean expose_event_handler(
}
/* We've processed the event ourselves */
- return (TRUE);
+ return true;
}
@@ -1521,7 +1521,7 @@ static GtkWidget *get_widget_from_path(const char *path)
/*
* Enable/disable a menu item
*/
-void enable_menu_item(const char *path, bool_ enabled)
+void enable_menu_item(const char *path, bool enabled)
{
GtkWidget *widget;
@@ -1543,7 +1543,7 @@ void enable_menu_item(const char *path, bool_ enabled)
/*
* Check/uncheck a menu item. The item should be of the GtkCheckMenuItem type
*/
-void check_menu_item(const char *path, bool_ checked)
+void check_menu_item(const char *path, bool checked)
{
GtkWidget *widget;
@@ -1574,18 +1574,18 @@ static void file_menu_update_handler(
GtkWidget *widget,
gpointer user_data)
{
- bool_ save_ok, quit_ok;
+ bool save_ok, quit_ok;
/* Cave we save/quit now? */
if (!character_generated || !game_in_progress)
{
- save_ok = FALSE;
- quit_ok = TRUE;
+ save_ok = false;
+ quit_ok = true;
}
else
{
- if (inkey_flag && can_save) save_ok = quit_ok = TRUE;
- else save_ok = quit_ok = FALSE;
+ if (inkey_flag && can_save) save_ok = quit_ok = true;
+ else save_ok = quit_ok = false;
}
/* Enable / disable menu items according to those conditions */
@@ -1771,7 +1771,7 @@ static void init_gtk_window(term_data *td, int i)
GtkWidget *menu_bar = NULL, *box;
const char *font;
- bool_ main_window = (i == 0) ? TRUE : FALSE;
+ bool main_window = (i == 0) ? true : false;
/* Create window */
@@ -1876,7 +1876,7 @@ static void init_gtk_window(term_data *td, int i)
/* Pack the menu bar together with the main window */
/* For vertical placement of the menu bar and the drawing area */
- box = gtk_vbox_new(FALSE, 0);
+ box = gtk_vbox_new(false, 0);
/* Let the window widget own it */
gtk_container_add(GTK_CONTAINER(td->window), box);
@@ -1886,8 +1886,8 @@ static void init_gtk_window(term_data *td, int i)
gtk_box_pack_start(
GTK_BOX(box),
menu_bar,
- FALSE,
- FALSE,
+ false,
+ false,
NO_PADDING);
/* And place the drawing area just beneath it */
@@ -1942,7 +1942,7 @@ int init_gtk2(int argc, char **argv)
/* Disable use of pixmaps as backing store */
if (equals(argv[i], "-b"))
{
- use_backing_store = FALSE;
+ use_backing_store = false;
continue;
}
@@ -1970,8 +1970,8 @@ int init_gtk2(int argc, char **argv)
term *t = term_data_init(td, i);
/* Hack - Set the shown flag, meaning "to be shown" XXX XXX */
- if (i < num_term) td->shown = TRUE;
- else td->shown = FALSE;
+ if (i < num_term) td->shown = true;
+ else td->shown = false;
/* Save global entry */
angband_term[i] = t;
@@ -1987,7 +1987,7 @@ int init_gtk2(int argc, char **argv)
plog_aux = hook_plog;
/* It's too early to set this, but cannot do so elsewhere XXX XXX */
- game_in_progress = TRUE;
+ game_in_progress = true;
/* Success */
return (0);
diff --git a/src/main-sdl.cc b/src/main-sdl.cc
index 40fe3e78..ff7c6b7b 100644
--- a/src/main-sdl.cc
+++ b/src/main-sdl.cc
@@ -89,12 +89,12 @@ border */
/**************/
/* flag signifying whether the game is in full screen */
-static bool_ arg_full_screen = FALSE;
+static bool arg_full_screen = false;
/* a flag to show whether window properties have been
set or not... if so, the properties can be dumped
upon quit*/
-static bool_ window_properties_set = FALSE;
+static bool window_properties_set = false;
/*************************************************
GLOBAL SDL-ToME VARIABLES
@@ -112,7 +112,7 @@ redrawn -- like when doing a Term_redraw() or when
redoing the entire screen -- all of the changes
can be stored up before doing an update. This
should cut down on screen flicker */
-static bool_ suspendUpdate = FALSE;
+static bool suspendUpdate = false;
/* some helper surfaces that are used for rendering
characters */
@@ -425,7 +425,7 @@ void handleEvent(SDL_Event *event)
{
SDL_WM_ToggleFullScreen(screen);
/* toggle the internal full screen flag */
- arg_full_screen = (arg_full_screen ? FALSE : TRUE);
+ arg_full_screen = (arg_full_screen ? false : true);
}
/* entry into window manipulation mode */
@@ -551,7 +551,7 @@ static void Term_xtra_sdl(void *data, int n, int v)
{
/* Clear the terminal */
DB("TERM_XTRA_CLEAR");
- suspendUpdate = TRUE;
+ suspendUpdate = true;
eraseTerminal(td);
return;
}
@@ -574,7 +574,7 @@ static void Term_xtra_sdl(void *data, int n, int v)
if (suspendUpdate)
{
DB(" update WAS suspended... updating now");
- suspendUpdate = FALSE;
+ suspendUpdate = false;
drawTermStuff(td,NULL);
}
return;
@@ -679,9 +679,9 @@ void screen_to_term(SDL_Rect *scrrect, term_data *td)
/* A function to calculate the intersection of two rectangles. Takes base
rectangle and then updates it to include only the rectangles that intersect
with the test rectangle. If there is an intersection, the function returns
-TRUE and base now contains the intersecting rectangle. If there is no
-intersection, then the function returns FALSE */
-bool_ intersectRects(SDL_Rect *base, SDL_Rect *test)
+true and base now contains the intersecting rectangle. If there is no
+intersection, then the function returns false */
+bool intersectRects(SDL_Rect *base, SDL_Rect *test)
{
if (INTERSECT((*base),(*test)))
{
@@ -707,11 +707,11 @@ bool_ intersectRects(SDL_Rect *base, SDL_Rect *test)
{
base->h = test->y + test->h - base->y;
}
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
@@ -757,7 +757,7 @@ drawn, but occluding terminals will then re-blit to re-cover the area. */
void drawTermStuff(term_data *td, SDL_Rect *rect)
{
int n = 0, i;
- bool_ block = FALSE, cover = FALSE;
+ bool block = false, cover = false;
SDL_Rect spot, isect_term, isect_scr;
/* first of all, if updating is suspended, do nothing! */
@@ -792,13 +792,13 @@ void drawTermStuff(term_data *td, SDL_Rect *rect)
if (BLOCKS(term_order[i]->rect,spot))
{
/* Higher terminal completely occludes this spot */
- block = TRUE;
+ block = true;
DB(" Blocks!");
}
else if (INTERSECT(term_order[i]->rect,spot))
{
/* Partial occlusion */
- cover = TRUE;
+ cover = true;
DB(" Covers!");
}
}
@@ -1350,7 +1350,7 @@ void manipulationMode(void)
{
term_data *td;
SDL_Event event;
- bool_ done = FALSE, moveMode = TRUE;
+ bool done = false, moveMode = true;
int mouse_x, mouse_y;
int value = 0, delta_x = 0, delta_y = 0;
int current_term;
@@ -1386,13 +1386,13 @@ void manipulationMode(void)
case SDLK_ESCAPE:
{
/* Escape has been pressed, so we're done!*/
- done = TRUE;
+ done = true;
break;
}
case SDLK_SPACE:
{
/* Space has been pressed: toggle move mode */
- moveMode = ( moveMode ? FALSE : TRUE );
+ moveMode = ( moveMode ? false : true );
break;
}
case SDLK_RETURN:
@@ -1842,7 +1842,7 @@ int init_sdl(int argc, char **argv)
else if (equals(argv[i], "-fs"))
{
DB("Full-screen enabled!");
- arg_full_screen = TRUE;
+ arg_full_screen = true;
}
/* change the font size */
else if (equals(argv[i], "-s"))
@@ -1967,7 +1967,7 @@ int init_sdl(int argc, char **argv)
/* Initialize the windows, or whatever that means in this case.
Do this in reverse order so that the main window is on top.*/
- suspendUpdate = TRUE; /* draw everything at the end */
+ suspendUpdate = true; /* draw everything at the end */
i = arg_console_count;
while (i--)
{
@@ -1988,13 +1988,13 @@ int init_sdl(int argc, char **argv)
the main terminal surface */
screen_black = SDL_MapRGB(screen->format, 0, 0, 0);
- suspendUpdate = FALSE; /* now draw everything */
+ suspendUpdate = false; /* now draw everything */
redrawAllTerminals();
/*SDL_REDRAW_SCREEN;*/
/* now that the windows have been set, their settings can
be dumped upon quit! */
- window_properties_set = TRUE;
+ window_properties_set = true;
/* Enable UNICODE keysyms - needed for current eventHandling routine */
SDL_EnableUNICODE(1);
diff --git a/src/main-win.cc b/src/main-win.cc
index 25224da4..0bfcfcab 100644
--- a/src/main-win.cc
+++ b/src/main-win.cc
@@ -81,13 +81,13 @@
/*
* Determine if string "t" is a suffix of string "s"
*/
-static bool_ suffix(const char *s, const char *t)
+static bool suffix(const char *s, const char *t)
{
int tlen = strlen(t);
int slen = strlen(s);
/* Check for incompatible lengths */
- if (tlen > slen) return (FALSE);
+ if (tlen > slen) return false;
/* Compare "t" to the end of "s" */
return !strcmp(s + slen - tlen, t);
@@ -359,13 +359,13 @@ struct _term_data
unsigned int size_ow2;
unsigned int size_oh2;
- bool_ size_hack;
+ bool size_hack;
- bool_ xtra_hack;
+ bool xtra_hack;
- bool_ visible;
+ bool visible;
- bool_ bizarre;
+ bool bizarre;
const char *font_want;
@@ -399,22 +399,22 @@ static term_data *my_td;
/*
* game in progress
*/
-bool_ game_in_progress = FALSE;
+bool game_in_progress = false;
/*
* note when "open"/"new" become valid
*/
-bool_ initialized = FALSE;
+bool initialized = false;
/*
* screen paletted, i.e. 256 colors
*/
-bool_ paletted = FALSE;
+bool paletted = false;
/*
* 16 colors screen, don't use RGB()
*/
-bool_ colors16 = FALSE;
+bool colors16 = false;
/*
* Saved instance handle
@@ -513,8 +513,8 @@ static BYTE win_pal[256] =
/*
* Hack -- define which keys are "special"
*/
-static bool_ special_key[256];
-static bool_ ignore_key[256];
+static bool special_key[256];
+static bool ignore_key[256];
/*
* Hack -- initialization list for "special_key"
@@ -608,7 +608,7 @@ static char *analyze_font(char *path, int *wp, int *hp)
/*
* Check for existance of a file
*/
-static bool_ check_file(const char *s)
+static bool check_file(const char *s)
{
char path[1024];
@@ -631,33 +631,33 @@ static bool_ check_file(const char *s)
attrib = GetFileAttributes(path);
/* Require valid filename */
- if (attrib == INVALID_FILE_NAME) return (FALSE);
+ if (attrib == INVALID_FILE_NAME) return false;
/* Prohibit directory */
- if (attrib & FILE_ATTRIBUTE_DIRECTORY) return (FALSE);
+ if (attrib & FILE_ATTRIBUTE_DIRECTORY) return false;
#else /* WIN32 */
/* Examine and verify */
- if (_dos_getfileattr(path, &attrib)) return (FALSE);
+ if (_dos_getfileattr(path, &attrib)) return false;
/* Prohibit something */
- if (attrib & FA_LABEL) return (FALSE);
+ if (attrib & FA_LABEL) return false;
/* Prohibit directory */
- if (attrib & FA_DIREC) return (FALSE);
+ if (attrib & FA_DIREC) return false;
#endif /* WIN32 */
/* Success */
- return (TRUE);
+ return true;
}
/*
* Check for existance of a directory
*/
-static bool_ check_dir(const char *s)
+static bool check_dir(const char *s)
{
int i;
@@ -688,26 +688,26 @@ static bool_ check_dir(const char *s)
attrib = GetFileAttributes(path);
/* Require valid filename */
- if (attrib == INVALID_FILE_NAME) return (FALSE);
+ if (attrib == INVALID_FILE_NAME) return false;
/* Require directory */
- if (!(attrib & FILE_ATTRIBUTE_DIRECTORY)) return (FALSE);
+ if (!(attrib & FILE_ATTRIBUTE_DIRECTORY)) return false;
#else /* WIN32 */
/* Examine and verify */
- if (_dos_getfileattr(path, &attrib)) return (FALSE);
+ if (_dos_getfileattr(path, &attrib)) return false;
/* Prohibit something */
- if (attrib & FA_LABEL) return (FALSE);
+ if (attrib & FA_LABEL) return false;
/* Require directory */
- if (!(attrib & FA_DIREC)) return (FALSE);
+ if (!(attrib & FA_DIREC)) return false;
#endif /* WIN32 */
/* Success */
- return (TRUE);
+ return true;
}
@@ -783,7 +783,7 @@ static void term_getsize(term_data *td)
/* rc.bottom += 1; */
/* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ AdjustWindowRectEx(&rc, td->dwStyle, true, td->dwExStyle);
/* Total size */
td->size_wid = rc.right - rc.left;
@@ -940,7 +940,7 @@ static void load_prefs(void)
*
* This function is never called before all windows are ready.
*
- * This function returns FALSE if the new palette could not be
+ * This function returns false if the new palette could not be
* prepared, which should normally be a fatal error. XXX XXX
*
* Note that only some machines actually use a "palette".
@@ -960,7 +960,7 @@ static int new_palette(void)
/* This makes no sense */
- if (!paletted) return (TRUE);
+ if (!paletted) return true;
/* No palette */
@@ -1053,7 +1053,7 @@ static int new_palette(void)
hPal = hNewPal;
/* Success */
- return (TRUE);
+ return true;
}
@@ -1072,7 +1072,7 @@ static void term_window_resize(term_data *td)
SWP_NOMOVE | SWP_NOZORDER);
/* Redraw later */
- InvalidateRect(td->w, NULL, TRUE);
+ InvalidateRect(td->w, NULL, true);
}
@@ -1103,7 +1103,7 @@ static errr term_force_font(term_data *td, const char *path)
/* Forget old font */
if (td->font_file)
{
- bool_ used = FALSE;
+ bool used = false;
/* Scan windows */
for (i = 0; i < MAX_TERM_DATA; i++)
@@ -1113,7 +1113,7 @@ static errr term_force_font(term_data *td, const char *path)
(data[i].font_file) &&
(strcmp(data[i].font_file, td->font_file) == 0))
{
- used = TRUE;
+ used = true;
}
}
@@ -1224,7 +1224,7 @@ static void term_change_font(term_data *td)
}
/* Assume not bizarre */
- td->bizarre = FALSE;
+ td->bizarre = false;
/* Reset the tile info */
td->tile_wid = td->font_wid;
@@ -1288,7 +1288,7 @@ static void Term_xtra_win_react(void)
byte rv, gv, bv;
- bool_ change = FALSE;
+ bool change = false;
/* Save the default colors */
for (i = 0; i < 256; i++)
@@ -1305,7 +1305,7 @@ static void Term_xtra_win_react(void)
if (win_clr[i] != code)
{
/* Note the change */
- change = TRUE;
+ change = true;
/* Apply the desired color */
win_clr[i] = code;
@@ -1707,7 +1707,7 @@ static void init_windows(void)
td->keys = 1024;
td->rows = 24;
td->cols = 80;
- td->visible = TRUE;
+ td->visible = true;
td->size_ow1 = 2;
td->size_ow2 = 2;
td->size_oh1 = 2;
@@ -1724,7 +1724,7 @@ static void init_windows(void)
td->keys = 16;
td->rows = 24;
td->cols = 80;
- td->visible = FALSE;
+ td->visible = false;
td->size_ow1 = 1;
td->size_ow2 = 1;
td->size_oh1 = 1;
@@ -1744,7 +1744,7 @@ static void init_windows(void)
WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION |
WS_VISIBLE);
td->dwExStyle = 0;
- td->visible = TRUE;
+ td->visible = true;
/* Sub windows (need these before term_getsize gets called) */
for (i = 1; i < MAX_TERM_DATA; i++)
@@ -1777,7 +1777,7 @@ static void init_windows(void)
td->tile_hgt = 13;
/* Assume not bizarre */
- td->bizarre = FALSE;
+ td->bizarre = false;
}
/* Analyze the font */
@@ -1804,9 +1804,9 @@ static void init_windows(void)
if (td->visible)
{
- td->size_hack = TRUE;
+ td->size_hack = true;
ShowWindow(td->w, SW_SHOW);
- td->size_hack = FALSE;
+ td->size_hack = false;
}
term_data_link(td);
@@ -2066,7 +2066,7 @@ static void check_for_save_file(LPSTR cmd_line)
validate_file(savefile);
/* Game in progress */
- game_in_progress = TRUE;
+ game_in_progress = true;
/* Play game */
play_game();
@@ -2100,7 +2100,7 @@ static void process_menus(WORD wCmd)
}
else
{
- game_in_progress = TRUE;
+ game_in_progress = true;
Term_flush();
play_game();
quit(NULL);
@@ -2139,7 +2139,7 @@ ofn.lStructSize = sizeof(OPENFILENAME);
{
/* Load 'savefile' */
validate_file(savefile);
- game_in_progress = TRUE;
+ game_in_progress = true;
Term_flush();
play_game();
quit(NULL);
@@ -2161,7 +2161,7 @@ ofn.lStructSize = sizeof(OPENFILENAME);
}
/* Hack -- Forget messages */
- msg_flag = FALSE;
+ msg_flag = false;
/* Save the game */
do_cmd_save_game();
@@ -2186,7 +2186,7 @@ ofn.lStructSize = sizeof(OPENFILENAME);
}
/* Hack -- Forget messages */
- msg_flag = FALSE;
+ msg_flag = false;
/* Save the game */
do_cmd_save_game();
@@ -2228,13 +2228,13 @@ ofn.lStructSize = sizeof(OPENFILENAME);
if (!td->visible)
{
- td->visible = TRUE;
+ td->visible = true;
ShowWindow(td->w, SW_SHOW);
term_data_redraw(td);
}
else
{
- td->visible = FALSE;
+ td->visible = false;
ShowWindow(td->w, SW_HIDE);
}
@@ -2475,7 +2475,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
rc.bottom = rc.top + 2 * td->tile_hgt + td->size_oh1 + td->size_oh2 + 1;
/* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ AdjustWindowRectEx(&rc, td->dwStyle, true, td->dwExStyle);
/* Save minimum size */
lpmmi->ptMinTrackSize.x = rc.right - rc.left;
@@ -2491,7 +2491,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
rc.bottom += (td->tile_hgt - 1);
/* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ AdjustWindowRectEx(&rc, td->dwStyle, true, td->dwExStyle);
/* Save maximum size */
lpmmi->ptMaxSize.x = rc.right - rc.left;
@@ -2519,14 +2519,14 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
/* Unused */
/* BYTE KeyState = 0x00; */
- bool_ mc = FALSE;
- bool_ ms = FALSE;
- bool_ ma = FALSE;
+ bool mc = false;
+ bool ms = false;
+ bool ma = false;
/* Extract the modifiers */
- if (GetKeyState(VK_CONTROL) & 0x8000) mc = TRUE;
- if (GetKeyState(VK_SHIFT) & 0x8000) ms = TRUE;
- if (GetKeyState(VK_MENU) & 0x8000) ma = TRUE;
+ if (GetKeyState(VK_CONTROL) & 0x8000) mc = true;
+ if (GetKeyState(VK_SHIFT) & 0x8000) ms = true;
+ if (GetKeyState(VK_MENU) & 0x8000) ma = true;
/* Handle "special" keys */
if (special_key[(byte)(wParam)] || (ma && !ignore_key[(byte)(wParam)]) )
@@ -2575,7 +2575,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
if (game_in_progress && character_generated)
{
/* Hack -- Forget messages */
- msg_flag = FALSE;
+ msg_flag = false;
/* Save the game */
do_cmd_save_game();
@@ -2643,10 +2643,10 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
Term_resize(td->cols, td->rows);
/* Redraw later */
- InvalidateRect(td->w, NULL, TRUE);
+ InvalidateRect(td->w, NULL, true);
}
- td->size_hack = TRUE;
+ td->size_hack = true;
/* Restore sub-windows */
for (i = 1; i < MAX_TERM_DATA; i++)
@@ -2654,7 +2654,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
if (data[i].visible) ShowWindow(data[i].w, SW_SHOWNOACTIVATE);
}
- td->size_hack = FALSE;
+ td->size_hack = false;
return 0;
}
@@ -2676,12 +2676,12 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
hdc = GetDC(hWnd);
- SelectPalette(hdc, hPal, FALSE);
+ SelectPalette(hdc, hPal, false);
i = RealizePalette(hdc);
/* if any palette entries changed, repaint the window. */
- if (i) InvalidateRect(hWnd, NULL, TRUE);
+ if (i) InvalidateRect(hWnd, NULL, true);
ReleaseDC(hWnd, hdc);
@@ -2756,7 +2756,7 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
rc.bottom = rc.top + 2 * td->tile_hgt + td->size_oh1 + td->size_oh2;
/* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ AdjustWindowRectEx(&rc, td->dwStyle, true, td->dwExStyle);
/* Save the minimum size */
lpmmi->ptMinTrackSize.x = rc.right - rc.left;
@@ -2772,7 +2772,7 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
rc.bottom += (td->tile_hgt - 1);
/* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ AdjustWindowRectEx(&rc, td->dwStyle, true, td->dwExStyle);
/* Save maximum size */
lpmmi->ptMaxSize.x = rc.right - rc.left;
@@ -2796,16 +2796,16 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
/* was sent from inside WM_SIZE */
if (td->size_hack) return 1;
- td->size_hack = TRUE;
+ td->size_hack = true;
td->cols = (LOWORD(lParam) - td->size_ow1 - td->size_ow2) / td->tile_wid;
td->rows = (HIWORD(lParam) - td->size_oh1 - td->size_oh2) / td->tile_hgt;
term_getsize(td);
- MoveWindow(hWnd, td->pos_x, td->pos_y, td->size_wid, td->size_hgt, TRUE);
+ MoveWindow(hWnd, td->pos_x, td->pos_y, td->size_wid, td->size_hgt, true);
- td->size_hack = FALSE;
+ td->size_hack = false;
return 0;
}
@@ -2824,14 +2824,14 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
/* Unused */
/* BYTE KeyState = 0x00; */
- bool_ mc = FALSE;
- bool_ ms = FALSE;
- bool_ ma = FALSE;
+ bool mc = false;
+ bool ms = false;
+ bool ma = false;
/* Extract the modifiers */
- if (GetKeyState(VK_CONTROL) & 0x8000) mc = TRUE;
- if (GetKeyState(VK_SHIFT) & 0x8000) ms = TRUE;
- if (GetKeyState(VK_MENU) & 0x8000) ma = TRUE;
+ if (GetKeyState(VK_CONTROL) & 0x8000) mc = true;
+ if (GetKeyState(VK_SHIFT) & 0x8000) ms = true;
+ if (GetKeyState(VK_MENU) & 0x8000) ma = true;
/* Handle "special" keys */
if (special_key[(byte)(wParam)] || (ma && !ignore_key[(byte)(wParam)]) )
@@ -2872,7 +2872,7 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
case WM_PALETTECHANGED:
{
/* ignore if palette change caused by itself */
- if ((HWND)wParam == hWnd) return FALSE;
+ if ((HWND)wParam == hWnd) return false;
/* otherwise, fall through!!! */
}
@@ -2880,10 +2880,10 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
{
if (!paletted) return 0;
hdc = GetDC(hWnd);
- SelectPalette(hdc, hPal, FALSE);
+ SelectPalette(hdc, hPal, false);
i = RealizePalette(hdc);
/* if any palette entries changed, repaint the window. */
- if (i) InvalidateRect(hWnd, NULL, TRUE);
+ if (i) InvalidateRect(hWnd, NULL, true);
ReleaseDC(hWnd, hdc);
return 0;
}
@@ -2899,7 +2899,7 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
{
if (td->visible)
{
- td->visible = FALSE;
+ td->visible = false;
ShowWindow(td->w, SW_HIDE);
}
@@ -3251,13 +3251,13 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
/* Initialize the keypress analyzer */
for (i = 0; special_key_list[i]; ++i)
{
- special_key[special_key_list[i]] = TRUE;
+ special_key[special_key_list[i]] = true;
}
/* Determine if display is 16/256/true color */
hdc = GetDC(NULL);
colors16 = (GetDeviceCaps(hdc, BITSPIXEL) == 4);
- paletted = ((GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) ? TRUE : FALSE);
+ paletted = ((GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) ? true : false);
ReleaseDC(NULL, hdc);
/* Initialize the colors */
@@ -3323,12 +3323,12 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
inkey();
/* We are now initialized */
- initialized = TRUE;
+ initialized = true;
/* Did the user double click on a save file? */
check_for_save_file(lpCmdLine);
- game_in_progress = TRUE;
+ game_in_progress = true;
play_game();
/* Prompt the user */
@@ -3343,7 +3343,7 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
/* Initialize the keypress analyzer */
for (i = 0; ignore_key_list[i]; ++i)
{
- ignore_key[ignore_key_list[i]] = TRUE;
+ ignore_key[ignore_key_list[i]] = true;
}
/* Paranoia */
diff --git a/src/main-x11.cc b/src/main-x11.cc
index dcc36498..dc14a174 100644
--- a/src/main-x11.cc
+++ b/src/main-x11.cc
@@ -1254,10 +1254,10 @@ static void react_keypress(XKeyEvent *xev)
ks1 = (unsigned int)(ks);
/* Extract four "modifier flags" */
- mc = (ev->state & ControlMask) ? TRUE : FALSE;
- ms = (ev->state & ShiftMask) ? TRUE : FALSE;
- mo = (ev->state & Mod1Mask) ? TRUE : FALSE;
- mx = (ev->state & Mod2Mask) ? TRUE : FALSE;
+ mc = (ev->state & ControlMask) ? true : false;
+ ms = (ev->state & ShiftMask) ? true : false;
+ mo = (ev->state & Mod1Mask) ? true : false;
+ mx = (ev->state & Mod2Mask) ? true : false;
/* Normal keys with no modifiers */
@@ -1334,7 +1334,7 @@ static void react_keypress(XKeyEvent *xev)
/*
* Process events
*/
-static errr CheckEvent(term_data *old_td, bool_ wait)
+static errr CheckEvent(term_data *old_td, bool wait)
{
XEvent xev_body, *xev = &xev_body;
@@ -1582,7 +1582,7 @@ static void Term_xtra_x11(void *data, int n, int v)
/* Flush the events XXX */
case TERM_XTRA_FLUSH:
- while (!CheckEvent(td, FALSE));
+ while (!CheckEvent(td, false));
return;
/* Handle change in the "level" */
diff --git a/src/main.cc b/src/main.cc
index b780eb4f..e92f1853 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -51,7 +51,7 @@ static void quit_hook(const char *s)
/*
* Check existence of ".ToME/" directory in the user's
* home directory or try to create it if it doesn't exist.
- * Returns FALSE if all the attempts fail.
+ * Returns false if all the attempts fail.
*/
static void init_save_dir()
{
diff --git a/src/melee1.cc b/src/melee1.cc
index c533d021..1f4dc573 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -98,10 +98,10 @@ static int check_hit(int power, int level)
ac = p_ptr->ac + p_ptr->to_a;
/* Power and Level compete against Armor */
- if ((i > 0) && (randint(i - luck( -10, 10)) > ((ac * 3) / 4))) return (TRUE);
+ if ((i > 0) && (randint(i - luck( -10, 10)) > ((ac * 3) / 4))) return true;
/* Assume miss */
- return (FALSE);
+ return false;
}
@@ -223,7 +223,7 @@ int get_attack_power(int effect)
/*
* Attack the player via physical attacks.
*/
-bool_ carried_make_attack_normal(int r_idx)
+bool carried_make_attack_normal(int r_idx)
{
auto const &r_info = game->edit_data.r_info;
@@ -237,10 +237,10 @@ bool_ carried_make_attack_normal(int r_idx)
char ddesc[80] = "your symbiote";
auto sym_name = symbiote_name(true);
- bool_ alive = TRUE;
+ bool alive = true;
/* Not allowed to attack */
- if (r_ptr->flags & RF_NEVER_BLOW) return (FALSE);
+ if (r_ptr->flags & RF_NEVER_BLOW) return false;
/* Total armor */
ac = p_ptr->ac + p_ptr->to_a;
@@ -481,7 +481,7 @@ bool_ carried_make_attack_normal(int r_idx)
damage -= (damage * ((ac < 150) ? ac : 150) / 250);
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
@@ -515,7 +515,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_POISON:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Take "poison" effect */
@@ -530,7 +530,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_UN_BONUS:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Allow complete resist */
@@ -546,7 +546,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_UN_POWER:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
}
@@ -554,7 +554,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EAT_GOLD:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
}
@@ -562,7 +562,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EAT_ITEM:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
}
@@ -570,7 +570,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EAT_FOOD:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
}
@@ -578,7 +578,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EAT_LITE:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
}
@@ -589,7 +589,7 @@ bool_ carried_make_attack_normal(int r_idx)
msg_print("You are covered in acid!");
/* Special damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
acid_dam(damage, ddesc);
break;
@@ -601,7 +601,7 @@ bool_ carried_make_attack_normal(int r_idx)
msg_print("You are struck by electricity!");
/* Special damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
elec_dam(damage, ddesc);
@@ -614,7 +614,7 @@ bool_ carried_make_attack_normal(int r_idx)
msg_print("You are enveloped in flames!");
/* Special damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
fire_dam(damage, ddesc);
@@ -627,7 +627,7 @@ bool_ carried_make_attack_normal(int r_idx)
msg_print("You are covered with frost!");
/* Special damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
cold_dam(damage, ddesc);
@@ -637,7 +637,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_BLIND:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Increase "blind" */
@@ -653,7 +653,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_CONFUSE:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Increase "confused" */
@@ -669,7 +669,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_TERRIFY:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Increase "afraid" */
@@ -696,7 +696,7 @@ bool_ carried_make_attack_normal(int r_idx)
if (p_ptr->paralyzed && (damage < 1)) damage = 1;
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Increase "paralyzed" */
@@ -720,7 +720,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_STR:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stat) */
@@ -732,7 +732,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_INT:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stat) */
@@ -744,7 +744,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_WIS:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stat) */
@@ -756,7 +756,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_DEX:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stat) */
@@ -768,7 +768,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_CON:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stat) */
@@ -780,7 +780,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_CHR:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stat) */
@@ -792,7 +792,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_LOSE_ALL:
{
/* Damage (physical) */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Damage (stats) */
@@ -812,7 +812,7 @@ bool_ carried_make_attack_normal(int r_idx)
damage -= (damage * ((ac < 150) ? ac : 150) / 250);
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Radius 8 earthquake centered at the monster */
@@ -829,7 +829,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EXP_10:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
if (p_ptr->hold_life && (rand_int(100) < 95))
@@ -856,7 +856,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EXP_20:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
if (p_ptr->hold_life && (rand_int(100) < 90))
@@ -883,7 +883,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EXP_40:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
if (p_ptr->hold_life && (rand_int(100) < 75))
@@ -910,7 +910,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_EXP_80:
{
/* Take damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
if (p_ptr->hold_life && (rand_int(100) < 50))
@@ -937,7 +937,7 @@ bool_ carried_make_attack_normal(int r_idx)
case RBE_DISEASE:
{
/* Take some damage */
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
/* Take "poison" effect */
@@ -950,7 +950,7 @@ bool_ carried_make_attack_normal(int r_idx)
if (randint(100) < 11)
{
/* 1% chance for perm. damage */
- bool_ perm = (randint(10) == 1);
+ bool perm = (randint(10) == 1);
dec_stat(A_CON, randint(10), perm);
}
@@ -1040,7 +1040,7 @@ bool_ carried_make_attack_normal(int r_idx)
break;
}
}
- carried_monster_hit = TRUE;
+ carried_monster_hit = true;
take_hit(damage, ddesc);
break;
}
@@ -1176,7 +1176,7 @@ bool_ carried_make_attack_normal(int r_idx)
}
}
/* Assume we attacked */
- return (TRUE);
+ return true;
}
/*
@@ -1196,7 +1196,7 @@ void black_breath_attack(int chance)
/*
* Attack the player via physical attacks.
*/
-bool_ make_attack_normal(int m_idx, byte divis)
+bool make_attack_normal(int m_idx, byte divis)
{
monster_type *m_ptr = &m_list[m_idx];
@@ -1215,25 +1215,25 @@ bool_ make_attack_normal(int m_idx, byte divis)
char ddesc[80];
- bool_ blinked;
- bool_ touched = FALSE;
+ bool blinked;
+ bool touched = false;
bool fear = false;
- bool_ alive = TRUE;
- bool_ explode = FALSE;
+ bool alive = true;
+ bool explode = false;
/* Not allowed to attack? */
auto r_ptr = m_ptr->race();
- if (r_ptr->flags & RF_NEVER_BLOW) return (FALSE);
+ if (r_ptr->flags & RF_NEVER_BLOW) return false;
/* ...nor if friendly */
if (is_friend(m_ptr) >= 0)
{
if (p_ptr->control == m_idx) swap_position(m_ptr->fy, m_ptr->fx);
- return FALSE;
+ return false;
}
/* Cannot attack the player if mortal and player fated to never die by the ... */
- if ((r_ptr->flags & RF_MORTAL) && (p_ptr->no_mortal)) return (FALSE);
+ if ((r_ptr->flags & RF_MORTAL) && (p_ptr->no_mortal)) return false;
/* Total armor */
ac = p_ptr->ac + p_ptr->to_a;
@@ -1250,7 +1250,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
/* Assume no blink */
- blinked = FALSE;
+ blinked = false;
/* Scan through all four blows */
for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
@@ -1442,21 +1442,21 @@ bool_ make_attack_normal(int m_idx, byte divis)
{
act = "hits you.";
do_cut = do_stun = 1;
- touched = TRUE;
+ touched = true;
break;
}
case RBM_TOUCH:
{
act = "touches you.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_PUNCH:
{
act = "punches you.";
- touched = TRUE;
+ touched = true;
do_stun = 1;
break;
}
@@ -1464,7 +1464,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
case RBM_KICK:
{
act = "kicks you.";
- touched = TRUE;
+ touched = true;
do_stun = 1;
break;
}
@@ -1472,7 +1472,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
case RBM_CLAW:
{
act = "claws you.";
- touched = TRUE;
+ touched = true;
do_cut = 1;
break;
}
@@ -1481,14 +1481,14 @@ bool_ make_attack_normal(int m_idx, byte divis)
{
act = "bites you.";
do_cut = 1;
- touched = TRUE;
+ touched = true;
break;
}
case RBM_STING:
{
act = "stings you.";
- touched = TRUE;
+ touched = true;
break;
}
@@ -1502,7 +1502,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
{
act = "butts you.";
do_stun = 1;
- touched = TRUE;
+ touched = true;
break;
}
@@ -1510,28 +1510,28 @@ bool_ make_attack_normal(int m_idx, byte divis)
{
act = "crushes you.";
do_stun = 1;
- touched = TRUE;
+ touched = true;
break;
}
case RBM_ENGULF:
{
act = "engulfs you.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CHARGE:
{
act = "charges you.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRAWL:
{
act = "crawls on you.";
- touched = TRUE;
+ touched = true;
break;
}
@@ -1550,7 +1550,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
case RBM_EXPLODE:
{
act = "explodes.";
- explode = TRUE;
+ explode = true;
break;
}
@@ -1786,7 +1786,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
msg_print("You quickly protect your money pouch!");
/* Occasional blink anyway */
- if (rand_int(3)) blinked = TRUE;
+ if (rand_int(3)) blinked = true;
}
/* Eat gold */
@@ -1837,7 +1837,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
p_ptr->window |= (PW_PLAYER);
/* Blink away */
- blinked = TRUE;
+ blinked = true;
}
break;
@@ -1857,7 +1857,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
msg_print("You grab hold of your backpack!");
/* Occasional "blink" anyway */
- blinked = TRUE;
+ blinked = true;
/* Done */
break;
@@ -1885,7 +1885,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
}
/* Get a description */
- object_desc(o_name, o_ptr, FALSE, 3);
+ object_desc(o_name, o_ptr, false, 3);
/* Message */
msg_format("%sour %s (%c) was stolen!",
@@ -1924,7 +1924,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
}
/* Forget mark */
- j_ptr->marked = FALSE;
+ j_ptr->marked = false;
/* Memorize monster */
j_ptr->held_m_idx = m_idx;
@@ -1938,7 +1938,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
inc_stack_size_ex(i, -1, OPTIMIZE, NO_DESCRIBE);
/* Blink away */
- blinked = TRUE;
+ blinked = true;
/* Done */
break;
@@ -1971,7 +1971,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (o_ptr->tval != TV_FOOD) continue;
/* Get a description */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/* Message */
msg_format("%sour %s (%c) was eaten!",
@@ -2379,7 +2379,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (randint(100) < 11)
{
/* 1% chance for perm. damage */
- bool_ perm = (randint(10) == 1);
+ bool perm = (randint(10) == 1);
dec_stat(A_CON, randint(10), perm);
}
@@ -2581,8 +2581,8 @@ bool_ make_attack_normal(int m_idx, byte divis)
{
if (mon_take_hit(m_idx, m_ptr->hp + 1, &fear, NULL))
{
- blinked = FALSE;
- alive = FALSE;
+ blinked = false;
+ alive = false;
}
}
@@ -2596,8 +2596,8 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (mon_take_hit(m_idx, damroll(2, 6), &fear,
" turns into a pile of ash."))
{
- blinked = FALSE;
- alive = FALSE;
+ blinked = false;
+ alive = false;
}
}
}
@@ -2610,8 +2610,8 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (mon_take_hit(m_idx, damroll(2, 6), &fear,
" turns into a pile of cinder."))
{
- blinked = FALSE;
- alive = FALSE;
+ blinked = false;
+ alive = false;
}
}
}
@@ -2622,8 +2622,8 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (mon_take_hit(m_idx, damroll(p_ptr->shield_power_opt, p_ptr->shield_power_opt2), &fear,
" is bashed by your mystic shield."))
{
- blinked = FALSE;
- alive = FALSE;
+ blinked = false;
+ alive = false;
}
}
@@ -2635,8 +2635,8 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (mon_take_hit(m_idx, damroll(p_ptr->shield_power_opt, p_ptr->shield_power_opt2), &fear,
" is burned by your fiery shield."))
{
- blinked = FALSE;
- alive = FALSE;
+ blinked = false;
+ alive = false;
}
}
}
@@ -2647,8 +2647,8 @@ bool_ make_attack_normal(int m_idx, byte divis)
if (mon_take_hit(m_idx, damroll(p_ptr->shield_power_opt, p_ptr->shield_power_opt2), &fear,
" is burned by your fiery shield."))
{
- blinked = FALSE;
- alive = FALSE;
+ blinked = false;
+ alive = false;
}
}
@@ -2669,7 +2669,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
}
}
- touched = FALSE;
+ touched = false;
}
}
@@ -2722,7 +2722,7 @@ bool_ make_attack_normal(int m_idx, byte divis)
}
/* Assume we attacked */
- return (TRUE);
+ return true;
}
diff --git a/src/melee1.hpp b/src/melee1.hpp
index aaeb3cff..f70d8b05 100644
--- a/src/melee1.hpp
+++ b/src/melee1.hpp
@@ -3,5 +3,5 @@
#include "h-basic.hpp"
int get_attack_power(int effect);
-bool_ carried_make_attack_normal(int r_idx);
-bool_ make_attack_normal(int m_idx, byte divis);
+bool carried_make_attack_normal(int r_idx);
+bool make_attack_normal(int m_idx, byte divis);
diff --git a/src/melee2.cc b/src/melee2.cc
index 8892fc39..67d7d844 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -557,7 +557,7 @@ static void remove_bad_spells(int m_idx, monster_spell_flag_set *spells_p)
* Determine if there is a space near the player in which
* a summoned creature can appear
*/
-static bool_ summon_possible(int y1, int x1)
+static bool summon_possible(int y1, int x1)
{
int y, x;
@@ -577,18 +577,18 @@ static bool_ summon_possible(int y1, int x1)
if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
/* Nor on the between */
- if (cave[y][x].feat == FEAT_BETWEEN) return (FALSE);
+ if (cave[y][x].feat == FEAT_BETWEEN) return false;
/* ...nor on the Pattern */
if ((cave[y][x].feat >= FEAT_PATTERN_START)
&& (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue;
/* Require empty floor grid in line of sight */
- if (cave_empty_bold(y, x) && los(y1, x1, y, x)) return (TRUE);
+ if (cave_empty_bold(y, x) && los(y1, x1, y, x)) return true;
}
}
- return FALSE;
+ return false;
}
@@ -596,10 +596,10 @@ static bool_ summon_possible(int y1, int x1)
/*
* Determine if a bolt spell will hit the player.
*
- * This is exactly like "projectable", but it will return FALSE if a monster
+ * This is exactly like "projectable", but it will return false if a monster
* is in the way.
*/
-static bool_ clean_shot(int y1, int x1, int y2, int x2)
+static bool clean_shot(int y1, int x1, int y2, int x2)
{
int dist, y, x;
@@ -619,14 +619,14 @@ static bool_ clean_shot(int y1, int x1, int y2, int x2)
}
/* Check for arrival at "final target" */
- if ((x == x2) && (y == y2)) return (TRUE);
+ if ((x == x2) && (y == y2)) return true;
/* Calculate the new location */
mmove2(&y, &x, y1, x1, y2, x2);
}
/* Assume obstruction */
- return (FALSE);
+ return false;
}
@@ -1155,7 +1155,7 @@ static bool monst_spell_monst(int m_idx)
{
if (friendly)
{
- count += summon_specific_friendly(m_ptr->fy, m_ptr->fx, rlev, friendly_type, TRUE);
+ count += summon_specific_friendly(m_ptr->fy, m_ptr->fx, rlev, friendly_type, true);
}
else if (!friendly)
{
@@ -2071,7 +2071,7 @@ static bool monst_spell_monst(int m_idx)
break;
}
- bool_ resists_tele = FALSE;
+ bool resists_tele = false;
disturb_on_other();
monster_msg("%^s teleports %s away.", m_name, t_name);
@@ -2083,7 +2083,7 @@ static bool monst_spell_monst(int m_idx)
{
monster_msg("%^s is unaffected!", t_name);
}
- resists_tele = TRUE;
+ resists_tele = true;
}
else if (t_ptr->level > randint(100))
{
@@ -2091,7 +2091,7 @@ static bool monst_spell_monst(int m_idx)
{
monster_msg("%^s resists!", t_name);
}
- resists_tele = TRUE;
+ resists_tele = true;
}
}
@@ -2325,7 +2325,7 @@ static bool monst_spell_monst(int m_idx)
void curse_equipment(int chance, int heavy_chance)
{
- bool_ changed = FALSE;
+ bool changed = false;
object_type * o_ptr =
&p_ptr->inventory[rand_range(INVEN_WIELD, INVEN_TOTAL - 1)];
@@ -2345,7 +2345,7 @@ void curse_equipment(int chance, int heavy_chance)
if ((flags & TR_BLESSED) && (randint(888) > chance))
{
char o_name[256];
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("Your %s resist%s cursing!", o_name,
((o_ptr->number > 1) ? "" : "s"));
/* Hmmm -- can we wear multiple items? If not, this is unnecessary */
@@ -2356,14 +2356,14 @@ void curse_equipment(int chance, int heavy_chance)
(o_ptr->name1 || o_ptr->name2 || (!o_ptr->artifact_name.empty())))
{
if (!(flags & TR_HEAVY_CURSE))
- changed = TRUE;
+ changed = true;
o_ptr->art_flags |= TR_HEAVY_CURSE;
o_ptr->art_flags |= TR_CURSED;
}
else
{
if (!(o_ptr->art_flags & TR_CURSED))
- changed = TRUE;
+ changed = true;
o_ptr->art_flags |= TR_CURSED;
}
@@ -2380,7 +2380,7 @@ void curse_equipment(int chance, int heavy_chance)
void curse_equipment_dg(int chance, int heavy_chance)
{
- bool_ changed = FALSE;
+ bool changed = false;
object_type * o_ptr =
&p_ptr->inventory[rand_range(INVEN_WIELD, INVEN_TOTAL - 1)];
@@ -2401,7 +2401,7 @@ void curse_equipment_dg(int chance, int heavy_chance)
if ((flags & TR_BLESSED) && (randint(888) > chance))
{
char o_name[256];
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("Your %s resist%s cursing!", o_name,
((o_ptr->number > 1) ? "" : "s"));
return;
@@ -2411,7 +2411,7 @@ void curse_equipment_dg(int chance, int heavy_chance)
(o_ptr->name1 || o_ptr->name2 || (!o_ptr->artifact_name.empty())))
{
if (!(flags & TR_HEAVY_CURSE))
- changed = TRUE;
+ changed = true;
o_ptr->art_flags |= TR_HEAVY_CURSE;
o_ptr->art_flags |= TR_CURSED;
o_ptr->art_flags |= TR_DG_CURSE;
@@ -2419,7 +2419,7 @@ void curse_equipment_dg(int chance, int heavy_chance)
else
{
if (!(flags & TR_CURSED))
- changed = TRUE;
+ changed = true;
o_ptr->art_flags |= TR_CURSED;
o_ptr->art_flags |= TR_DG_CURSE;
}
@@ -2438,7 +2438,7 @@ void curse_equipment_dg(int chance, int heavy_chance)
/*
* Creatures can cast spells, shoot missiles, and breathe.
*
- * Returns "TRUE" if a spell (or whatever) was (successfully) cast.
+ * Returns "true" if a spell (or whatever) was (successfully) cast.
*
* XXX XXX XXX This function could use some work, but remember to
* keep it as optimized as possible, while retaining generic code.
@@ -2475,7 +2475,7 @@ void curse_equipment_dg(int chance, int heavy_chance)
* Note the special "MFLAG_NICE" flag, which prevents a monster from using
* any spell attacks until the player has had a single chance to move.
*/
-static bool_ make_attack_spell(int m_idx)
+static bool make_attack_spell(int m_idx)
{
static const auto SF_BOLT_MASK = compute_bolt_mask();
static const auto SF_SUMMON_MASK = compute_summoning_mask();
@@ -2484,55 +2484,55 @@ static bool_ make_attack_spell(int m_idx)
int chance, rlev, failrate;
char m_name[80];
- bool_ no_inate = FALSE;
+ bool no_inate = false;
/* Extract the blind-ness */
- bool_ blind = (p_ptr->blind ? TRUE : FALSE);
+ bool blind = (p_ptr->blind ? true : false);
/* Get a pointer to the monster */
monster_type *m_ptr = &m_list[m_idx];
/* Extract the "see-able-ness" */
- bool_ seen = (!blind && m_ptr->ml);
+ bool seen = (!blind && m_ptr->ml);
/* Target location */
if (m_ptr->target != 0)
{
- return FALSE;
+ return false;
}
int y = p_ptr->py;
int x = p_ptr->px;
/* Cannot cast spells when confused */
- if (m_ptr->confused) return (FALSE);
+ if (m_ptr->confused) return false;
/* Cannot cast spells when nice */
- if (m_ptr->mflag & (MFLAG_NICE)) return (FALSE);
- if (is_friend(m_ptr) >= 0) return (FALSE);
+ if (m_ptr->mflag & (MFLAG_NICE)) return false;
+ if (is_friend(m_ptr) >= 0) return false;
/* Cannot attack the player if mortal and player fated to never die by the ... */
auto const r_ptr = m_ptr->race();
- if ((r_ptr->flags & RF_MORTAL) && (p_ptr->no_mortal)) return (FALSE);
+ if ((r_ptr->flags & RF_MORTAL) && (p_ptr->no_mortal)) return false;
/* Hack -- Extract the spell probability */
chance = (r_ptr->freq_inate + r_ptr->freq_spell) / 2;
/* Not allowed to cast spells */
- if (!chance) return (FALSE);
+ if (!chance) return false;
/* Only do spells occasionally */
- if (rand_int(100) >= chance) return (FALSE);
+ if (rand_int(100) >= chance) return false;
/* Sometimes forbid inate attacks (breaths) */
- if (rand_int(100) >= (chance * 2)) no_inate = TRUE;
+ if (rand_int(100) >= (chance * 2)) no_inate = true;
/* Require projectable player */
{
/* Check range */
- if (m_ptr->cdis > MAX_RANGE) return (FALSE);
+ if (m_ptr->cdis > MAX_RANGE) return false;
/* Check path */
- if (!projectable(m_ptr->fy, m_ptr->fx, y, x)) return (FALSE);
+ if (!projectable(m_ptr->fy, m_ptr->fx, y, x)) return false;
}
/* Extract the monster level */
@@ -2556,14 +2556,14 @@ static bool_ make_attack_spell(int m_idx)
allowed_spells &= SF_INT_MASK;
/* No spells left? */
- if (!allowed_spells) return (FALSE);
+ if (!allowed_spells) return false;
}
/* Remove the "ineffective" spells */
remove_bad_spells(m_idx, &allowed_spells);
/* No spells left */
- if (!allowed_spells) return (FALSE);
+ if (!allowed_spells) return false;
/* Check for a clean bolt shot */
if ((allowed_spells & SF_BOLT_MASK) &&
@@ -2584,19 +2584,19 @@ static bool_ make_attack_spell(int m_idx)
}
/* No spells left */
- if (!allowed_spells) return (FALSE);
+ if (!allowed_spells) return false;
/* Extract the "inate" spells */
auto spell = extract_spells(allowed_spells);
/* No spells left */
- if (spell.empty()) return (FALSE);
+ if (spell.empty()) return false;
/* Stop if player is dead or gone */
- if (!alive || death) return (FALSE);
+ if (!alive || death) return false;
/* Stop if player is leaving */
- if (p_ptr->leaving) return (FALSE);
+ if (p_ptr->leaving) return false;
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0x00);
@@ -2605,7 +2605,7 @@ static bool_ make_attack_spell(int m_idx)
auto thrown_spell = choose_attack_spell(m_idx, spell);
/* Abort if no spell was chosen */
- if (!thrown_spell) return (FALSE);
+ if (!thrown_spell) return false;
/* Calculate spell failure rate */
failrate = 25 - (rlev + 3) / 4;
@@ -2619,7 +2619,7 @@ static bool_ make_attack_spell(int m_idx)
/* Message */
msg_format("%^s tries to cast a spell, but fails.", m_name);
- return (TRUE);
+ return true;
}
/* Can the player disrupt its puny attempts? */
@@ -3818,7 +3818,7 @@ static bool_ make_attack_spell(int m_idx)
}
/* A spell was cast */
- return (TRUE);
+ return true;
}
@@ -3844,16 +3844,16 @@ static int mon_will_run(int m_idx)
u32b p_val, m_val;
/* Keep monsters from running too far away */
- if (m_ptr->cdis > MAX_SIGHT + 5) return (FALSE);
+ if (m_ptr->cdis > MAX_SIGHT + 5) return false;
/* Friends don't run away */
- if (is_friend(m_ptr) >= 0) return (FALSE);
+ if (is_friend(m_ptr) >= 0) return false;
/* All "afraid" monsters will run away */
- if (m_ptr->monfear) return (TRUE);
+ if (m_ptr->monfear) return true;
/* Nearby monsters will not become terrified */
- if (m_ptr->cdis <= 5) return (FALSE);
+ if (m_ptr->cdis <= 5) return false;
/* Examine player power (level) */
p_lev = p_ptr->lev;
@@ -3862,8 +3862,8 @@ static int mon_will_run(int m_idx)
m_lev = m_ptr->level + (m_idx & 0x08) + 25;
/* Optimize extreme cases below */
- if (m_lev > p_lev + 4) return (FALSE);
- if (m_lev + 4 <= p_lev) return (TRUE);
+ if (m_lev > p_lev + 4) return false;
+ if (m_lev + 4 <= p_lev) return true;
/* Examine player health */
p_chp = p_ptr->chp;
@@ -3878,10 +3878,10 @@ static int mon_will_run(int m_idx)
m_val = (m_lev * m_mhp) + (m_chp << 2); /* div m_mhp */
/* Strong players scare strong monsters */
- if (p_val * m_mhp > m_val * p_mhp) return (TRUE);
+ if (p_val * m_mhp > m_val * p_mhp) return true;
/* Assume no terror */
- return (FALSE);
+ return false;
}
@@ -3917,12 +3917,12 @@ static int mon_will_run(int m_idx)
* but instead of heading directly for it, the monster should "swerve"
* around the player so that he has a smaller chance of getting hit.
*/
-static bool_ get_fear_moves_aux(int m_idx, int *yp, int *xp)
+static bool get_fear_moves_aux(int m_idx, int *yp, int *xp)
{
/* Monster flowing disabled */
if (!options->flow_by_sound)
{
- return (FALSE);
+ return false;
}
/* Monster location */
@@ -3938,13 +3938,13 @@ static bool_ get_fear_moves_aux(int m_idx, int *yp, int *xp)
if (cave[fy][fx].when < cave[p_ptr->py][p_ptr->px].when)
{
/* No reason to attempt flowing */
- return (FALSE);
+ return false;
}
/* Monster is too far away to use flow information */
auto const r_ptr = m_ptr->race();
- if (cave[fy][fx].cost > MONSTER_FLOW_DEPTH) return (FALSE);
- if (cave[fy][fx].cost > r_ptr->aaf) return (FALSE);
+ if (cave[fy][fx].cost > MONSTER_FLOW_DEPTH) return false;
+ if (cave[fy][fx].cost > r_ptr->aaf) return false;
/* Loop state */
int when = 0;
@@ -3989,14 +3989,14 @@ static bool_ get_fear_moves_aux(int m_idx, int *yp, int *xp)
}
/* No legal move (?) */
- if (!when) return (FALSE);
+ if (!when) return false;
/* Find deltas */
(*yp) = fy - gy;
(*xp) = fx - gx;
/* Success */
- return (TRUE);
+ return true;
}
@@ -4011,9 +4011,9 @@ static bool_ get_fear_moves_aux(int m_idx, int *yp, int *xp)
* This function may take lots of CPU time if lots of monsters are
* fleeing.
*
-* Return TRUE if a safe location is available.
+* Return true if a safe location is available.
*/
-static bool_ find_safety(int m_idx, int *yp, int *xp)
+static bool find_safety(int m_idx, int *yp, int *xp)
{
monster_type *m_ptr = &m_list[m_idx];
@@ -4075,12 +4075,12 @@ static bool_ find_safety(int m_idx, int *yp, int *xp)
(*xp) = fx - gx;
/* Found safe place */
- return (TRUE);
+ return true;
}
}
/* No safe place */
- return (FALSE);
+ return false;
}
@@ -4090,9 +4090,9 @@ static bool_ find_safety(int m_idx, int *yp, int *xp)
* Pack monsters will use this to "ambush" the player and lure him out
* of corridors into open space so they can swarm him.
*
- * Return TRUE if a good location is available.
+ * Return true if a good location is available.
*/
-static bool_ find_hiding(int m_idx, int *yp, int *xp)
+static bool find_hiding(int m_idx, int *yp, int *xp)
{
monster_type *m_ptr = &m_list[m_idx];
@@ -4147,12 +4147,12 @@ static bool_ find_hiding(int m_idx, int *yp, int *xp)
(*xp) = fx - gx;
/* Found good place */
- return (TRUE);
+ return true;
}
}
/* No good place */
- return (FALSE);
+ return false;
}
@@ -4266,7 +4266,7 @@ static void get_target_monster(int m_idx)
/*
* Choose "logical" directions for monster movement
*/
-static bool_ get_moves(int m_idx, int *mm)
+static bool get_moves(int m_idx, int *mm)
{
monster_type *m_ptr = &m_list[m_idx];
@@ -4274,7 +4274,7 @@ static bool_ get_moves(int m_idx, int *mm)
int y2 = p_ptr->py;
int x2 = p_ptr->px;
- bool_ done = FALSE;
+ bool done = false;
/* Oups get nearer */
if ((is_friend(m_ptr) > 0) && (m_ptr->cdis > p_ptr->pet_follow_distance))
@@ -4356,7 +4356,7 @@ static bool_ get_moves(int m_idx, int *mm)
{
if (!los(m_ptr->fy, m_ptr->fx, y2, x2))
{
- return (FALSE);
+ return false;
}
}
@@ -4390,7 +4390,7 @@ static bool_ get_moves(int m_idx, int *mm)
if ((room < 8) && (p_ptr->chp > ((p_ptr->mhp * 3) / 4)))
{
/* Find hiding place */
- if (find_hiding(m_idx, &y, &x)) done = TRUE;
+ if (find_hiding(m_idx, &y, &x)) done = true;
}
}
@@ -4428,7 +4428,7 @@ static bool_ get_moves(int m_idx, int *mm)
x = m_ptr->fx - x2;
/* Done */
- done = TRUE;
+ done = true;
}
}
@@ -4466,7 +4466,7 @@ static bool_ get_moves(int m_idx, int *mm)
/* Check for no move */
- if (!x && !y) return (FALSE);
+ if (!x && !y) return false;
/* Extract the "absolute distances" */
int ay = ABS(y);
@@ -4635,7 +4635,7 @@ static bool_ get_moves(int m_idx, int *mm)
/* Wants to move... */
- return (TRUE);
+ return true;
}
@@ -4653,20 +4653,20 @@ int check_hit2(int power, int level, int ac)
i = (power + (level * 3));
/* Power and Level compete against Armor */
- if ((i > 0) && (randint(i) > ((ac * 3) / 4))) return (TRUE);
+ if ((i > 0) && (randint(i) > ((ac * 3) / 4))) return true;
/* Assume miss */
- return (FALSE);
+ return false;
}
/* Monster attacks monster */
-static bool_ monst_attack_monst(int m_idx, int t_idx)
+static bool monst_attack_monst(int m_idx, int t_idx)
{
char temp[80];
- bool_ blinked = FALSE;
- bool_ touched = FALSE;
- bool_ explode = FALSE;
+ bool blinked = false;
+ bool touched = false;
+ bool explode = false;
monster_type *t_ptr = &m_list[t_idx];
byte y_saver = t_ptr->fy;
byte x_saver = t_ptr->fx;
@@ -4677,7 +4677,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
const auto tr_ptr = t_ptr->race();
/* Not allowed to attack */
- if (r_ptr->flags & RF_NEVER_BLOW) return FALSE;
+ if (r_ptr->flags & RF_NEVER_BLOW) return false;
/* Total armor */
const int ac = t_ptr->ac;
@@ -4698,7 +4698,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
monster_desc(ddesc, m_ptr, 0x88);
/* Assume no blink */
- blinked = FALSE;
+ blinked = false;
if (!(m_ptr->ml || t_ptr->ml))
{
@@ -4754,49 +4754,49 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
case RBM_HIT:
{
act = "hits %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_TOUCH:
{
act = "touches %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_PUNCH:
{
act = "punches %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_KICK:
{
act = "kicks %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CLAW:
{
act = "claws %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_BITE:
{
act = "bites %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_STING:
{
act = "stings %s.";
- touched = TRUE;
+ touched = true;
break;
}
@@ -4809,92 +4809,92 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
case RBM_BUTT:
{
act = "butts %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRUSH:
{
act = "crushes %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_ENGULF:
{
act = "engulfs %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CHARGE:
{
act = "charges %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_CRAWL:
{
act = "crawls on %s.";
- touched = TRUE;
+ touched = true;
break;
}
case RBM_DROOL:
{
act = "drools on %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_SPIT:
{
act = "spits on %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_EXPLODE:
{
act = "explodes.";
- explode = TRUE;
- touched = FALSE;
+ explode = true;
+ touched = false;
break;
}
case RBM_GAZE:
{
act = "gazes at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_WAIL:
{
act = "wails at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_SPORE:
{
act = "releases spores at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_XXX4:
{
act = "projects XXX4's at %s.";
- touched = FALSE;
+ touched = false;
break;
}
case RBM_BEG:
{
act = "begs %s for money.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -4902,7 +4902,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
case RBM_INSULT:
{
act = "insults %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -4910,7 +4910,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
case RBM_MOAN:
{
act = "moans at %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -4918,7 +4918,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
case RBM_SHOW:
{
act = "sings to %s.";
- touched = FALSE;
+ touched = false;
t_ptr->csleep = 0;
break;
}
@@ -4984,7 +4984,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
case RBE_EAT_GOLD:
{
pt = damage = 0;
- if (randint(2) == 1) blinked = TRUE;
+ if (randint(2) == 1) blinked = true;
break;
}
@@ -5094,7 +5094,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
{
if (m_ptr->ml || t_ptr->ml)
{
- blinked = FALSE;
+ blinked = false;
monster_msg("%^s is suddenly very hot!", m_name);
}
project(t_idx, 0, m_ptr->fy, m_ptr->fx,
@@ -5108,7 +5108,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
{
if (m_ptr->ml || t_ptr->ml)
{
- blinked = FALSE;
+ blinked = false;
monster_msg("%^s gets zapped!", m_name);
}
project(t_idx, 0, m_ptr->fy, m_ptr->fx,
@@ -5160,7 +5160,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
{
mon_take_hit_mon(m_idx, m_idx, m_ptr->hp + 1, " explodes into tiny shreds.");
- blinked = FALSE;
+ blinked = false;
}
@@ -5179,7 +5179,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
teleport_away(m_idx, MAX_SIGHT * 2 + 5);
}
- return TRUE;
+ return true;
}
@@ -5189,7 +5189,7 @@ static bool_ monst_attack_monst(int m_idx, int t_idx)
static u32b noise = 0L;
/* Determine whether the player is invisible to a monster */
-static bool_ player_invis(monster_type * m_ptr)
+static bool player_invis(monster_type * m_ptr)
{
const auto r_ptr = m_ptr->race();
s16b inv = p_ptr->invis;
@@ -5250,7 +5250,7 @@ static bool_ player_invis(monster_type * m_ptr)
*
* A "direction" of "5" means "pick a random direction".
*/
-static void process_monster(int m_idx, bool_ is_frien)
+static void process_monster(int m_idx, bool is_frien)
{
auto const &f_info = game->edit_data.f_info;
@@ -5259,7 +5259,7 @@ static void process_monster(int m_idx, bool_ is_frien)
int mm[8];
monster_type *m_ptr = &m_list[m_idx];
- const bool_ inv = player_invis(m_ptr);
+ const bool inv = player_invis(m_ptr);
auto const r_ptr = m_ptr->race();
if (r_ptr->flags & RF_DOPPLEGANGER) doppleganger = m_idx;
@@ -5470,16 +5470,16 @@ static void process_monster(int m_idx, bool_ is_frien)
}
/* Do the monster get angry? */
- bool_ gets_angry = FALSE;
+ bool gets_angry = false;
/* No one wants to be your friend if you're aggravating */
if ((m_ptr->status > MSTATUS_NEUTRAL) && (m_ptr->status < MSTATUS_COMPANION) && (p_ptr->aggravate) && !(r_ptr->flags & RF_PET))
- gets_angry = TRUE;
+ gets_angry = true;
/* Paranoia... no friendly uniques outside wizard mode -- TY */
if ((m_ptr->status > MSTATUS_NEUTRAL) && (m_ptr->status < MSTATUS_COMPANION) && !(wizard) &&
(r_ptr->flags & RF_UNIQUE) && !(r_ptr->flags & RF_PET))
- gets_angry = TRUE;
+ gets_angry = true;
if (gets_angry)
{
@@ -5587,13 +5587,13 @@ static void process_monster(int m_idx, bool_ is_frien)
* Attempt to cast a spell at an enemy other than the player
* (may slow the game a smidgeon, but I haven't noticed.)
*/
- hack_message_pain_may_silent = TRUE;
+ hack_message_pain_may_silent = true;
if (monst_spell_monst(m_idx))
{
- hack_message_pain_may_silent = FALSE;
+ hack_message_pain_may_silent = false;
return;
}
- hack_message_pain_may_silent = FALSE;
+ hack_message_pain_may_silent = false;
/* Hack -- Assume no movement */
@@ -5601,7 +5601,7 @@ static void process_monster(int m_idx, bool_ is_frien)
mm[4] = mm[5] = mm[6] = mm[7] = 0;
/* Confused -- 100% random */
- if (m_ptr->confused || (inv == TRUE && m_ptr->target == 0))
+ if (m_ptr->confused || (inv == true && m_ptr->target == 0))
{
/* Try four "random" directions */
mm[0] = mm[1] = mm[2] = mm[3] = 5;
@@ -5644,13 +5644,13 @@ static void process_monster(int m_idx, bool_ is_frien)
if (!c_ptr->m_idx) return;
/* Assume nothing */
- bool_ do_turn = FALSE;
- bool_ do_move = FALSE;
- bool_ do_view = FALSE;
+ bool do_turn = false;
+ bool do_move = false;
+ bool do_view = false;
/* Assume nothing */
- bool_ did_open_door = FALSE;
- bool_ did_bash_door = FALSE;
+ bool did_open_door = false;
+ bool did_bash_door = false;
/* Take a zero-terminated array of "directions" */
for (i = 0; mm[i]; i++)
@@ -5676,7 +5676,7 @@ static void process_monster(int m_idx, bool_ is_frien)
if (cave_floor_bold(ny, nx))
{
/* Go ahead and move */
- do_move = TRUE;
+ do_move = true;
}
/* Hack -- check for Glyph of Warding */
@@ -5684,7 +5684,7 @@ static void process_monster(int m_idx, bool_ is_frien)
!(r_ptr->flags & RF_NEVER_BLOW))
{
/* Assume no move allowed */
- do_move = FALSE;
+ do_move = false;
/* Break the ward */
if (randint(BREAK_GLYPH) < m_ptr->level)
@@ -5702,14 +5702,14 @@ static void process_monster(int m_idx, bool_ is_frien)
place_floor_convert_glass(ny, nx);
/* Allow movement */
- do_move = TRUE;
+ do_move = true;
}
}
/* Hack -- trees are obstacle */
else if ((cave[ny][nx].feat == FEAT_TREES) && (r_ptr->flags & RF_KILL_TREES))
{
- do_move = TRUE;
+ do_move = true;
/* Forget the tree */
c_ptr->info &= ~(CAVE_MARK);
@@ -5721,13 +5721,13 @@ static void process_monster(int m_idx, bool_ is_frien)
/* Hack -- player 'in' wall */
else if ((ny == p_ptr->py) && (nx == p_ptr->px))
{
- do_move = TRUE;
+ do_move = true;
}
else if (c_ptr->m_idx)
{
/* Possibly a monster to attack */
- do_move = TRUE;
+ do_move = true;
}
/* Permanent wall */
@@ -5741,28 +5741,28 @@ static void process_monster(int m_idx, bool_ is_frien)
else if ((f_info[c_ptr->feat].flags & FF_CAN_LEVITATE) && (r_ptr->flags & RF_CAN_FLY))
{
/* Pass through walls/doors/rubble */
- do_move = TRUE;
+ do_move = true;
}
/* Some monsters can fly */
else if ((f_info[c_ptr->feat].flags & FF_CAN_FLY) && (r_ptr->flags & RF_CAN_FLY))
{
/* Pass through trees/... */
- do_move = TRUE;
+ do_move = true;
}
/* Monster moves through walls (and doors) */
else if ((f_info[c_ptr->feat].flags & FF_CAN_PASS) && (r_ptr->flags & RF_PASS_WALL))
{
/* Pass through walls/doors/rubble */
- do_move = TRUE;
+ do_move = true;
}
/* Monster destroys walls (and doors) */
else if ((f_info[c_ptr->feat].flags & FF_CAN_PASS) && (r_ptr->flags & RF_KILL_WALL))
{
/* Eat through walls/doors/rubble */
- do_move = TRUE;
+ do_move = true;
if (randint(GRINDNOISE) == 1)
{
@@ -5776,14 +5776,14 @@ static void process_monster(int m_idx, bool_ is_frien)
cave_set_feat(ny, nx, FEAT_FLOOR);
/* Note changes to viewable region */
- if (player_has_los_bold(ny, nx)) do_view = TRUE;
+ if (player_has_los_bold(ny, nx)) do_view = true;
}
/* Monster moves through walls (and doors) */
else if ((f_info[c_ptr->feat].flags & FF_CAN_PASS) && (r_ptr->flags & RF_PASS_WALL))
{
/* Pass through walls/doors/rubble */
- do_move = TRUE;
+ do_move = true;
}
/* Monster moves through webs */
@@ -5791,7 +5791,7 @@ static void process_monster(int m_idx, bool_ is_frien)
(r_ptr->flags & RF_SPIDER))
{
/* Pass through webs */
- do_move = TRUE;
+ do_move = true;
}
/* Handle doors and secret doors */
@@ -5799,10 +5799,10 @@ static void process_monster(int m_idx, bool_ is_frien)
(c_ptr->feat <= FEAT_DOOR_TAIL)) ||
(c_ptr->feat == FEAT_SECRET))
{
- bool_ may_bash = TRUE;
+ bool may_bash = true;
/* Take a turn */
- do_turn = TRUE;
+ do_turn = true;
if ((r_ptr->flags & RF_OPEN_DOOR) &&
((is_friend(m_ptr) <= 0) || p_ptr->pet_open_doors))
@@ -5812,10 +5812,10 @@ static void process_monster(int m_idx, bool_ is_frien)
(c_ptr->feat == FEAT_SECRET))
{
/* The door is open */
- did_open_door = TRUE;
+ did_open_door = true;
/* Do not bash the door */
- may_bash = FALSE;
+ may_bash = false;
}
/* Locked doors (not jammed) */
@@ -5833,7 +5833,7 @@ static void process_monster(int m_idx, bool_ is_frien)
cave_set_feat(ny, nx, FEAT_DOOR_HEAD + 0x00);
/* Do not bash the door */
- may_bash = FALSE;
+ may_bash = false;
}
}
}
@@ -5860,10 +5860,10 @@ static void process_monster(int m_idx, bool_ is_frien)
}
/* The door was bashed open */
- did_bash_door = TRUE;
+ did_bash_door = true;
/* Hack -- fall into doorway */
- do_move = TRUE;
+ do_move = true;
}
}
@@ -5887,14 +5887,14 @@ static void process_monster(int m_idx, bool_ is_frien)
}
/* Handle viewable doors */
- if (player_has_los_bold(ny, nx)) do_view = TRUE;
+ if (player_has_los_bold(ny, nx)) do_view = true;
}
}
else if (do_move && (c_ptr->feat == FEAT_MINOR_GLYPH)
&& !(r_ptr->flags & RF_NEVER_BLOW))
{
/* Assume no move allowed */
- do_move = FALSE;
+ do_move = false;
/* Break the ward */
if (randint(BREAK_MINOR_GLYPH) < m_ptr->level)
@@ -5919,7 +5919,7 @@ static void process_monster(int m_idx, bool_ is_frien)
place_floor_convert_glass(ny, nx);
/* Allow movement */
- do_move = TRUE;
+ do_move = true;
}
}
@@ -5942,17 +5942,17 @@ static void process_monster(int m_idx, bool_ is_frien)
{
ny = oy + ddy[d];
nx = ox + ddx[d];
- do_move = FALSE;
+ do_move = false;
}
else
{
m_ptr->hp -= distance(ny, nx, oy, ox) * 2;
- do_move = TRUE;
+ do_move = true;
}
}
else
{
- do_move = TRUE;
+ do_move = true;
}
}
@@ -5961,15 +5961,15 @@ static void process_monster(int m_idx, bool_ is_frien)
{
if (inscription_info[c_ptr->inscription].when & INSCRIP_EXEC_MONST_WALK)
{
- bool_ t;
+ bool t;
t = execute_inscription(c_ptr->inscription, ny, nx);
if (!t && do_move)
{
/* Hack -- attack the player even if on the inscription */
if ((ny == p_ptr->py) && (nx == p_ptr->px))
- do_move = TRUE;
+ do_move = true;
else
- do_move = FALSE;
+ do_move = false;
}
}
}
@@ -5979,7 +5979,7 @@ static void process_monster(int m_idx, bool_ is_frien)
(r_ptr->flags & RF_NEVER_BLOW))
{
/* Do not move */
- do_move = FALSE;
+ do_move = false;
}
/* The player is in the way. Attack him. */
@@ -5989,17 +5989,17 @@ static void process_monster(int m_idx, bool_ is_frien)
make_attack_normal(m_idx, 1);
/* Do not move */
- do_move = FALSE;
+ do_move = false;
/* Took a turn */
- do_turn = TRUE;
+ do_turn = true;
}
if ((cave[ny][nx].feat >= FEAT_PATTERN_START) &&
(cave[ny][nx].feat <= FEAT_PATTERN_XTRA2) &&
- do_turn == FALSE)
+ do_turn == false)
{
- do_move = FALSE;
+ do_move = false;
}
@@ -6010,7 +6010,7 @@ static void process_monster(int m_idx, bool_ is_frien)
monster_type *m2_ptr = &m_list[c_ptr->m_idx];
/* Assume no movement */
- do_move = FALSE;
+ do_move = false;
/* Kill weaker monsters */
if ((r_ptr->flags & RF_KILL_BODY) &&
@@ -6025,7 +6025,7 @@ static void process_monster(int m_idx, bool_ is_frien)
(is_friend(m2_ptr) <= 0))
{
/* Allow movement */
- do_move = TRUE;
+ do_move = true;
/* Kill the monster */
delete_monster(ny, nx);
@@ -6037,17 +6037,17 @@ static void process_monster(int m_idx, bool_ is_frien)
/* Attack 'enemies' */
else if (is_enemy(m_ptr, m2_ptr) || m_ptr->confused)
{
- do_move = FALSE;
+ do_move = false;
/* attack */
if (m2_ptr->r_idx && (m2_ptr->hp >= 0))
{
- hack_message_pain_may_silent = TRUE;
+ hack_message_pain_may_silent = true;
if (monst_attack_monst(m_idx, c_ptr->m_idx))
{
- hack_message_pain_may_silent = FALSE;
+ hack_message_pain_may_silent = false;
return;
}
- hack_message_pain_may_silent = FALSE;
+ hack_message_pain_may_silent = false;
}
}
@@ -6057,7 +6057,7 @@ static void process_monster(int m_idx, bool_ is_frien)
(cave_floor_bold(m_ptr->fy, m_ptr->fx)))
{
/* Allow movement */
- do_move = TRUE;
+ do_move = true;
}
}
@@ -6070,14 +6070,14 @@ static void process_monster(int m_idx, bool_ is_frien)
if (do_move && !monster_can_cross_terrain(c_ptr->feat, r_ptr))
{
/* Assume no move allowed */
- do_move = FALSE;
+ do_move = false;
}
/* Some monsters never move */
if (do_move && (r_ptr->flags & RF_NEVER_MOVE))
{
/* Do not move */
- do_move = FALSE;
+ do_move = false;
}
@@ -6086,7 +6086,7 @@ static void process_monster(int m_idx, bool_ is_frien)
if (do_move)
{
/* Take a turn */
- do_turn = TRUE;
+ do_turn = true;
/* Hack -- Update the old location */
cave[oy][ox].m_idx = c_ptr->m_idx;
@@ -6099,7 +6099,7 @@ static void process_monster(int m_idx, bool_ is_frien)
y_ptr->fx = ox;
/* Update the old monster */
- update_mon(c_ptr->m_idx, TRUE);
+ update_mon(c_ptr->m_idx, true);
/* Wake up the moved monster */
m_list[c_ptr->m_idx].csleep = 0;
@@ -6120,7 +6120,7 @@ static void process_monster(int m_idx, bool_ is_frien)
m_ptr->fx = nx;
/* Update the monster */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
/* Redraw the old grid */
lite_spot(oy, ox);
@@ -6182,7 +6182,7 @@ static void process_monster(int m_idx, bool_ is_frien)
auto const flags = object_flags(o_ptr);
/* Acquire the object name */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Acquire the monster name */
monster_desc(m_name, m_ptr, 0x04);
@@ -6232,7 +6232,7 @@ static void process_monster(int m_idx, bool_ is_frien)
excise_object_idx(this_o_idx);
/* Forget mark */
- o_ptr->marked = FALSE;
+ o_ptr->marked = false;
/* Forget location */
o_ptr->iy = o_ptr->ix = 0;
@@ -6390,8 +6390,8 @@ void process_monsters()
int i, e;
int fx, fy;
- bool_ test;
- bool_ is_frien = FALSE;
+ bool test;
+ bool is_frien = false;
monster_type *m_ptr;
@@ -6461,23 +6461,23 @@ void process_monsters()
/* Assume no move */
- test = FALSE;
+ test = false;
/* Control monster aint affected by distance */
if (p_ptr->control == i)
{
- test = TRUE;
+ test = true;
}
/* No free upkeep on partial summons just because they're out
* of line of sight. */
- else if (m_ptr->mflag & MFLAG_PARTIAL) test = TRUE;
+ else if (m_ptr->mflag & MFLAG_PARTIAL) test = true;
/* Handle "sensing radius" */
else if (m_ptr->cdis <= r_ptr->aaf)
{
/* We can "sense" the player */
- test = TRUE;
+ test = true;
}
/* Handle "sight" and "aggravation" */
@@ -6486,7 +6486,7 @@ void process_monsters()
p_ptr->aggravate))
{
/* We can "see" or "feel" the player */
- test = TRUE;
+ test = true;
}
/* Hack -- Monsters can "smell" the player from far away */
@@ -6497,11 +6497,11 @@ void process_monsters()
(cave[fy][fx].cost < r_ptr->aaf))
{
/* We can "smell" the player */
- test = TRUE;
+ test = true;
}
/* Running away wont save them ! */
- if (m_ptr->poisoned || m_ptr->bleeding) test = TRUE;
+ if (m_ptr->poisoned || m_ptr->bleeding) test = true;
/* Do nothing */
if (!test) continue;
@@ -6509,7 +6509,7 @@ void process_monsters()
/* Save global index */
hack_m_idx = i;
- if (is_friend(m_ptr) > 0) is_frien = TRUE;
+ if (is_friend(m_ptr) > 0) is_frien = true;
/* Process the monster */
process_monster(i, is_frien);
diff --git a/src/modules.cc b/src/modules.cc
index fb63545c..fe5ff2e9 100644
--- a/src/modules.cc
+++ b/src/modules.cc
@@ -257,7 +257,7 @@ bool select_module(program_args const &args)
/* Preprocess the basic prefs, we need them to have movement keys */
process_pref_file(name_file_pref("pref"));
- while (TRUE)
+ while (true)
{
/* Clear screen */
Term_clear();
@@ -328,7 +328,7 @@ bool select_module(program_args const &args)
abort();
}
-static bool_ dleft(byte c, const char *str, int y, int o)
+static bool dleft(byte c, const char *str, int y, int o)
{
int i = strlen(str);
int x = 39 - (strlen(str) / 2) + o;
@@ -353,17 +353,17 @@ static bool_ dleft(byte c, const char *str, int y, int o)
a = a + 1;
if (inkey_scan()) {
- return TRUE;
+ return true;
}
}
}
i = i - 1;
}
- return FALSE;
+ return false;
}
-static bool_ dright(byte c, const char *str, int y, int o)
+static bool dright(byte c, const char *str, int y, int o)
{
int n = strlen(str); // Conversion to int to avoid warnings
int x = 39 - (n / 2) + o;
@@ -386,25 +386,25 @@ static bool_ dright(byte c, const char *str, int y, int o)
a = a - 1;
if (inkey_scan()) {
- return TRUE;
+ return true;
}
}
}
}
- return FALSE;
+ return false;
}
typedef struct intro_text intro_text;
struct intro_text
{
- bool_ (*drop_func)(byte, const char *, int, int);
+ bool (*drop_func)(byte, const char *, int, int);
byte color;
const char *text;
int y0;
int x0;
};
-static bool_ show_intro(intro_text intro_texts[])
+static bool show_intro(intro_text intro_texts[])
{
int i = 0;
@@ -419,7 +419,7 @@ static bool_ show_intro(intro_text intro_texts[])
else if (it->drop_func(it->color, it->text, it->y0, it->x0))
{
/* Abort */
- return TRUE;
+ return true;
}
}
@@ -428,7 +428,7 @@ static bool_ show_intro(intro_text intro_texts[])
inkey();
/* Continue */
- return FALSE;
+ return false;
}
void tome_intro()
@@ -560,12 +560,12 @@ static bool drunk_takes_wine(void *, void *in_, void *)
object_type forge;
object_prep(&forge, lookup_kind(TV_BOTTLE,1));
drop_near(&forge, 50, p_ptr->py, p_ptr->px);
- return TRUE;
+ return true;
}
}
else
{
- return FALSE;
+ return false;
}
}
@@ -637,7 +637,7 @@ static bool food_vessel(void *, void *in_, void *ut)
object_prep(&forge, lookup_kind(TV_JUNK, 3));
- inven_carry(&forge, FALSE);
+ inven_carry(&forge, false);
return true;
}
@@ -673,13 +673,13 @@ static bool erebor_stair(void *, void *in_, void *out_)
{
msg_print("The moon-letters on the map show you "
"the keyhole! You use the key to enter.");
- out->allow = TRUE;
+ out->allow = true;
}
else
{
msg_print("You have found a door, but you cannot "
"find a way to enter. Ask in Dale, perhaps?");
- out->allow = FALSE;
+ out->allow = false;
}
}
@@ -712,12 +712,12 @@ static bool orthanc_stair(void *, void *in_, void *out_)
if (keys >= 1)
{
msg_print("#BYou have the key to the tower of Orthanc! You may proceed.#w");
- out->allow = TRUE;
+ out->allow = true;
}
else
{
msg_print("#yYou may not enter Orthanc without the key to the gates!#w Rumours say the key was lost in the Mines of Moria...");
- out->allow = FALSE;
+ out->allow = false;
}
}
@@ -1231,6 +1231,6 @@ void init_hooks_module()
}
default:
- assert(FALSE);
+ assert(false);
}
}
diff --git a/src/monster1.cc b/src/monster1.cc
index 739dabe7..fb220fc7 100644
--- a/src/monster1.cc
+++ b/src/monster1.cc
@@ -52,16 +52,16 @@ static const char *wd_his[3] = { "its", "his", "her" };
*/
static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
{
- bool_ old = FALSE;
- bool_ sin = FALSE;
+ bool old = false;
+ bool sin = false;
int m, n, r;
const char *p;
const char *q;
- bool_ breath = FALSE;
- bool_ magic = FALSE;
+ bool breath = false;
+ bool magic = false;
int vn = 0;
byte color[64];
@@ -118,7 +118,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
/* Nothing yet */
- old = FALSE;
+ old = false;
/* Describe location */
if (r_ptr->flags & RF_PET)
@@ -126,7 +126,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
text_out(format("%^s is ", wd_he[msex]));
text_out_c(TERM_L_BLUE, "friendly");
text_out(" to you");
- old = TRUE;
+ old = true;
}
/* Describe location */
@@ -137,7 +137,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
else
text_out(format("%^s ", wd_he[msex]));
text_out_c(TERM_L_GREEN, "lives in the town or the wilderness");
- old = TRUE;
+ old = true;
}
else
{
@@ -156,7 +156,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
text_out_c(TERM_L_GREEN, format("%d", r_ptr->level));
}
- old = TRUE;
+ old = true;
}
@@ -170,7 +170,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
else
{
text_out(format("%^s ", wd_he[msex]));
- old = TRUE;
+ old = true;
}
text_out("moves");
@@ -228,7 +228,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
else
{
text_out(format("%^s ", wd_he[msex]));
- old = TRUE;
+ old = true;
}
/* Describe */
@@ -239,7 +239,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
if (old)
{
text_out(". ");
- old = FALSE;
+ old = false;
}
@@ -274,7 +274,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
else text_out(" creature");
/* Group some variables */
- if (TRUE)
+ if (true)
{
long i, j;
@@ -414,7 +414,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
if (vn)
{
/* Note breath */
- breath = TRUE;
+ breath = true;
/* Intro */
text_out(format("%^s", wd_he[msex]));
@@ -506,7 +506,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
if (vn)
{
/* Note magic */
- magic = TRUE;
+ magic = true;
/* Intro */
if (breath)
@@ -897,7 +897,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
if (r_ptr->flags & RF_ONLY_ITEM) drop_gold = 0;
/* No "n" needed */
- sin = FALSE;
+ sin = false;
/* Count maximum drop */
n = std::max(drop_gold, drop_item);
@@ -911,7 +911,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
else if (n == 1)
{
text_out(format("%^s may carry a", wd_he[msex]));
- sin = TRUE;
+ sin = true;
}
else if (n == 2)
{
@@ -933,7 +933,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
else if (flags & RF_DROP_GOOD)
{
p = " good";
- sin = FALSE;
+ sin = false;
}
/* Okay */
@@ -948,7 +948,7 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
{
/* Handle singular "an" */
if (sin) text_out("n");
- sin = FALSE;
+ sin = false;
/* Dump "object(s)" */
if (p) text_out_c(TERM_ORANGE, p);
@@ -963,11 +963,11 @@ static void roff_aux(std::shared_ptr<monster_race const> r_ptr)
if (drop_gold)
{
/* Cancel prefix */
- if (!p) sin = FALSE;
+ if (!p) sin = false;
/* Handle singular "an" */
if (sin) text_out("n");
- sin = FALSE;
+ sin = false;
/* Dump "treasure(s)" */
if (p) text_out(p);
diff --git a/src/monster2.cc b/src/monster2.cc
index fd64ec44..51ee30e6 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -462,14 +462,14 @@ void delete_monster_idx(int i)
/* Hack -- Reduce the racial counter */
auto const r_ptr = m_ptr->race();
r_ptr->cur_num--;
- r_ptr->on_saved = FALSE;
+ r_ptr->on_saved = false;
/* Hack -- count the number of "reproducers" */
if (r_ptr->spells & SF_MULTIPLY) num_repro--;
/* XXX XXX XXX remove monster light source */
- bool_ had_lite = FALSE;
- if (r_ptr->flags & RF_HAS_LITE) had_lite = TRUE;
+ bool had_lite = false;
+ if (r_ptr->flags & RF_HAS_LITE) had_lite = true;
/* Hack -- remove target monster */
@@ -846,9 +846,9 @@ void get_mon_num_prep()
/*
* Some dungeon types restrict the possible monsters.
- * Return TRUE is the monster is OK and FALSE otherwise
+ * Return true is the monster is OK and false otherwise
*/
-static bool_ apply_rule(monster_race const *r_ptr, byte rule)
+static bool apply_rule(monster_race const *r_ptr, byte rule)
{
auto const &d_info = game->edit_data.d_info;
@@ -856,7 +856,7 @@ static bool_ apply_rule(monster_race const *r_ptr, byte rule)
if (d_ptr->rules[rule].mode == DUNGEON_MODE_NONE)
{
- return TRUE;
+ return true;
}
else if ((d_ptr->rules[rule].mode == DUNGEON_MODE_AND) || (d_ptr->rules[rule].mode == DUNGEON_MODE_NAND))
{
@@ -865,40 +865,40 @@ static bool_ apply_rule(monster_race const *r_ptr, byte rule)
if (d_ptr->rules[rule].mflags)
{
if ((d_ptr->rules[rule].mflags & r_ptr->flags) != d_ptr->rules[rule].mflags)
- return FALSE;
+ return false;
}
if (d_ptr->rules[rule].mspells)
{
if ((d_ptr->rules[rule].mspells & r_ptr->spells) != d_ptr->rules[rule].mspells)
- return FALSE;
+ return false;
}
for (a = 0; a < 5; a++)
{
- if (d_ptr->rules[rule].r_char[a] && (d_ptr->rules[rule].r_char[a] != r_ptr->d_char)) return FALSE;
+ if (d_ptr->rules[rule].r_char[a] && (d_ptr->rules[rule].r_char[a] != r_ptr->d_char)) return false;
}
/* All checks passed ? lets go ! */
- return TRUE;
+ return true;
}
else if ((d_ptr->rules[rule].mode == DUNGEON_MODE_OR) || (d_ptr->rules[rule].mode == DUNGEON_MODE_NOR))
{
int a;
- if (d_ptr->rules[rule].mflags && (r_ptr->flags & d_ptr->rules[rule].mflags)) return TRUE;
- if (d_ptr->rules[rule].mspells && (r_ptr->spells & d_ptr->rules[rule].mspells)) return TRUE;
+ if (d_ptr->rules[rule].mflags && (r_ptr->flags & d_ptr->rules[rule].mflags)) return true;
+ if (d_ptr->rules[rule].mspells && (r_ptr->spells & d_ptr->rules[rule].mspells)) return true;
for (a = 0; a < 5; a++)
- if (d_ptr->rules[rule].r_char[a] == r_ptr->d_char) return TRUE;
+ if (d_ptr->rules[rule].r_char[a] == r_ptr->d_char) return true;
/* All checks failled ? Sorry ... */
- return FALSE;
+ return false;
}
/* Should NEVER happen */
- return FALSE;
+ return false;
}
-bool_ restrict_monster_to_dungeon(int r_idx)
+bool restrict_monster_to_dungeon(int r_idx)
{
auto const &d_info = game->edit_data.d_info;
auto const &r_info = game->edit_data.r_info;
@@ -910,20 +910,20 @@ bool_ restrict_monster_to_dungeon(int r_idx)
byte rule = d_ptr->rule_percents[rand_int(100)];
/* Apply the rule */
- bool_ rule_ret = apply_rule(r_ptr, rule);
+ bool rule_ret = apply_rule(r_ptr, rule);
/* Should the rule be right or not ? */
if ((d_ptr->rules[rule].mode == DUNGEON_MODE_NAND) || (d_ptr->rules[rule].mode == DUNGEON_MODE_NOR)) rule_ret = !rule_ret;
/* Rule ok ? */
- if (rule_ret) return TRUE;
+ if (rule_ret) return true;
/* Not allowed */
- return FALSE;
+ return false;
}
/* Ugly hack, let summon unappropriate monsters */
-bool_ summon_hack = FALSE;
+bool summon_hack = false;
/*
* Choose a monster race that seems "appropriate" to the given level
@@ -1168,7 +1168,7 @@ void monster_desc(char *desc, monster_type const *m_ptr, int mode)
auto r_ptr = m_ptr->race();
char silly_name[80], name[100];
- bool_ seen, pron;
+ bool seen, pron;
int insanity = (p_ptr->msane - p_ptr->csane) * 100 / p_ptr->msane;
if (m_ptr->ego)
@@ -1423,9 +1423,9 @@ void monster_race_desc(char *desc, int r_idx, int ego)
-static void sanity_blast(monster_type * m_ptr, bool_ necro)
+static void sanity_blast(monster_type * m_ptr, bool necro)
{
- bool_ happened = FALSE;
+ bool happened = false;
int power = 100;
if (!necro)
@@ -1544,8 +1544,8 @@ static void sanity_blast(monster_type * m_ptr, bool_ necro)
if (randint(power) < p_ptr->skill_sav) /* Permanent lose int & wis */
{
- if (dec_stat(A_INT, 10, TRUE)) happened = TRUE;
- if (dec_stat(A_WIS, 10, TRUE)) happened = TRUE;
+ if (dec_stat(A_INT, 10, true)) happened = true;
+ if (dec_stat(A_WIS, 10, true)) happened = true;
if (happened)
msg_print("You feel much less sane than before.");
return;
@@ -1618,7 +1618,7 @@ static void sanity_blast(monster_type * m_ptr, bool_ necro)
* as "detected last turn", and "detected this turn", and "currently
* in line of sight", all of which are used for visibility testing.
*/
-void update_mon(int m_idx, bool_ full)
+void update_mon(int m_idx, bool full)
{
monster_type *m_ptr = &m_list[m_idx];
@@ -1626,13 +1626,13 @@ void update_mon(int m_idx, bool_ full)
const int fy = m_ptr->fy;
const int fx = m_ptr->fx;
- const bool_ old_ml = m_ptr->ml;
+ const bool old_ml = m_ptr->ml;
/* Seen at all */
- bool_ flag = FALSE;
+ bool flag = false;
/* Seen by vision */
- bool_ easy = FALSE;
+ bool easy = false;
auto const r_ptr = m_ptr->race();
@@ -1658,7 +1658,7 @@ void update_mon(int m_idx, bool_ full)
if (!m_ptr->ml) return;
/* Detected */
- if (m_ptr->mflag & (MFLAG_MARK)) flag = TRUE;
+ if (m_ptr->mflag & (MFLAG_MARK)) flag = true;
}
/* Process "nearby" monsters on the current "panel" */
@@ -1675,7 +1675,7 @@ void update_mon(int m_idx, bool_ full)
if (!(r_ptr->flags & RF_COLD_BLOOD))
{
/* Infravision works */
- easy = flag = TRUE;
+ easy = flag = true;
}
}
@@ -1685,7 +1685,7 @@ void update_mon(int m_idx, bool_ full)
/* Visible, or detectable, monsters get seen */
if (p_ptr->see_inv || !(r_ptr->flags & RF_INVISIBLE))
{
- easy = flag = TRUE;
+ easy = flag = true;
}
}
}
@@ -1725,23 +1725,23 @@ void update_mon(int m_idx, bool_ full)
{
if (rand_int(100) < 10)
{
- flag = TRUE;
+ flag = true;
}
}
/* Normal mind, allow telepathy */
else
{
- flag = TRUE;
+ flag = true;
}
}
}
/* Apply "detection" spells */
- if (m_ptr->mflag & (MFLAG_MARK)) flag = TRUE;
+ if (m_ptr->mflag & (MFLAG_MARK)) flag = true;
/* Hack -- Wizards have "perfect telepathy" */
- if (wizard) flag = TRUE;
+ if (wizard) flag = true;
}
@@ -1752,7 +1752,7 @@ void update_mon(int m_idx, bool_ full)
if (!m_ptr->ml)
{
/* Mark as visible */
- m_ptr->ml = TRUE;
+ m_ptr->ml = true;
/* Draw the monster */
lite_spot(fy, fx);
@@ -1781,7 +1781,7 @@ void update_mon(int m_idx, bool_ full)
if (m_ptr->ml)
{
/* Mark as not visible */
- m_ptr->ml = FALSE;
+ m_ptr->ml = false;
/* Erase the monster */
lite_spot(fy, fx);
@@ -1812,7 +1812,7 @@ void update_mon(int m_idx, bool_ full)
{
if (r_ptr->flags & RF_ELDRITCH_HORROR)
{
- sanity_blast(m_ptr, FALSE);
+ sanity_blast(m_ptr, false);
}
}
@@ -1864,7 +1864,7 @@ void update_mon(int m_idx, bool_ full)
/*
* This function simply updates all the (non-dead) monsters (see above).
*/
-void update_monsters(bool_ full)
+void update_monsters(bool full)
{
int i;
@@ -1919,7 +1919,7 @@ void monster_carry(monster_type *m_ptr, int m_idx, object_type *q_ptr)
}
else if (q_ptr->tval == TV_RANDART)
{
- random_artifacts[q_ptr->sval].generated = FALSE;
+ random_artifacts[q_ptr->sval].generated = false;
}
}
}
@@ -1986,11 +1986,11 @@ static bool kind_is_randart(object_kind const *k_ptr)
* This is the only function which may place a monster in the dungeon,
* except for the savefile loading code.
*/
-bool_ bypass_r_ptr_max_num = FALSE;
+bool bypass_r_ptr_max_num = false;
static int place_monster_result = 0;
-bool_ place_monster_one_no_drop = FALSE;
+bool place_monster_one_no_drop = false;
static s16b hack_m_idx_ii = 0;
-s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
+s16b place_monster_one(int y, int x, int r_idx, int ego, bool slp, int status)
{
auto &r_info = game->edit_data.r_info;
auto &k_info = game->edit_data.k_info;
@@ -1998,7 +1998,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
auto const &dungeon_flags = game->dungeon_flags;
int i;
- bool_ add_level = FALSE;
+ bool add_level = false;
int min_level = 0, max_level = 0;
/* DO NOT PLACE A MONSTER IN THE SMALL SCALE WILDERNESS !!! */
@@ -2232,7 +2232,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
m_ptr->mflag = 0;
/* Not visible */
- m_ptr->ml = FALSE;
+ m_ptr->ml = false;
/* No objects yet */
m_ptr->hold_o_idxs.clear();
@@ -2263,8 +2263,8 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
/* Only if not fated to die */
if ((dungeon_type != DUNGEON_DEATH) && (!place_monster_one_no_drop))
{
- const bool_ good = (r_ptr->flags & RF_DROP_GOOD) ? TRUE : FALSE;
- const bool_ great = (r_ptr->flags & RF_DROP_GREAT) ? TRUE : FALSE;
+ const bool good = (r_ptr->flags & RF_DROP_GOOD) ? true : false;
+ const bool great = (r_ptr->flags & RF_DROP_GREAT) ? true : false;
auto const do_gold = (r_ptr->flags & RF_ONLY_ITEM).empty();
auto const do_item = (r_ptr->flags & RF_ONLY_GOLD).empty();
@@ -2395,7 +2395,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
/* Reset "coin" type */
coin_type = 0;
}
- place_monster_one_no_drop = FALSE;
+ place_monster_one_no_drop = false;
/* Assign maximal hitpoints */
@@ -2439,19 +2439,19 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
if (dungeon_flags & DF_ADJUST_LEVEL_1_2)
{
min_level = max_level = dun_level / 2;
- add_level = TRUE;
+ add_level = true;
}
if (dungeon_flags & DF_ADJUST_LEVEL_1)
{
if (!min_level) min_level = dun_level;
max_level = dun_level;
- add_level = TRUE;
+ add_level = true;
}
if (dungeon_flags & DF_ADJUST_LEVEL_2)
{
if (!min_level) min_level = dun_level * 2;
max_level = dun_level * 2;
- add_level = TRUE;
+ add_level = true;
}
if (add_level) monster_set_level(c_ptr->m_idx, rand_range(min_level, max_level));
@@ -2465,7 +2465,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
m_ptr->mflag |= (MFLAG_NICE);
/* Must repair monsters */
- repair_monsters = TRUE;
+ repair_monsters = true;
}
/* Hack -- see "process_monsters()" */
@@ -2477,7 +2477,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
/* Update the monster */
- update_mon(c_ptr->m_idx, TRUE);
+ update_mon(c_ptr->m_idx, true);
/* Hack -- Count the number of "reproducers" */
@@ -2485,7 +2485,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
/* Hack -- Notice new multi-hued monsters */
- if (r_ptr->flags & RF_ATTR_MULTI) shimmer_monsters = TRUE;
+ if (r_ptr->flags & RF_ATTR_MULTI) shimmer_monsters = true;
/* Count monsters on the level */
{
@@ -2499,7 +2499,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
/* Unique monsters on saved levels should be "marked" */
if ((r_ptr->flags & RF_UNIQUE) && get_dungeon_save_extension())
{
- r_ptr->on_saved = TRUE;
+ r_ptr->on_saved = true;
}
/* Processs hooks */
@@ -2522,7 +2522,7 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status)
/*
* Attempt to place a "group" of monsters around the given location
*/
-static bool_ place_monster_group(int y, int x, int r_idx, bool_ slp, int status)
+static bool place_monster_group(int y, int x, int r_idx, bool slp, int status)
{
auto const &r_info = game->edit_data.r_info;
@@ -2607,7 +2607,7 @@ static bool_ place_monster_group(int y, int x, int r_idx, bool_ slp, int status)
/* Success */
- return (TRUE);
+ return true;
}
@@ -2646,7 +2646,7 @@ static bool place_monster_okay(monster_race const *r_ptr)
*
* Note that certain monsters are now marked as requiring "friends".
* These monsters, if successfully placed, and if the "grp" parameter
- * is TRUE, will be surrounded by a "group" of identical monsters.
+ * is true, will be surrounded by a "group" of identical monsters.
*
* Note that certain monsters are now marked as requiring an "escort",
* which is a collection of monsters with similar "race" but lower level.
@@ -2659,7 +2659,7 @@ static bool place_monster_okay(monster_race const *r_ptr)
* Note the use of the new "monster allocation table" code to restrict
* the "get_mon_num()" function to "legal" escort types.
*/
-bool_ place_monster_aux(int y, int x, int r_idx, bool_ slp, bool_ grp, int status)
+bool place_monster_aux(int y, int x, int r_idx, bool slp, bool grp, int status)
{
auto const &r_info = game->edit_data.r_info;
@@ -2669,11 +2669,11 @@ bool_ place_monster_aux(int y, int x, int r_idx, bool_ slp, bool_ grp, int statu
/* Place one monster, or fail */
- if (!place_monster_one(y, x, r_idx, pick_ego_monster(r_ptr), slp, status)) return (FALSE);
+ if (!place_monster_one(y, x, r_idx, pick_ego_monster(r_ptr), slp, status)) return false;
/* Require the "group" flag */
- if (!grp) return (TRUE);
+ if (!grp) return true;
/* Friends for certain monsters */
@@ -2746,7 +2746,7 @@ bool_ place_monster_aux(int y, int x, int r_idx, bool_ slp, bool_ grp, int statu
}
/* Success */
- return (TRUE);
+ return true;
}
@@ -2755,7 +2755,7 @@ bool_ place_monster_aux(int y, int x, int r_idx, bool_ slp, bool_ grp, int statu
*
* Attempt to find a monster appropriate to the "monster_level"
*/
-bool_ place_monster(int y, int x, bool_ slp, bool_ grp)
+bool place_monster(int y, int x, bool slp, bool grp)
{
int r_idx;
@@ -2775,17 +2775,17 @@ bool_ place_monster(int y, int x, bool_ slp, bool_ grp)
get_mon_num_prep();
/* Handle failure */
- if (!r_idx) return (FALSE);
+ if (!r_idx) return false;
/* Attempt to place the monster */
- if (place_monster_aux(y, x, r_idx, slp, grp, MSTATUS_ENEMY)) return (TRUE);
+ if (place_monster_aux(y, x, r_idx, slp, grp, MSTATUS_ENEMY)) return true;
/* Oops */
- return (FALSE);
+ return false;
}
-bool_ alloc_horde(int y, int x)
+bool alloc_horde(int y, int x)
{
auto const &r_info = game->edit_data.r_info;
@@ -2805,7 +2805,7 @@ bool_ alloc_horde(int y, int x)
r_idx = get_mon_num(monster_level);
/* Handle failure */
- if (!r_idx) return (FALSE);
+ if (!r_idx) return false;
r_ptr = &r_info[r_idx];
@@ -2819,17 +2819,17 @@ bool_ alloc_horde(int y, int x)
/* Prepare allocation table */
get_mon_num_prep();
- if (attempts < 1) return FALSE;
+ if (attempts < 1) return false;
attempts = 1000;
while (--attempts)
{
/* Attempt to place the monster */
- if (place_monster_aux(y, x, r_idx, FALSE, FALSE, MSTATUS_ENEMY)) break;
+ if (place_monster_aux(y, x, r_idx, false, false, MSTATUS_ENEMY)) break;
}
- if (attempts < 1) return FALSE;
+ if (attempts < 1) return false;
m_ptr = &m_list[hack_m_idx_ii];
@@ -2841,7 +2841,7 @@ bool_ alloc_horde(int y, int x)
summon_specific(m_ptr->fy, m_ptr->fx, dun_level, SUMMON_KIN);
}
- return TRUE;
+ return true;
}
/*
@@ -2853,7 +2853,7 @@ bool_ alloc_horde(int y, int x)
*
* Use "monster_level" for the monster level
*/
-bool_ alloc_monster(int dis, bool_ slp)
+bool alloc_monster(int dis, bool slp)
{
int y, x;
int attempts_left = 10000;
@@ -2879,7 +2879,7 @@ bool_ alloc_monster(int dis, bool_ slp)
msg_print("Warning! Could not allocate a new monster. Small level?");
}
- return (FALSE);
+ return false;
}
@@ -2891,19 +2891,19 @@ bool_ alloc_monster(int dis, bool_ slp)
{
msg_print("Monster horde.");
}
- return (TRUE);
+ return true;
}
}
else
{
/* Attempt to place the monster, allow groups */
- if (place_monster(y, x, slp, TRUE)) return (TRUE);
+ if (place_monster(y, x, slp, true)) return true;
}
/* Nope */
- return (FALSE);
+ return false;
}
@@ -3135,7 +3135,7 @@ static bool summon_specific_okay(monster_race const *r_ptr)
}
case SUMMON_MINE:
{
- return (r_ptr->flags & RF_NEVER_MOVE) ? TRUE : FALSE;
+ return (r_ptr->flags & RF_NEVER_MOVE) ? true : false;
}
case SUMMON_HUMAN:
@@ -3164,7 +3164,7 @@ static bool summon_specific_okay(monster_race const *r_ptr)
/*
* Place a monster (of the specified "type") near the given
- * location. Return TRUE if a monster was actually summoned.
+ * location. Return true if a monster was actually summoned.
*
* We will attempt to place the monster up to 10 times before giving up.
*
@@ -3187,10 +3187,10 @@ static bool summon_specific_okay(monster_race const *r_ptr)
* Note that this function may not succeed, though this is very rare.
*/
int summon_specific_level = 0;
-bool_ summon_specific(int y1, int x1, int lev, int type)
+bool summon_specific(int y1, int x1, int lev, int type)
{
int i, x, y, r_idx;
- bool_ Group_ok = TRUE;
+ bool Group_ok = true;
bool (*old_get_monster_hook)(monster_race const *);
/* Look for a location */
@@ -3210,7 +3210,7 @@ bool_ summon_specific(int y1, int x1, int lev, int type)
if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
/* Nor on the between */
- if (cave[y][x].feat == FEAT_BETWEEN) return (FALSE);
+ if (cave[y][x].feat == FEAT_BETWEEN) return false;
/* ... nor on the Pattern */
if ((cave[y][x].feat >= FEAT_PATTERN_START) &&
@@ -3222,7 +3222,7 @@ bool_ summon_specific(int y1, int x1, int lev, int type)
}
/* Failure */
- if (i == 20) return (FALSE);
+ if (i == 20) return false;
/* Save the "summon" type */
summon_specific_type = type;
@@ -3238,9 +3238,9 @@ bool_ summon_specific(int y1, int x1, int lev, int type)
/* Pick a monster, using the level calculation */
- summon_hack = TRUE;
+ summon_hack = true;
r_idx = get_mon_num((dun_level + lev) / 2 + 5);
- summon_hack = FALSE;
+ summon_hack = false;
/* Reset restriction */
get_monster_hook = old_get_monster_hook;
@@ -3250,16 +3250,16 @@ bool_ summon_specific(int y1, int x1, int lev, int type)
/* Handle failure */
- if (!r_idx) return (FALSE);
+ if (!r_idx) return false;
if ((type == SUMMON_DAWN) || (type == SUMMON_BLUE_HORROR))
{
- Group_ok = FALSE;
+ Group_ok = false;
}
/* Attempt to place the monster (awake, allow groups) */
- if (!place_monster_aux(y, x, r_idx, FALSE, Group_ok, MSTATUS_ENEMY)) return (FALSE);
+ if (!place_monster_aux(y, x, r_idx, false, Group_ok, MSTATUS_ENEMY)) return false;
if (summon_specific_level)
{
monster_set_level(place_monster_result, summon_specific_level);
@@ -3267,12 +3267,12 @@ bool_ summon_specific(int y1, int x1, int lev, int type)
}
/* Success */
- return (TRUE);
+ return true;
}
-bool_ summon_specific_friendly(int y1, int x1, int lev, int type, bool_ Group_ok)
+bool summon_specific_friendly(int y1, int x1, int lev, int type, bool Group_ok)
{
int i, x, y, r_idx;
bool (*old_get_monster_hook)(monster_race const *);
@@ -3294,7 +3294,7 @@ bool_ summon_specific_friendly(int y1, int x1, int lev, int type, bool_ Group_ok
if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
/* Nor on the between */
- if (cave[y][x].feat == FEAT_BETWEEN) return (FALSE);
+ if (cave[y][x].feat == FEAT_BETWEEN) return false;
/* ... nor on the Pattern */
if ((cave[y][x].feat >= FEAT_PATTERN_START) &&
@@ -3306,7 +3306,7 @@ bool_ summon_specific_friendly(int y1, int x1, int lev, int type, bool_ Group_ok
}
/* Failure */
- if (i == 20) return (FALSE);
+ if (i == 20) return false;
old_get_monster_hook = get_monster_hook;
@@ -3329,10 +3329,10 @@ bool_ summon_specific_friendly(int y1, int x1, int lev, int type, bool_ Group_ok
get_mon_num_prep();
/* Handle failure */
- if (!r_idx) return (FALSE);
+ if (!r_idx) return false;
/* Attempt to place the monster (awake, allow groups) */
- if (!place_monster_aux(y, x, r_idx, FALSE, Group_ok, MSTATUS_PET)) return (FALSE);
+ if (!place_monster_aux(y, x, r_idx, false, Group_ok, MSTATUS_PET)) return false;
if (summon_specific_level)
{
monster_set_level(place_monster_result, summon_specific_level);
@@ -3340,7 +3340,7 @@ bool_ summon_specific_friendly(int y1, int x1, int lev, int type, bool_ Group_ok
}
/* Success */
- return (TRUE);
+ return true;
}
@@ -3377,7 +3377,7 @@ void monster_swap(int y1, int x1, int y2, int x2)
m_ptr->fx = x2;
/* Update monster */
- update_mon(m1, TRUE);
+ update_mon(m1, true);
}
/* Player 1 */
@@ -3414,7 +3414,7 @@ void monster_swap(int y1, int x1, int y2, int x2)
m_ptr->fx = x1;
/* Update monster */
- update_mon(m2, TRUE);
+ update_mon(m2, true);
}
/* Player 2 */
@@ -3466,17 +3466,17 @@ static bool mutate_monster_okay(monster_race const *r_ptr)
*
* Note that "reproduction" REQUIRES empty space.
*/
-bool_ multiply_monster(int m_idx, bool_ charm, bool_ clone)
+bool multiply_monster(int m_idx, bool charm, bool clone)
{
monster_type *m_ptr = &m_list[m_idx];
auto const r_ptr = m_ptr->race();
- bool_ result = FALSE;
+ bool result = false;
if (no_breeds)
{
msg_print("It tries to breed but it fails!");
- return FALSE;
+ return false;
}
/* Try up to 18 times */
@@ -3519,7 +3519,7 @@ bool_ multiply_monster(int m_idx, bool_ charm, bool_ clone)
}
/* Create a new monster (awake, no groups) */
- result = place_monster_aux(y, x, new_race, FALSE, FALSE, (charm) ? MSTATUS_PET : MSTATUS_ENEMY);
+ result = place_monster_aux(y, x, new_race, false, false, (charm) ? MSTATUS_PET : MSTATUS_ENEMY);
/* Done */
break;
@@ -3540,7 +3540,7 @@ bool_ multiply_monster(int m_idx, bool_ charm, bool_ clone)
*
* Technically should attempt to treat "Beholder"'s as jelly's
*/
-bool_ hack_message_pain_may_silent = FALSE;
+bool hack_message_pain_may_silent = false;
void message_pain_hook(const char *message, const char *name)
{
std::string buf;
diff --git a/src/monster2.hpp b/src/monster2.hpp
index 9d36ba73..e1a9395b 100644
--- a/src/monster2.hpp
+++ b/src/monster2.hpp
@@ -23,24 +23,24 @@ void get_mon_num_prep();
s16b get_mon_num(int level);
void monster_desc(char *desc, const monster_type *m_ptr, int mode);
void monster_race_desc(char *desc, int r_idx, int ego);
-void update_mon(int m_idx, bool_ full);
-void update_monsters(bool_ full);
+void update_mon(int m_idx, bool full);
+void update_monsters(bool full);
void monster_carry(monster_type *m_ptr, int m_idx, object_type *q_ptr);
-extern bool_ bypass_r_ptr_max_num ;
-bool_ place_monster_aux(int y, int x, int r_idx, bool_ slp, bool_ grp, int status);
-bool_ place_monster(int y, int x, bool_ slp, bool_ grp);
-bool_ alloc_horde(int y, int x);
-bool_ alloc_monster(int dis, bool_ slp);
+extern bool bypass_r_ptr_max_num ;
+bool place_monster_aux(int y, int x, int r_idx, bool slp, bool grp, int status);
+bool place_monster(int y, int x, bool slp, bool grp);
+bool alloc_horde(int y, int x);
+bool alloc_monster(int dis, bool slp);
extern int summon_specific_level;
-bool_ summon_specific(int y1, int x1, int lev, int type);
+bool summon_specific(int y1, int x1, int lev, int type);
void monster_swap(int y1, int x1, int y2, int x2);
-bool_ multiply_monster(int m_idx, bool_ charm, bool_ clone);
-extern bool_ hack_message_pain_may_silent;
+bool multiply_monster(int m_idx, bool charm, bool clone);
+extern bool hack_message_pain_may_silent;
void message_pain(int m_idx, int dam);
void update_smart_learn(int m_idx, int what);
-bool_ summon_specific_friendly(int y1, int x1, int lev, int type, bool_ Group_ok);
-extern bool_ place_monster_one_no_drop;
-s16b place_monster_one(int y, int x, int r_idx, int ego, bool_ slp, int status);
+bool summon_specific_friendly(int y1, int x1, int lev, int type, bool Group_ok);
+extern bool place_monster_one_no_drop;
+s16b place_monster_one(int y, int x, int r_idx, int ego, bool slp, int status);
s16b player_place(int y, int x);
void monster_drop_carried_objects(monster_type *m_ptr);
bool monster_dungeon(monster_race const *r_ptr);
diff --git a/src/monster3.cc b/src/monster3.cc
index 8bb2ed98..84cb1d64 100644
--- a/src/monster3.cc
+++ b/src/monster3.cc
@@ -126,7 +126,7 @@ bool ai_multiply(int m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
int k, y, x, oy = m_ptr->fy, ox = m_ptr->fx;
- bool_ is_frien = (is_friend(m_ptr) > 0);
+ bool is_frien = (is_friend(m_ptr) > 0);
/* Count the adjacent monsters */
for (k = 0, y = oy - 1; y <= oy + 1; y++)
@@ -139,18 +139,18 @@ bool ai_multiply(int m_idx)
if (is_friend(m_ptr) > 0)
{
- is_frien = TRUE;
+ is_frien = true;
}
else
{
- is_frien = FALSE;
+ is_frien = false;
}
/* Hack -- multiply slower in crowded areas */
if ((k < 4) && (!k || !rand_int(k * MON_MULT_ADJ)))
{
/* Try to multiply */
- if (multiply_monster(m_idx, (is_frien), FALSE))
+ if (multiply_monster(m_idx, (is_frien), false))
{
/* Multiplying takes energy */
return true;
@@ -232,7 +232,7 @@ void ai_possessor(int m_idx, int o_idx)
if (r_ptr->spells & SF_MULTIPLY) num_repro++;
/* Hack -- Notice new multi-hued monsters */
- if (r_ptr->flags & RF_ATTR_MULTI) shimmer_monsters = TRUE;
+ if (r_ptr->flags & RF_ATTR_MULTI) shimmer_monsters = true;
/* Hack -- Count the monsters on the level */
r_ptr->cur_num++;
@@ -241,7 +241,7 @@ void ai_possessor(int m_idx, int o_idx)
m_ptr->possessor = r_idx;
/* Update the monster */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
}
void ai_deincarnate(int m_idx)
@@ -307,7 +307,7 @@ void ai_deincarnate(int m_idx)
if (r_ptr->spells & SF_MULTIPLY) num_repro++;
/* Hack -- Notice new multi-hued monsters */
- if (r_ptr->flags & RF_ATTR_MULTI) shimmer_monsters = TRUE;
+ if (r_ptr->flags & RF_ATTR_MULTI) shimmer_monsters = true;
/* Hack -- Count the monsters on the level */
r_ptr->cur_num++;
@@ -316,7 +316,7 @@ void ai_deincarnate(int m_idx)
m_ptr->possessor = 0;
/* Update the monster */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
}
/* Returns if a new companion is allowed */
@@ -416,7 +416,7 @@ bool do_control_pickup()
excise_object_idx(this_o_idx);
/* Forget mark */
- o_ptr->marked = FALSE;
+ o_ptr->marked = false;
/* Forget location */
o_ptr->iy = o_ptr->ix = 0;
@@ -454,7 +454,7 @@ bool do_control_magic()
auto const &r_info = game->edit_data.r_info;
int i;
- bool_ flag, redraw;
+ bool flag, redraw;
int ask;
char choice;
char out_val[160];
@@ -486,11 +486,11 @@ bool do_control_magic()
}
/* Nothing chosen yet */
- flag = FALSE;
+ flag = false;
monster_power const *power = nullptr;
/* No redraw yet */
- redraw = FALSE;
+ redraw = false;
/* Get the last label */
label = (num <= 26) ? I2A(num - 1) : I2D(num - 1 - 26);
@@ -516,7 +516,7 @@ bool do_control_magic()
strcpy(dummy, "");
/* Show list */
- redraw = TRUE;
+ redraw = true;
/* Save the screen */
screen_save_no_flush();
@@ -558,7 +558,7 @@ bool do_control_magic()
else
{
/* Hide list */
- redraw = FALSE;
+ redraw = false;
/* Restore the screen */
screen_load_no_flush();
@@ -587,7 +587,7 @@ bool do_control_magic()
else
{
/* Can't uppercase digits XXX XXX XXX */
- ask = FALSE;
+ ask = false;
i = choice - '0' + 26;
}
@@ -615,7 +615,7 @@ bool do_control_magic()
}
/* Stop the loop */
- flag = TRUE;
+ flag = true;
}
/* Restore the screen */
diff --git a/src/monster_ego.hpp b/src/monster_ego.hpp
index 3a6cf27f..7ce9d439 100644
--- a/src/monster_ego.hpp
+++ b/src/monster_ego.hpp
@@ -13,7 +13,7 @@
struct monster_ego
{
const char *name = nullptr; /* Name */
- bool_ before = false; /* Display ego before or after */
+ bool before = false; /* Display ego before or after */
std::array<monster_blow, 4> blow { }; /* Up to four blows per round */
byte blowm[4][2] = {
diff --git a/src/monster_power.hpp b/src/monster_power.hpp
index 92a2aded..393fec1a 100644
--- a/src/monster_power.hpp
+++ b/src/monster_power.hpp
@@ -12,5 +12,5 @@ struct monster_power
u32b monster_spell_index;
const char *name; /* Name of it */
int mana; /* Mana needed */
- bool_ great; /* Need the use of great spells */
+ bool great; /* Need the use of great spells */
};
diff --git a/src/monster_race.hpp b/src/monster_race.hpp
index db58c026..b7d54fac 100644
--- a/src/monster_race.hpp
+++ b/src/monster_race.hpp
@@ -75,7 +75,7 @@ struct monster_race
s16b r_pkills = 0; /* Count monsters killed in this life */
- bool_ on_saved = 0; /* Is the (unique) on a saved level ? */
+ bool on_saved = 0; /* Is the (unique) on a saved level ? */
obj_theme drops; /* The drops type */
diff --git a/src/monster_type.hpp b/src/monster_type.hpp
index bef105b5..bc7b4e79 100644
--- a/src/monster_type.hpp
+++ b/src/monster_type.hpp
@@ -52,7 +52,7 @@ struct monster_type
s32b mflag = 0; /* Extra monster flags */
- bool_ ml = FALSE; /* Monster is "visible" */
+ bool ml = false; /* Monster is "visible" */
std::vector<s16b> hold_o_idxs { }; /* Objects being held */
diff --git a/src/object1.cc b/src/object1.cc
index 96a2179c..dc3dc657 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -239,7 +239,7 @@ static byte object_flavor(
*
* XXX XXX XXX Add "EASY_KNOW" flag to "k_info.txt" file
*/
-static bool_ object_easy_know(std::shared_ptr<object_kind> k_ptr)
+static bool object_easy_know(std::shared_ptr<object_kind> k_ptr)
{
/* Analyze the "tval" */
switch (k_ptr->tval)
@@ -249,7 +249,7 @@ static bool_ object_easy_know(std::shared_ptr<object_kind> k_ptr)
case TV_MUSIC_BOOK:
case TV_SYMBIOTIC_BOOK:
{
- return (TRUE);
+ return true;
}
/* Simple items */
@@ -262,7 +262,7 @@ static bool_ object_easy_know(std::shared_ptr<object_kind> k_ptr)
case TV_SPIKE:
case TV_JUNK:
{
- return (TRUE);
+ return true;
}
/* All Food, Potions, Scrolls, Rods */
@@ -274,8 +274,8 @@ static bool_ object_easy_know(std::shared_ptr<object_kind> k_ptr)
case TV_ROD_MAIN:
{
if (k_ptr->flags & TR_NORM_ART)
- return ( FALSE );
- return (TRUE);
+ return ( false );
+ return true;
}
/* Some Rings, Amulets, Lites */
@@ -283,13 +283,13 @@ static bool_ object_easy_know(std::shared_ptr<object_kind> k_ptr)
case TV_AMULET:
case TV_LITE:
{
- if (k_ptr->flags & TR_EASY_KNOW) return (TRUE);
- return (FALSE);
+ if (k_ptr->flags & TR_EASY_KNOW) return true;
+ return false;
}
}
/* Nope */
- return (FALSE);
+ return false;
}
@@ -358,7 +358,7 @@ void flavor_init()
/* No flavor yields aware */
if ((!k_ptr->flavor) && (k_ptr->tval != TV_ROD_MAIN))
{
- k_ptr->aware = TRUE;
+ k_ptr->aware = true;
}
/* Check for "easily known" */
@@ -371,7 +371,7 @@ void flavor_init()
*
* This involves resetting various things to their "default" state.
*
- * If the "prefs" flag is TRUE, then we will also load the appropriate
+ * If the "prefs" flag is true, then we will also load the appropriate
* "user pref file" based on the current setting of the "use_graphics"
* flag. This is useful for switching "graphics" on/off.
*
@@ -534,7 +534,7 @@ static void object_flags_xtra(object_type const *o_ptr, object_flag_set *f)
/*
* Disregard sets when calculating flags?
*/
-bool_ object_flags_no_set = FALSE;
+bool object_flags_no_set = false;
/*
* Obtain the "flags" for an item
@@ -758,12 +758,12 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
auto const &random_artifacts = game->random_artifacts;
static auto const TR_PVAL_MASK = compute_pval_mask();
- bool_ hack_name = FALSE;
+ bool hack_name = false;
- bool_ append_name = FALSE;
+ bool append_name = false;
- bool_ show_weapon = FALSE;
- bool_ show_armour = FALSE;
+ bool show_weapon = false;
+ bool show_armour = false;
auto k_ptr = o_ptr->k_ptr;
@@ -771,10 +771,10 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
auto const flags = object_flags(o_ptr);
/* See if the object is "aware" */
- bool_ aware = object_aware_p(o_ptr);
+ bool aware = object_aware_p(o_ptr);
/* See if the object is "known" */
- bool_ known = object_known_p(o_ptr);
+ bool known = object_known_p(o_ptr);
/* Hack -- Extract the sub-type "indexx" */
auto const indexx = o_ptr->sval;
@@ -820,7 +820,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
case TV_SWORD:
case TV_AXE:
{
- show_weapon = TRUE;
+ show_weapon = true;
break;
}
@@ -834,7 +834,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
case TV_HARD_ARMOR:
case TV_DRAG_ARMOR:
{
- show_armour = TRUE;
+ show_armour = true;
break;
}
@@ -848,7 +848,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
/* Amulets (including a few "Specials") */
case TV_AMULET:
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Amulet~";
@@ -863,7 +863,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
/* Rings (including a few "Specials") */
case TV_RING:
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Ring~";
@@ -883,7 +883,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
case TV_STAFF:
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Staff~";
break;
@@ -891,7 +891,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
case TV_WAND:
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Wand~";
break;
@@ -899,14 +899,14 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
case TV_ROD:
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Rod Tip~";
if (o_ptr->sval == SV_ROD_HOME)
{
basenm = "& Great Rod Tip~ of Home Summoning";
- hack_name = TRUE;
+ hack_name = true;
}
break;
@@ -920,7 +920,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
case TV_SCROLL:
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Scroll~";
break;
@@ -931,7 +931,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
{
if ((o_ptr->tval != TV_POTION2) || (o_ptr->sval != SV_POTION2_MIMIC) || (!aware))
{
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
}
else
{
@@ -947,7 +947,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
/* Ordinary food is "boring" */
if (o_ptr->sval >= SV_FOOD_MIN_FOOD) break;
- if (aware) append_name = TRUE;
+ if (aware) append_name = true;
basenm = "& Mushroom~";
break;
@@ -957,7 +957,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
/* Cloak of Mimicry */
case TV_CLOAK:
{
- show_armour = TRUE;
+ show_armour = true;
if (o_ptr->sval == SV_MIMIC_CLOAK)
{
modstr = get_mimic_object_name(o_ptr->pval2);
@@ -1042,7 +1042,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
monster_type monster;
monster.r_idx = o_ptr->pval;
monster.ego = o_ptr->pval2;
- monster.ml = TRUE;
+ monster.ml = true;
monster.status = MSTATUS_ENEMY;
char name[80];
@@ -1430,13 +1430,13 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
/* Display the item like a weapon */
- if (flags & TR_SHOW_MODS) show_weapon = TRUE;
+ if (flags & TR_SHOW_MODS) show_weapon = true;
/* Display the item like a weapon */
- if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
+ if (o_ptr->to_h && o_ptr->to_d) show_weapon = true;
/* Display the item like armour */
- if (o_ptr->ac) show_armour = TRUE;
+ if (o_ptr->ac) show_armour = true;
/* Dump base weapon info */
switch (o_ptr->tval)
@@ -1727,12 +1727,12 @@ void object_desc(char *buf, object_type const *o_ptr, int pref, int mode)
void object_desc_store(char *buf, object_type *o_ptr, int pref, int mode)
{
/* Save the identification status */
- bool_ saved_aware = o_ptr->k_ptr->aware;
+ bool saved_aware = o_ptr->k_ptr->aware;
auto saved_identified = o_ptr->identified;
/* Force full identification for description */
o_ptr->identified = true;
- o_ptr->k_ptr->aware = TRUE;
+ o_ptr->k_ptr->aware = true;
/* Describe the object */
object_desc(buf, o_ptr, pref, mode);
@@ -1786,11 +1786,11 @@ const char *item_activation(object_type *o_ptr)
}
}
- return activation_aux(o_ptr, FALSE, 0);
+ return activation_aux(o_ptr, false, 0);
}
/* Grab the tval desc */
-static bool_ grab_tval_desc(int tval)
+static bool grab_tval_desc(int tval)
{
int tv = 0;
@@ -1799,18 +1799,18 @@ static bool_ grab_tval_desc(int tval)
tv++;
}
- if (!tval_descs[tv].tval) return FALSE;
+ if (!tval_descs[tv].tval) return false;
text_out_c(TERM_L_BLUE, tval_descs[tv].desc);
text_out("\n");
- return TRUE;
+ return true;
}
-static void check_first(bool_ *first)
+static void check_first(bool *first)
{
if (*first) {
- *first = FALSE;
+ *first = false;
}
else
{
@@ -1821,7 +1821,7 @@ static void check_first(bool_ *first)
/*
* Display the damage done with a multiplier
*/
-void output_dam(object_type *o_ptr, int mult, int mult2, const char *against, const char *against2, bool_ *first)
+void output_dam(object_type *o_ptr, int mult, int mult2, const char *against, const char *against2, bool *first)
{
int dam;
@@ -1865,7 +1865,7 @@ void output_dam(object_type *o_ptr, int mult, int mult2, const char *against, co
void display_weapon_damage(object_type *o_ptr)
{
object_type forge, *old_ptr = &forge;
- bool_ first = TRUE;
+ bool first = true;
/* Extract the flags */
auto const flags = object_flags(o_ptr);
@@ -1912,7 +1912,7 @@ void display_weapon_damage(object_type *o_ptr)
/*
* Display the ammo damage done with a multiplier
*/
-void output_ammo_dam(object_type *o_ptr, int mult, int mult2, const char *against, const char *against2, bool_ *first)
+void output_ammo_dam(object_type *o_ptr, int mult, int mult2, const char *against, const char *against2, bool *first)
{
int dam;
object_type *b_ptr = &p_ptr->inventory[INVEN_BOW];
@@ -1965,7 +1965,7 @@ void output_ammo_dam(object_type *o_ptr, int mult, int mult2, const char *agains
*/
void display_ammo_damage(object_type *o_ptr)
{
- bool_ first = TRUE;
+ bool first = true;
int i;
/* Extract the flags */
@@ -2100,7 +2100,7 @@ static const char *object_out_desc_where_found(s16b level, s16b dungeon)
/*
* Describe an item
*/
-bool_ object_out_desc(object_type *o_ptr, FILE *fff, bool_ trim_down, bool_ wait_for_it)
+bool object_out_desc(object_type *o_ptr, FILE *fff, bool trim_down, bool wait_for_it)
{
auto const &set_info = game->edit_data.set_info;
auto const &st_info = game->edit_data.st_info;
@@ -2165,7 +2165,7 @@ bool_ object_out_desc(object_type *o_ptr, FILE *fff, bool_ trim_down, bool_ wait
else if (count_bits(o_ptr->pval3) > 1) text_out("It is sentient and can have access to the realms of ");
else text_out("It is sentient and can have access to the realm of ");
- bool_ first = TRUE;
+ bool first = true;
for (std::size_t j = 0; j < flags_groups().size(); j++)
{
if (BIT(j) & o_ptr->pval3)
@@ -3053,7 +3053,7 @@ bool_ object_out_desc(object_type *o_ptr, FILE *fff, bool_ trim_down, bool_ wait
text_out_hook = text_out_to_screen;
/* Gave knowledge */
- return (TRUE);
+ return true;
}
@@ -3150,9 +3150,9 @@ static int get_slot(int slot)
/*
* Determine which equipment slot (if any) an item likes, ignoring the player's
- * current body and stuff if ideal == TRUE
+ * current body and stuff if ideal == true
*/
-s16b wield_slot_ideal(object_type const *o_ptr, bool_ ideal)
+s16b wield_slot_ideal(object_type const *o_ptr, bool ideal)
{
/* Slot for equipment */
switch (o_ptr->tval)
@@ -3335,7 +3335,7 @@ s16b wield_slot_ideal(object_type const *o_ptr, bool_ ideal)
*/
s16b wield_slot(object_type const *o_ptr)
{
- return wield_slot_ideal(o_ptr, FALSE);
+ return wield_slot_ideal(o_ptr, false);
}
/*
@@ -3571,15 +3571,15 @@ static bool item_tester_okay(object_type const *o_ptr, object_filter_t const &fi
-static void show_equip_aux(bool_ mirror, object_filter_t const &filter);
-static void show_inven_aux(bool_ mirror, object_filter_t const &filter);
+static void show_equip_aux(bool mirror, object_filter_t const &filter);
+static void show_inven_aux(bool mirror, object_filter_t const &filter);
/*
* Choice window "shadow" of the "show_inven()" function
*/
void display_inven()
{
- show_inven_aux(TRUE, object_filter::True());
+ show_inven_aux(true, object_filter::True());
}
@@ -3589,7 +3589,7 @@ void display_inven()
*/
void display_equip()
{
- show_equip_aux(TRUE, object_filter::True());
+ show_equip_aux(true, object_filter::True());
}
@@ -3618,7 +3618,7 @@ byte get_item_letter_color(object_type const *o_ptr)
*
* Hack -- do not display "trailing" empty slots
*/
-void show_inven_aux(bool_ mirror, const object_filter_t &filter)
+void show_inven_aux(bool mirror, const object_filter_t &filter)
{
int i, j, k, l, z = 0;
int row, col, len, lim;
@@ -3683,7 +3683,7 @@ void show_inven_aux(bool_ mirror, const object_filter_t &filter)
out_index[k] = i + 1;
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Hack -- enforce max length */
o_name[lim] = '\0';
@@ -3783,7 +3783,7 @@ void show_inven_aux(bool_ mirror, const object_filter_t &filter)
static void show_inven(object_filter_t const &filter)
{
- show_inven_aux(FALSE, filter);
+ show_inven_aux(false, filter);
}
void show_inven_full()
@@ -3795,7 +3795,7 @@ void show_inven_full()
static void show_equip(object_filter_t const &filter)
{
- show_equip_aux(FALSE, filter);
+ show_equip_aux(false, filter);
}
void show_equip_full()
@@ -3808,7 +3808,7 @@ void show_equip_full()
/*
* Display the equipment.
*/
-void show_equip_aux(bool_ mirror, object_filter_t const &filter)
+void show_equip_aux(bool mirror, object_filter_t const &filter)
{
int i, j, k, l;
int row, col, len, lim, idx;
@@ -3867,7 +3867,7 @@ void show_equip_aux(bool_ mirror, object_filter_t const &filter)
char q_name[80];
/* Description */
- object_desc(q_name, q_ptr, TRUE, 3);
+ object_desc(q_name, q_ptr, true, 3);
/* Get weapon flags */
auto const flags = object_flags(q_ptr);
@@ -3913,7 +3913,7 @@ void show_equip_aux(bool_ mirror, object_filter_t const &filter)
idx++;
/* Description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Truncate the description */
o_name[lim] = 0;
@@ -4080,7 +4080,7 @@ void toggle_inven_equip()
*
* The item can be negative to mean "item on floor".
*/
-bool_ verify(const char *prompt, int item)
+bool verify(const char *prompt, int item)
{
char o_name[80];
@@ -4092,7 +4092,7 @@ bool_ verify(const char *prompt, int item)
o_ptr = get_object(item);
/* Describe */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Prompt */
sprintf(out_val, "%s %s? ", prompt, o_name);
@@ -4107,7 +4107,7 @@ bool_ verify(const char *prompt, int item)
*
* The item can be negative to mean "item on floor".
*/
-static bool_ get_item_allow(int item)
+static bool get_item_allow(int item)
{
/* Get object */
auto o_ptr = get_object(item);
@@ -4115,7 +4115,7 @@ static bool_ get_item_allow(int item)
/* No inscription */
if (o_ptr->inscription.empty())
{
- return TRUE;
+ return true;
}
/* Find a '!' */
@@ -4128,7 +4128,7 @@ static bool_ get_item_allow(int item)
if ((s[1] == command_cmd) || (s[1] == '*'))
{
/* Verify the choice */
- if (!verify("Really try", item)) return (FALSE);
+ if (!verify("Really try", item)) return false;
}
/* Find another '!' */
@@ -4136,7 +4136,7 @@ static bool_ get_item_allow(int item)
}
/* Allow it */
- return (TRUE);
+ return true;
}
@@ -4149,7 +4149,7 @@ static bool get_item_okay(int i, object_filter_t const &filter)
/* Illegal items */
if ((i < 0) || (i >= INVEN_TOTAL))
{
- return (FALSE);
+ return false;
}
/* Verify the item */
@@ -4199,7 +4199,7 @@ static int get_tag(int *cp, char tag)
*cp = i;
/* Success */
- return (TRUE);
+ return true;
}
/* Check the special tags */
@@ -4209,7 +4209,7 @@ static int get_tag(int *cp, char tag)
*cp = i;
/* Success */
- return (TRUE);
+ return true;
}
/* Find another '@' */
@@ -4218,7 +4218,7 @@ static int get_tag(int *cp, char tag)
}
/* No such tag */
- return (FALSE);
+ return false;
}
/*
@@ -4298,7 +4298,7 @@ static void show_floor(int y, int x, object_filter_t const &filter)
o_ptr = &o_list[floor_list[i]];
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Hack -- enforce max length */
o_name[lim] = '\0';
@@ -4365,26 +4365,26 @@ static void show_floor(int y, int x, object_filter_t const &filter)
* This version of get_item() is called by get_item() when
* the easy_floor is on.
*/
-static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode, object_filter_t const &filter, select_by_name_t const &select_by_name)
+static bool get_item_floor(int *cp, const char *pmt, const char *str, int mode, object_filter_t const &filter, select_by_name_t const &select_by_name)
{
char n1 = 0, n2 = 0, which = ' ';
int j, k, i1, i2, e1, e2;
- bool_ done, item;
+ bool done, item;
- bool_ oops = FALSE;
+ bool oops = false;
- bool_ equip = FALSE;
- bool_ inven = FALSE;
- bool_ floor = FALSE;
- bool_ automat = FALSE;
+ bool equip = false;
+ bool inven = false;
+ bool floor = false;
+ bool automat = false;
- bool_ allow_equip = FALSE;
- bool_ allow_inven = FALSE;
- bool_ allow_floor = FALSE;
+ bool allow_equip = false;
+ bool allow_inven = false;
+ bool allow_floor = false;
- bool_ toggle = FALSE;
+ bool toggle = false;
char tmp_val[160];
char out_val[160];
@@ -4411,7 +4411,7 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
if (item_tester_okay(o_ptr, filter))
{
/* Success */
- return (TRUE);
+ return true;
}
}
@@ -4419,16 +4419,16 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
else if (get_item_okay(*cp, filter))
{
/* Success */
- return (TRUE);
+ return true;
}
}
/* Extract args */
- if (mode & (USE_EQUIP)) equip = TRUE;
- if (mode & (USE_INVEN)) inven = TRUE;
- if (mode & (USE_FLOOR)) floor = TRUE;
- if (mode & (USE_AUTO)) automat = TRUE;
+ if (mode & (USE_EQUIP)) equip = true;
+ if (mode & (USE_INVEN)) inven = true;
+ if (mode & (USE_FLOOR)) floor = true;
+ if (mode & (USE_AUTO)) automat = true;
/* Paranoia XXX XXX XXX */
@@ -4436,10 +4436,10 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/* Not done */
- done = FALSE;
+ done = false;
/* No item selected */
- item = FALSE;
+ item = false;
/* Full inventory */
@@ -4474,22 +4474,22 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
int const floor_num = floor_list.size(); // "int" for warning avoidance
/* Accept inventory */
- if (i1 <= i2) allow_inven = TRUE;
+ if (i1 <= i2) allow_inven = true;
/* Accept equipment */
- if (e1 <= e2) allow_equip = TRUE;
+ if (e1 <= e2) allow_equip = true;
/* Accept floor */
- if (!floor_list.empty()) allow_floor = TRUE;
+ if (!floor_list.empty()) allow_floor = true;
/* Require at least one legal choice */
if (!allow_inven && !allow_equip && !allow_floor)
{
/* Oops */
- oops = TRUE;
+ oops = true;
/* Done */
- done = TRUE;
+ done = true;
}
/* Analyze choices */
@@ -4693,7 +4693,7 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
{
case ESCAPE:
{
- done = TRUE;
+ done = true;
break;
}
@@ -4755,7 +4755,7 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
* is only one item, we will always select it.
* If we aren't examining the floor and there is only
* one item, we will select it if floor_query_flag
- * is FALSE.
+ * is false.
*/
if (floor_num == 1)
{
@@ -4767,14 +4767,14 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/* Allow player to "refuse" certain actions */
if (!get_item_allow(k))
{
- done = TRUE;
+ done = true;
break;
}
/* Accept that choice */
(*cp) = k;
- item = TRUE;
- done = TRUE;
+ item = true;
+ done = true;
break;
}
@@ -4824,14 +4824,14 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/* Allow player to "refuse" certain actions */
if (!get_item_allow(k))
{
- done = TRUE;
+ done = true;
break;
}
/* Accept that choice */
(*cp) = k;
- item = TRUE;
- done = TRUE;
+ item = true;
+ done = true;
break;
}
@@ -4861,14 +4861,14 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/* Allow player to "refuse" certain actions */
if (!get_item_allow(k))
{
- done = TRUE;
+ done = true;
break;
}
/* Accept that choice */
(*cp) = k;
- item = TRUE;
- done = TRUE;
+ item = true;
+ done = true;
}
break;
}
@@ -4883,14 +4883,14 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/* Allow player to "refuse" certain actions */
if (!get_item_allow(k))
{
- done = TRUE;
+ done = true;
break;
}
/* Accept that choice */
(*cp) = k;
- item = TRUE;
- done = TRUE;
+ item = true;
+ done = true;
break;
}
@@ -4905,8 +4905,8 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
if (auto i = select_by_name(filter))
{
(*cp) = *i;
- item = TRUE;
- done = TRUE;
+ item = true;
+ done = true;
}
break;
}
@@ -4970,21 +4970,21 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/* Verify the item */
if (ver && !verify("Try", k))
{
- done = TRUE;
+ done = true;
break;
}
/* Allow player to "refuse" certain actions */
if (!get_item_allow(k))
{
- done = TRUE;
+ done = true;
break;
}
/* Accept that choice */
(*cp) = k;
- item = TRUE;
- done = TRUE;
+ item = true;
+ done = true;
break;
}
}
@@ -5036,7 +5036,7 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
/*
* Let the user select an item, save its "index"
*
- * Return TRUE only if an acceptable item was chosen by the user.
+ * Return true only if an acceptable item was chosen by the user.
*
* The selected item must satisfy the "item_tester_hook()" function,
* if that hook is set, and the "item_tester_tval", if that value is set.
@@ -5060,27 +5060,27 @@ static bool_ get_item_floor(int *cp, const char *pmt, const char *str, int mode,
* and prompt for its use.
*
* If a legal item is selected from the inventory, we save it in "cp"
- * directly (0 to 35), and return TRUE.
+ * directly (0 to 35), and return true.
*
* If a legal item is selected from the floor, we save it in "cp" as
- * a negative (-1 to -511), and return TRUE.
+ * a negative (-1 to -511), and return true.
*
* If no item is available, we do nothing to "cp", and we display a
- * warning message, using "str" if available, and return FALSE.
+ * warning message, using "str" if available, and return false.
*
- * If no item is selected, we do nothing to "cp", and return FALSE.
+ * If no item is selected, we do nothing to "cp", and return false.
*
* Global "p_ptr->command_new" is used when viewing the inventory or equipment
* to allow the user to enter a command while viewing those screens, and
* also to induce "auto-enter" of stores, and other such stuff.
*
* Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
- * If it is TRUE then we are viewing inventory, else equipment.
+ * If it is true then we are viewing inventory, else equipment.
*
* We always erase the prompt when we are done, leaving a blank line,
* or a warning message, if appropriate, if no items are available.
*/
-bool_ get_item(int *cp, const char *pmt, const char *str, int mode, object_filter_t const &filter, select_by_name_t const &select_by_name)
+bool get_item(int *cp, const char *pmt, const char *str, int mode, object_filter_t const &filter, select_by_name_t const &select_by_name)
{
automatizer_create = false;
return get_item_floor(cp, pmt, str, mode, filter, select_by_name);
@@ -5091,12 +5091,12 @@ bool_ get_item(int *cp, const char *pmt, const char *str, int mode, object_filte
*/
static bool item_tester_hook_getable(object_type const *o_ptr)
{
- if (!inven_carry_okay(o_ptr)) return (FALSE);
+ if (!inven_carry_okay(o_ptr)) return false;
- if ((o_ptr->tval == TV_HYPNOS) && (!get_skill(SKILL_SYMBIOTIC))) return FALSE;
+ if ((o_ptr->tval == TV_HYPNOS) && (!get_skill(SKILL_SYMBIOTIC))) return false;
/* Assume yes */
- return (TRUE);
+ return true;
}
/*
@@ -5192,7 +5192,7 @@ void pickup_ammo()
/* Describe the object */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Message */
msg_format("You have %s (%c).", o_name, index_to_label(slot));
@@ -5247,7 +5247,7 @@ void object_pickup(int this_o_idx)
object_known(o_ptr);
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Note that the pack is too full */
if (!inven_carry_okay(o_ptr) && !object_similar(o_ptr, &p_ptr->inventory[INVEN_AMMO]))
@@ -5277,7 +5277,7 @@ void object_pickup(int this_o_idx)
}
else
{
- slot = inven_carry(o_ptr, FALSE);
+ slot = inven_carry(o_ptr, false);
}
/* Sanity check */
@@ -5289,7 +5289,7 @@ void object_pickup(int this_o_idx)
object_track(o_ptr);
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Message */
msg_format("You have %s (%c).", o_name, index_to_label(slot));
@@ -5319,7 +5319,7 @@ static void absorb_gold(cave_type const *c_ptr)
if (o_ptr->tval == TV_GOLD)
{
char goldname[80];
- object_desc(goldname, o_ptr, TRUE, 3);
+ object_desc(goldname, o_ptr, true, 3);
/* Message */
msg_format("You have found %ld gold pieces worth of %s.",
(long)o_ptr->pval, goldname);
@@ -5398,7 +5398,7 @@ void py_pickup_floor(int pickup)
{
/* Describe */
char o_name[80] = "";
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Message */
msg_format("You see %s.", o_name);
@@ -5406,13 +5406,13 @@ void py_pickup_floor(int pickup)
else
{
/* Are we actually going to pick up? */
- bool_ do_pickup = TRUE;
+ bool do_pickup = true;
/* Hack -- query every item */
if (options->carry_query_flag || !can_carry_heavy(&o_list[floor_o_idx]))
{
char o_name[80] = "";
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
if (!inven_carry_okay(o_ptr) && !object_similar(o_ptr, &p_ptr->inventory[INVEN_AMMO]))
{
@@ -5452,12 +5452,12 @@ void py_pickup_floor(int pickup)
{
s16b this_o_idx = 0 - item;
- bool_ do_pickup = TRUE;
+ bool do_pickup = true;
if (!can_carry_heavy(&o_list[this_o_idx]))
{
/* Describe the object */
char o_name[80] = "";
- object_desc(o_name, &o_list[this_o_idx], TRUE, 3);
+ object_desc(o_name, &o_list[this_o_idx], true, 3);
/* Prompt */
char out_val[160];
@@ -5505,7 +5505,7 @@ static void gain_flag_group(object_type *o_ptr)
{
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("%s gains access to the %s realm.", o_name, flags_groups()[grp].name);
}
}
@@ -5578,7 +5578,7 @@ static void gain_flag_group_flag(object_type *o_ptr)
// Describe what happened
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
msg_format("%s gains a new power from the %s realm.", o_name, flags_groups()[grp].name);
// We're done.
@@ -5647,12 +5647,12 @@ void object_gain_level(object_type *o_ptr)
/*
* Item sets fcts
*/
-bool_ wield_set(s16b a_idx, s16b set_idx, bool_ silent)
+bool wield_set(s16b a_idx, s16b set_idx, bool silent)
{
auto &set_info = game->edit_data.set_info;
auto const &a_info = game->edit_data.a_info;
- if ( -1 == a_info[a_idx].set) return (FALSE);
+ if ( -1 == a_info[a_idx].set) return false;
auto s_ptr = &set_info[set_idx];
@@ -5668,7 +5668,7 @@ bool_ wield_set(s16b a_idx, s16b set_idx, bool_ silent)
if (!s_ptr->arts[i].present)
{
s_ptr->num_use++;
- s_ptr->arts[i].present = TRUE;
+ s_ptr->arts[i].present = true;
if (s_ptr->num_use > s_ptr->num)
{
msg_print("ERROR!! s_ptr->num_use > s_ptr->use");
@@ -5677,18 +5677,18 @@ bool_ wield_set(s16b a_idx, s16b set_idx, bool_ silent)
{
cmsg_format(TERM_GREEN, "%s item set completed.", s_ptr->name.c_str());
}
- return (TRUE);
+ return true;
}
- return (FALSE);
+ return false;
}
-bool_ takeoff_set(s16b a_idx, s16b set_idx)
+bool takeoff_set(s16b a_idx, s16b set_idx)
{
auto &set_info = game->edit_data.set_info;
auto const &a_info = game->edit_data.a_info;
- if ( -1 == a_info[a_idx].set) return (FALSE);
+ if ( -1 == a_info[a_idx].set) return false;
auto s_ptr = &set_info[set_idx];
@@ -5703,7 +5703,7 @@ bool_ takeoff_set(s16b a_idx, s16b set_idx)
if (s_ptr->arts[i].present)
{
- s_ptr->arts[i].present = FALSE;
+ s_ptr->arts[i].present = false;
assert(s_ptr->num_use > 0);
s_ptr->num_use--;
@@ -5713,10 +5713,10 @@ bool_ takeoff_set(s16b a_idx, s16b set_idx)
cmsg_format(TERM_GREEN, "%s item set not complete anymore.", s_ptr->name.c_str());
}
- return (TRUE);
+ return true;
}
- return (FALSE);
+ return false;
}
void apply_set(s16b a_idx, s16b set_idx)
@@ -5879,7 +5879,7 @@ bool artifact_p(object_type const *o_ptr)
*/
bool ego_item_p(object_type const *o_ptr)
{
- return o_ptr->name2 || (o_ptr->name2b ? TRUE : FALSE);
+ return o_ptr->name2 || (o_ptr->name2b ? true : false);
}
/*
diff --git a/src/object1.hpp b/src/object1.hpp
index dc3917a6..f02747db 100644
--- a/src/object1.hpp
+++ b/src/object1.hpp
@@ -12,22 +12,22 @@ typedef std::function<boost::optional<int>(object_filter_t const &filter)> selec
byte get_item_letter_color(object_type const *o_ptr);
void object_pickup(int this_o_idx);
void apply_set(s16b a_idx, s16b set_idx);
-bool_ takeoff_set(s16b a_idx, s16b set_idx);
-bool_ wield_set(s16b a_idx, s16b set_idx, bool_ silent);
-bool_ verify(const char *prompt, int item);
+bool takeoff_set(s16b a_idx, s16b set_idx);
+bool wield_set(s16b a_idx, s16b set_idx, bool silent);
+bool verify(const char *prompt, int item);
void flavor_init();
void reset_visuals();
boost::optional<int> object_power(object_type *o_ptr);
-extern bool_ object_flags_no_set;
+extern bool object_flags_no_set;
object_flag_set object_flags(object_type const *o_ptr);
object_flag_set object_flags_known(object_type const *o_ptr);
s32b calc_object_need_exp(object_type const *o_ptr);
void object_desc(char *buf, object_type const *o_ptr, int pref, int mode);
void object_desc_store(char *buf, object_type *o_ptr, int pref, int mode);
-bool_ object_out_desc(object_type *o_ptr, FILE *fff, bool_ trim_down, bool_ wait_for_it);
+bool object_out_desc(object_type *o_ptr, FILE *fff, bool trim_down, bool wait_for_it);
char index_to_label(int i);
-s16b wield_slot_ideal(object_type const *o_ptr, bool_ ideal);
+s16b wield_slot_ideal(object_type const *o_ptr, bool ideal);
s16b wield_slot(object_type const *o_ptr);
const char *describe_use(int i);
void display_inven();
@@ -35,7 +35,7 @@ void display_equip();
void show_inven_full();
void show_equip_full();
void toggle_inven_equip();
-bool_ get_item(int *cp, const char *pmt, const char *str, int mode, object_filter_t const &filter = object_filter::True(), select_by_name_t const &select_by_name = select_by_name_t());
+bool get_item(int *cp, const char *pmt, const char *str, int mode, object_filter_t const &filter = object_filter::True(), select_by_name_t const &select_by_name = select_by_name_t());
const char *item_activation(object_type *o_ptr);
void py_pickup_floor(int pickup);
void object_gain_level(object_type *o_ptr);
diff --git a/src/object2.cc b/src/object2.cc
index a037af5a..89b4768d 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -378,11 +378,11 @@ void rescue_artifact(object_type *o_ptr)
/* Mega-Hack -- Preserve the artifact */
if (o_ptr->tval == TV_RANDART)
{
- game->random_artifacts[o_ptr->sval].generated = FALSE;
+ game->random_artifacts[o_ptr->sval].generated = false;
}
else if (o_ptr->k_ptr->flags & TR_NORM_ART)
{
- o_ptr->k_ptr->artifact = FALSE;
+ o_ptr->k_ptr->artifact = false;
}
else
{
@@ -740,7 +740,7 @@ bool object_known_p(object_type const *o_ptr)
void object_aware(object_type *o_ptr)
{
/* Fully aware of the effects */
- o_ptr->k_ptr->aware = TRUE;
+ o_ptr->k_ptr->aware = true;
}
/**
@@ -1338,14 +1338,14 @@ s32b object_value(object_type const *o_ptr)
*
* Chests, and activatable items, never stack (for various reasons).
*/
-bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
+bool object_similar(object_type const *o_ptr, object_type const *j_ptr)
{
int total = o_ptr->number + j_ptr->number;
/* Require identical object types */
if (o_ptr->k_ptr != j_ptr->k_ptr)
{
- return FALSE;
+ return false;
}
/* Extract the flags */
@@ -1353,7 +1353,7 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
auto const j_flags = object_flags(j_ptr);
if ((o_flags & TR_SPELL_CONTAIN) || (j_flags & TR_SPELL_CONTAIN))
- return FALSE;
+ return false;
/* Analyze the items */
switch (o_ptr->tval)
@@ -1361,58 +1361,58 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
/* School Book */
case TV_BOOK:
{
- if (!object_known_p(o_ptr) || !object_known_p(j_ptr)) return FALSE;
+ if (!object_known_p(o_ptr) || !object_known_p(j_ptr)) return false;
/* Beware artifatcs should not combibne with "lesser" thing */
- if (artifact_p(o_ptr) != artifact_p(j_ptr)) return (FALSE);
+ if (artifact_p(o_ptr) != artifact_p(j_ptr)) return false;
/* Do not combine different ego or normal ones */
- if (ego_item_p(o_ptr) != ego_item_p(j_ptr)) return (FALSE);
+ if (ego_item_p(o_ptr) != ego_item_p(j_ptr)) return false;
/* Random books should stack if they are identical */
if ((o_ptr->sval == 255) && (j_ptr->sval == 255))
{
if (o_ptr->pval != j_ptr->pval)
- return (FALSE);
+ return false;
}
- return (TRUE);
+ return true;
}
case TV_RANDART:
{
- return FALSE;
+ return false;
}
case TV_INSTRUMENT:
{
- return FALSE;
+ return false;
}
case TV_HYPNOS:
case TV_EGG:
{
- return FALSE;
+ return false;
}
/* Totems */
case TV_TOTEM:
{
- if ((o_ptr->pval == j_ptr->pval) && (o_ptr->pval2 == j_ptr->pval2)) return TRUE;
- return FALSE;
+ if ((o_ptr->pval == j_ptr->pval) && (o_ptr->pval2 == j_ptr->pval2)) return true;
+ return false;
}
/* Corpses*/
case TV_CORPSE:
{
- return FALSE;
+ return false;
}
/* Food and Potions and Scrolls */
case TV_POTION:
case TV_POTION2:
{
- if (o_ptr->pval2 != j_ptr->pval2) return FALSE;
+ if (o_ptr->pval2 != j_ptr->pval2) return false;
/* Assume okay */
break;
@@ -1420,8 +1420,8 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
case TV_SCROLL:
{
- if (o_ptr->pval != j_ptr->pval) return FALSE;
- if (o_ptr->pval2 != j_ptr->pval2) return FALSE;
+ if (o_ptr->pval != j_ptr->pval) return false;
+ if (o_ptr->pval2 != j_ptr->pval2) return false;
break;
}
@@ -1494,7 +1494,7 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
/* Rods */
case TV_ROD_MAIN:
{
- return FALSE;
+ return false;
break;
}
@@ -1530,7 +1530,7 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
if (!object_known_p(o_ptr) || !object_known_p(j_ptr)) return (0);
/* Require identical "turns of light" */
- if (o_ptr->timeout != j_ptr->timeout) return (FALSE);
+ if (o_ptr->timeout != j_ptr->timeout) return false;
/* Fall through */
}
@@ -1544,24 +1544,24 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
if (object_known_p(o_ptr) != object_known_p(j_ptr)) return (0);
/* Require identical "bonuses" */
- if (o_ptr->to_h != j_ptr->to_h) return (FALSE);
- if (o_ptr->to_d != j_ptr->to_d) return (FALSE);
- if (o_ptr->to_a != j_ptr->to_a) return (FALSE);
+ if (o_ptr->to_h != j_ptr->to_h) return false;
+ if (o_ptr->to_d != j_ptr->to_d) return false;
+ if (o_ptr->to_a != j_ptr->to_a) return false;
/* Require identical "pval" code */
- if (o_ptr->pval != j_ptr->pval) return (FALSE);
+ if (o_ptr->pval != j_ptr->pval) return false;
/* Require identical exploding status code */
- if (o_ptr->pval2 != j_ptr->pval2) return (FALSE);
+ if (o_ptr->pval2 != j_ptr->pval2) return false;
/* Require identical "artifact" names */
- if (o_ptr->name1 != j_ptr->name1) return (FALSE);
+ if (o_ptr->name1 != j_ptr->name1) return false;
/* Require identical "ego-item" names */
- if (o_ptr->name2 != j_ptr->name2) return (FALSE);
+ if (o_ptr->name2 != j_ptr->name2) return false;
/* Do not combine different ego or normal ones */
- if (o_ptr->name2b != j_ptr->name2b) return (FALSE);
+ if (o_ptr->name2b != j_ptr->name2b) return false;
/* Hack -- Never stack "powerful" items */
/*
@@ -1569,17 +1569,17 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
-- wilh
*/
/* #if 0 */
- if (o_ptr->xtra1 || j_ptr->xtra1) return (FALSE);
+ if (o_ptr->xtra1 || j_ptr->xtra1) return false;
/* #endif */
/* Hack -- Never stack recharging items */
if ((o_ptr->timeout || j_ptr->timeout) &&
- (o_ptr->tval != TV_LITE)) return (FALSE);
+ (o_ptr->tval != TV_LITE)) return false;
/* Require identical "values" */
- if (o_ptr->ac != j_ptr->ac) return (FALSE);
- if (o_ptr->dd != j_ptr->dd) return (FALSE);
- if (o_ptr->ds != j_ptr->ds) return (FALSE);
+ if (o_ptr->ac != j_ptr->ac) return false;
+ if (o_ptr->dd != j_ptr->dd) return false;
+ if (o_ptr->ds != j_ptr->ds) return false;
/* Probably okay */
break;
@@ -1588,7 +1588,7 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
/* UHH ugly hack for the mushroom quest, sorry */
case TV_FOOD:
{
- if (o_ptr->pval2 != j_ptr->pval2) return (FALSE);
+ if (o_ptr->pval2 != j_ptr->pval2) return false;
break;
}
@@ -1621,7 +1621,7 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
/* They match, so they must be similar */
- return (TRUE);
+ return true;
}
@@ -1876,7 +1876,7 @@ static void finalize_randart(object_type* o_ptr, int lev)
o_ptr->xtra2 = activation_info[ra_ptr->activation].spell;
ra_ptr->level = lev;
- ra_ptr->generated = TRUE;
+ ra_ptr->generated = true;
return;
}
}
@@ -1892,7 +1892,7 @@ static void object_mention(object_type *o_ptr)
char o_name[80];
/* Describe */
- object_desc_store(o_name, o_ptr, FALSE, 0);
+ object_desc_store(o_name, o_ptr, false, 0);
/* Artifact */
if (artifact_p(o_ptr))
@@ -2034,13 +2034,13 @@ void random_artifact_resistance(object_type * o_ptr)
*
* Note -- see "make_artifact()" and "apply_magic()"
*/
-static bool_ make_artifact_special(object_type *o_ptr)
+static bool make_artifact_special(object_type *o_ptr)
{
auto const &k_info = game->edit_data.k_info;
auto const &a_info = game->edit_data.a_info;
/* No artifacts in the town */
- if (!dun_level) return (FALSE);
+ if (!dun_level) return false;
/* Check the artifact list (just the "specials") */
for (std::size_t i = 0; i < a_info.size(); i++)
@@ -2102,11 +2102,11 @@ static bool_ make_artifact_special(object_type *o_ptr)
}
/* Success */
- return (TRUE);
+ return true;
}
/* Failure */
- return (FALSE);
+ return false;
}
@@ -2122,10 +2122,10 @@ static bool make_artifact(object_type *o_ptr)
auto const &a_info = game->edit_data.a_info;
/* No artifacts in the town */
- if (!dun_level) return (FALSE);
+ if (!dun_level) return false;
/* Paranoia -- no "plural" artifacts */
- if (o_ptr->number != 1) return (FALSE);
+ if (o_ptr->number != 1) return false;
/* Check the artifact list (skip the "specials") */
for (std::size_t i = 0; i < a_info.size(); i++)
@@ -2177,11 +2177,11 @@ static bool make_artifact(object_type *o_ptr)
}
/* Success */
- return (TRUE);
+ return true;
}
/* Failure */
- return (FALSE);
+ return false;
}
/*
@@ -2189,13 +2189,13 @@ static bool make_artifact(object_type *o_ptr)
*
* This routine should only be called by "apply_magic()"
*/
-static bool_ make_ego_item(object_type *o_ptr, bool_ good)
+static bool make_ego_item(object_type *o_ptr, bool good)
{
auto const &e_info = game->edit_data.e_info;
- bool_ ret = FALSE;
+ bool ret = false;
- if (artifact_p(o_ptr) || o_ptr->name2) return (FALSE);
+ if (artifact_p(o_ptr) || o_ptr->name2) return false;
std::vector<size_t> ok_ego;
@@ -2203,7 +2203,7 @@ static bool_ make_ego_item(object_type *o_ptr, bool_ good)
for (size_t i = 0; i < e_info.size(); i++)
{
auto e_ptr = &e_info[i];
- bool_ ok = FALSE;
+ bool ok = false;
/* Skip "empty" items */
if (e_ptr->name.empty())
@@ -2216,7 +2216,7 @@ static bool_ make_ego_item(object_type *o_ptr, bool_ good)
{
if (e_ptr->tval[j] == o_ptr->tval)
{
- if ((e_ptr->min_sval[j] <= o_ptr->sval) && (e_ptr->max_sval[j] >= o_ptr->sval)) ok = TRUE;
+ if ((e_ptr->min_sval[j] <= o_ptr->sval) && (e_ptr->max_sval[j] >= o_ptr->sval)) ok = true;
}
if (ok) break;
@@ -2275,7 +2275,7 @@ static bool_ make_ego_item(object_type *o_ptr, bool_ good)
o_ptr->name2 = j;
/* Success */
- ret = TRUE;
+ ret = true;
break;
}
@@ -2321,7 +2321,7 @@ static bool_ make_ego_item(object_type *o_ptr, bool_ good)
o_ptr->name2b = j;
/* Success */
- ret = TRUE;
+ ret = true;
break;
}
}
@@ -2362,12 +2362,12 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
{
/* Make ego item */
if (rand_int(RANDART_WEAPON) == 1) create_artifact(o_ptr, false, true);
- else make_ego_item(o_ptr, TRUE);
+ else make_ego_item(o_ptr, true);
}
else if (power < -1)
{
/* Make ego item */
- make_ego_item(o_ptr, FALSE);
+ make_ego_item(o_ptr, false);
}
/* Good */
@@ -2478,12 +2478,12 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
{
/* Make ego item */
if (rand_int(RANDART_ARMOR) == 1) create_artifact(o_ptr, false, true);
- else make_ego_item(o_ptr, TRUE);
+ else make_ego_item(o_ptr, true);
}
else if (power < -1)
{
/* Make ego item */
- make_ego_item(o_ptr, FALSE);
+ make_ego_item(o_ptr, false);
}
/* Good */
@@ -2604,12 +2604,12 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
{
/* Make ego item */
if (rand_int(RANDART_JEWEL) == 1) create_artifact(o_ptr, false, true);
- else make_ego_item(o_ptr, TRUE);
+ else make_ego_item(o_ptr, true);
}
else if (power < -1)
{
/* Make ego item */
- make_ego_item(o_ptr, FALSE);
+ make_ego_item(o_ptr, false);
}
/* Apply magic (good or bad) according to type */
@@ -3041,13 +3041,13 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power)
}
else
{
- make_ego_item(o_ptr, TRUE);
+ make_ego_item(o_ptr, true);
}
}
else if (power < -1)
{
/* Make ego item */
- make_ego_item(o_ptr, FALSE);
+ make_ego_item(o_ptr, false);
}
/* Apply magic (good or bad) according to type */
@@ -3119,7 +3119,7 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power)
{
/* Hack -- choose a monster */
int r_idx, count = 0;
- bool_ OK = FALSE;
+ bool OK = false;
while ((!OK) && (count < 1000))
{
@@ -3129,7 +3129,7 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power)
if (r_ptr->flags & RF_HAS_EGG)
{
o_ptr->pval2 = r_idx;
- OK = TRUE;
+ OK = true;
}
count++;
}
@@ -3289,7 +3289,7 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power)
}
/* Add a random glag to the ego item */
-void add_random_ego_flag(object_type *o_ptr, ego_flag_set const &fego, bool_ *limit_blows)
+void add_random_ego_flag(object_type *o_ptr, ego_flag_set const &fego, bool *limit_blows)
{
if (fego & ETR_SUSTAIN)
{
@@ -3721,7 +3721,7 @@ void add_random_ego_flag(object_type *o_ptr, ego_flag_set const &fego, bool_ *li
* "good" and "great" arguments are false. As a total hack, if "great" is
* true, then the item gets 3 extra "attempts" to become an artifact.
*/
-void apply_magic(object_type *o_ptr, int lev, bool_ okay, bool_ good, bool_ great, boost::optional<int> force_power)
+void apply_magic(object_type *o_ptr, int lev, bool okay, bool good, bool great, boost::optional<int> force_power)
{
auto &a_info = game->edit_data.a_info;
auto const &e_info = game->edit_data.e_info;
@@ -3774,7 +3774,7 @@ void apply_magic(object_type *o_ptr, int lev, bool_ okay, bool_ good, bool_ grea
charge_stick(o_ptr);
}
- k_ptr->artifact = TRUE;
+ k_ptr->artifact = true;
if (options->cheat_peek || p_ptr->precognition)
{
@@ -3891,7 +3891,7 @@ void apply_magic(object_type *o_ptr, int lev, bool_ okay, bool_ good, bool_ grea
if (a_ptr->cost > 50000L) rating += 10;
/* Set the good item flag */
- good_item_flag = TRUE;
+ good_item_flag = true;
/* Cheat -- peek at the item */
if (options->cheat_peek || p_ptr->precognition)
@@ -3989,7 +3989,7 @@ void apply_magic(object_type *o_ptr, int lev, bool_ okay, bool_ good, bool_ grea
else if (o_ptr->name2)
{
int j;
- bool_ limit_blows = FALSE;
+ bool limit_blows = false;
s16b e_idx;
e_idx = o_ptr->name2;
@@ -4302,7 +4302,7 @@ static bool kind_is_theme(obj_theme const *theme, object_kind const *k_ptr)
}
/* Not a match */
- return (FALSE);
+ return false;
}
/*
@@ -4481,7 +4481,7 @@ bool kind_is_artifactable(object_kind const *k_ptr)
* through the forge--object_prep()--apply_magic() sequence and
* get_obj_num() should never be called for that purpose XXX XXX XXX
*/
-bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &theme)
+bool make_object(object_type *j_ptr, bool good, bool great, obj_theme const &theme)
{
auto &alloc = game->alloc;
@@ -4544,14 +4544,14 @@ bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &
}
/* Handle failure */
- if (!k_idx) return (FALSE);
+ if (!k_idx) return false;
/* Prepare the object */
object_prep(j_ptr, k_idx);
}
/* Apply magic (allow artifacts) */
- apply_magic(j_ptr, object_level, TRUE, good, great);
+ apply_magic(j_ptr, object_level, true, good, great);
/* Hack -- generate multiple spikes/missiles */
switch (j_ptr->tval)
@@ -4586,7 +4586,7 @@ bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &
}
/* Success */
- return (TRUE);
+ return true;
}
@@ -4600,7 +4600,7 @@ bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &
*
* This routine requires a clean floor grid destination.
*/
-void place_object(int y, int x, bool_ good, bool_ great, int where)
+void place_object(int y, int x, bool good, bool great, int where)
{
auto const &d_info = game->edit_data.d_info;
auto &a_info = game->edit_data.a_info;
@@ -4694,7 +4694,7 @@ void place_object(int y, int x, bool_ good, bool_ great, int where)
}
else if (q_ptr->tval == TV_RANDART)
{
- random_artifacts[q_ptr->sval].generated = FALSE;
+ random_artifacts[q_ptr->sval].generated = false;
}
}
}
@@ -4711,7 +4711,7 @@ void place_object(int y, int x, bool_ good, bool_ great, int where)
*
* The location must be a legal, clean, floor grid.
*/
-bool_ make_gold(object_type *j_ptr)
+bool make_gold(object_type *j_ptr)
{
auto const &k_info = game->edit_data.k_info;
@@ -4746,7 +4746,7 @@ bool_ make_gold(object_type *j_ptr)
}
/* Success */
- return (TRUE);
+ return true;
}
@@ -4848,17 +4848,17 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
char o_name[80];
- bool_ flag = FALSE;
- bool_ done = FALSE;
+ bool flag = false;
+ bool done = false;
- bool_ plural = FALSE;
+ bool plural = false;
/* Extract plural */
- if (j_ptr->number != 1) plural = TRUE;
+ if (j_ptr->number != 1) plural = true;
/* Describe object */
- object_desc(o_name, j_ptr, FALSE, 0);
+ object_desc(o_name, j_ptr, false, 0);
/* Handle normal "breakage" */
@@ -4892,7 +4892,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
/* Scan local grids */
for (dx = -3; dx <= 3; dx++)
{
- bool_ comb = FALSE;
+ bool comb = false;
/* Calculate actual distance */
d = (dy * dy) + (dx * dx);
@@ -4926,7 +4926,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
object_type *o_ptr = &o_list[this_o_idx];
/* Check for possible combination */
- if (object_similar(o_ptr, j_ptr)) comb = TRUE;
+ if (object_similar(o_ptr, j_ptr)) comb = true;
/* Count objects */
k++;
@@ -4958,7 +4958,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
bx = tx;
/* Okay */
- flag = TRUE;
+ flag = true;
}
}
@@ -5013,7 +5013,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
if (!cave_clean_bold(by, bx)) continue;
/* Okay */
- flag = TRUE;
+ flag = true;
}
@@ -5033,7 +5033,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
object_absorb(o_ptr, j_ptr);
/* Success */
- done = TRUE;
+ done = true;
/* Done */
break;
@@ -5065,7 +5065,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
}
else if (j_ptr->tval == TV_RANDART)
{
- random_artifacts[j_ptr->sval].generated = FALSE;
+ random_artifacts[j_ptr->sval].generated = false;
}
/* Failure */
@@ -5092,7 +5092,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
c_ptr->o_idxs.push_back(o_idx);
/* Success */
- done = TRUE;
+ done = true;
}
/* Note the spot */
@@ -5120,7 +5120,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
/*
* Scatter some "great" objects near the player
*/
-void acquirement(int y1, int x1, int num, bool_ great)
+void acquirement(int y1, int x1, int num, bool great)
{
auto const &d_info = game->edit_data.d_info;
@@ -5137,7 +5137,7 @@ void acquirement(int y1, int x1, int num, bool_ great)
object_wipe(i_ptr);
/* Make a good (or great) object (if possible) */
- if (!make_object(i_ptr, TRUE, great, d_info[dungeon_type].objs)) continue;
+ if (!make_object(i_ptr, true, great, d_info[dungeon_type].objs)) continue;
/* Drop the object */
drop_near(i_ptr, -1, y1, x1);
@@ -5183,7 +5183,7 @@ void inven_item_describe(int item)
char o_name[80];
/* Get a description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Print a message */
msg_format("You have %s.", o_name);
@@ -5340,7 +5340,7 @@ void floor_item_describe(int item)
char o_name[80];
/* Get a description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Print a message */
msg_format("You see %s.", o_name);
@@ -5432,12 +5432,12 @@ void inc_stack_size_ex(int item, int delta, optimize_flag opt, describe_flag des
/*
* Check if we have space for an item in the pack without overflow
*/
-bool_ inven_carry_okay(object_type const *o_ptr)
+bool inven_carry_okay(object_type const *o_ptr)
{
- if (o_ptr->tval == TV_GOLD) return FALSE;
+ if (o_ptr->tval == TV_GOLD) return false;
/* Empty slot? */
- if (inven_cnt < INVEN_PACK) return (TRUE);
+ if (inven_cnt < INVEN_PACK) return true;
/* Similar slot? */
for (int j = 0; j < INVEN_PACK; j++)
@@ -5448,11 +5448,11 @@ bool_ inven_carry_okay(object_type const *o_ptr)
if (!j_ptr->k_ptr) continue;
/* Check if the two items can be combined */
- if (object_similar(j_ptr, o_ptr)) return (TRUE);
+ if (object_similar(j_ptr, o_ptr)) return true;
}
/* Nope */
- return (FALSE);
+ return false;
}
/**
@@ -5493,7 +5493,7 @@ static boost::optional<int> find_empty_slot()
* The "final" flag tells this function to bypass the "combine"
* and "reorder" code until later.
*/
-s16b inven_carry(object_type *o_ptr, bool_ final)
+s16b inven_carry(object_type *o_ptr, bool final)
{
// Auto-identify the item before we put it in the pack.
object_aware(o_ptr);
@@ -5649,7 +5649,7 @@ s16b inven_carry(object_type *o_ptr, bool_ final)
*
* Return the inventory slot into which the item is placed.
*/
-s16b inven_takeoff(int item, int amt, bool_ force_drop)
+s16b inven_takeoff(int item, int amt, bool force_drop)
{
int slot;
@@ -5682,7 +5682,7 @@ s16b inven_takeoff(int item, int amt, bool_ force_drop)
q_ptr->number = amt;
/* Describe the object */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, true, 3);
/* Took off weapon */
if (item == INVEN_WIELD)
@@ -5739,7 +5739,7 @@ s16b inven_takeoff(int item, int amt, bool_ force_drop)
else
{
/* Carry the object */
- slot = inven_carry(q_ptr, FALSE);
+ slot = inven_carry(q_ptr, false);
}
/* Message */
@@ -5757,7 +5757,7 @@ s16b inven_takeoff(int item, int amt, bool_ force_drop)
*
* The object will be dropped "near" the current location
*/
-void inven_drop(int item, int amt, int dy, int dx, bool_ silent)
+void inven_drop(int item, int amt, int dy, int dx, bool silent)
{
object_type forge;
object_type *q_ptr;
@@ -5781,7 +5781,7 @@ void inven_drop(int item, int amt, int dy, int dx, bool_ silent)
if (item >= INVEN_WIELD)
{
/* Take off first */
- item = inven_takeoff(item, amt, FALSE);
+ item = inven_takeoff(item, amt, false);
/* Access original object */
o_ptr = &p_ptr->inventory[item];
@@ -5814,7 +5814,7 @@ void inven_drop(int item, int amt, int dy, int dx, bool_ silent)
q_ptr->number = amt;
/* Describe local object */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, true, 3);
/* Message */
if (!silent) msg_format("You drop %s (%c).", o_name, index_to_label(item));
@@ -5836,7 +5836,7 @@ void inven_drop(int item, int amt, int dy, int dx, bool_ silent)
*/
void combine_pack()
{
- bool flag = FALSE;
+ bool flag = false;
/* Combine the pack (backwards) */
for (int i = INVEN_PACK; i > 0; i--)
@@ -5916,7 +5916,7 @@ void reorder_pack()
object_type *q_ptr;
object_type *j_ptr;
object_type *o_ptr;
- bool_ flag = FALSE;
+ bool flag = false;
/* Re-order the pack (forwards) */
@@ -5988,7 +5988,7 @@ void reorder_pack()
if (j >= i) continue;
/* Take note */
- flag = TRUE;
+ flag = true;
/* Get local object */
q_ptr = &forge;
@@ -6102,7 +6102,7 @@ void pack_decay(int item)
char desc[80];
/* Player notices each decaying object */
- object_desc(desc, o_ptr, TRUE, 3);
+ object_desc(desc, o_ptr, true, 3);
msg_format("You feel %s decompose.", desc);
/* Get local object */
@@ -6158,7 +6158,7 @@ void pack_decay(int item)
/* Named skeletons are artifacts */
i_ptr->name1 = 201;
}
- inven_carry(i_ptr, TRUE);
+ inven_carry(i_ptr, true);
}
}
}
@@ -6191,13 +6191,13 @@ void floor_decay(int item)
byte y = o_ptr->iy;
/* Maybe the player sees it */
- bool_ visible = player_can_see_bold(o_ptr->iy, o_ptr->ix);
+ bool visible = player_can_see_bold(o_ptr->iy, o_ptr->ix);
char desc[80];
if (visible)
{
/* Player notices each decaying object */
- object_desc(desc, o_ptr, TRUE, 3);
+ object_desc(desc, o_ptr, true, 3);
msg_format("You see %s decompose.", desc);
}
diff --git a/src/object2.hpp b/src/object2.hpp
index 692a1d66..f5d093e3 100644
--- a/src/object2.hpp
+++ b/src/object2.hpp
@@ -15,7 +15,7 @@ void inc_stack_size(int item, int delta);
void inc_stack_size_ex(int item, int delta, optimize_flag opt, describe_flag desc);
object_type *get_object(int item);
s32b calc_total_weight();
-void add_random_ego_flag(object_type *o_ptr, ego_flag_set const &fego, bool_ *limit_blows);
+void add_random_ego_flag(object_type *o_ptr, ego_flag_set const &fego, bool *limit_blows);
bool init_match_theme(obj_theme const &theme);
bool kind_is_artifactable(object_kind const *);
bool kind_is_legal(object_kind const *);
@@ -27,10 +27,10 @@ void floor_item_charges(int item);
void floor_item_describe(int item);
void floor_item_increase(int item, int num);
void floor_item_optimize(int item);
-bool_ inven_carry_okay(object_type const *o_ptr);
-s16b inven_carry(object_type *o_ptr, bool_ final);
-s16b inven_takeoff(int item, int amt, bool_ force_drop);
-void inven_drop(int item, int amt, int dy, int dx, bool_ silent);
+bool inven_carry_okay(object_type const *o_ptr);
+s16b inven_carry(object_type *o_ptr, bool final);
+s16b inven_takeoff(int item, int amt, bool force_drop);
+void inven_drop(int item, int amt, int dy, int dx, bool silent);
void excise_object_idx(int o_idx);
void delete_object_idx(int o_idx);
void delete_object(int y, int x);
@@ -46,19 +46,19 @@ void object_aware(object_type *o_ptr);
bool object_aware_p(object_type const *o_ptr);
s32b object_value(object_type const *o_ptr);
s32b object_value_real(object_type const *o_ptr);
-bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr);
+bool object_similar(object_type const *o_ptr, object_type const *j_ptr);
void object_absorb(object_type *o_ptr, object_type *j_ptr);
s16b lookup_kind(int tval, int sval);
void object_wipe(object_type *o_ptr);
void object_prep(object_type *o_ptr, int k_idx);
void object_copy(object_type *o_ptr, object_type *j_ptr);
-void apply_magic(object_type *o_ptr, int lev, bool_ okay, bool_ good, bool_ great, boost::optional<int> force_power = boost::none);
-bool_ make_object(object_type *j_ptr, bool_ good, bool_ great, obj_theme const &theme);
-void place_object(int y, int x, bool_ good, bool_ great, int where);
-bool_ make_gold(object_type *j_ptr);
+void apply_magic(object_type *o_ptr, int lev, bool okay, bool good, bool great, boost::optional<int> force_power = boost::none);
+bool make_object(object_type *j_ptr, bool good, bool great, obj_theme const &theme);
+void place_object(int y, int x, bool good, bool great, int where);
+bool make_gold(object_type *j_ptr);
void place_gold(int y, int x);
s16b drop_near(object_type *o_ptr, int chance, int y, int x);
-void acquirement(int y1, int x1, int num, bool_ great);
+void acquirement(int y1, int x1, int num, bool great);
void combine_pack();
void reorder_pack();
void random_artifact_resistance(object_type * o_ptr);
diff --git a/src/object_kind.hpp b/src/object_kind.hpp
index f9bd6a91..f82d1b86 100644
--- a/src/object_kind.hpp
+++ b/src/object_kind.hpp
@@ -64,15 +64,15 @@ struct object_kind
byte flavor = 0; /* Special object flavor (or zero) */
- bool_ easy_know = 0; /* This object is always known (if aware) */
+ bool easy_know = 0; /* This object is always known (if aware) */
- bool_ aware = 0; /* The player is "aware" of the item's effects */
+ bool aware = 0; /* The player is "aware" of the item's effects */
- bool_ allow_special = 0;
+ bool allow_special = 0;
byte btval = 0; /* Become Object type */
byte bsval = 0; /* Become Object sub type */
- bool_ artifact = 0; /* Is it a normal artifact(already generated) */
+ bool artifact = 0; /* Is it a normal artifact(already generated) */
boost::optional<int> power; /* Power granted */
diff --git a/src/player_race_mod.hpp b/src/player_race_mod.hpp
index 5b347bac..34f5be41 100644
--- a/src/player_race_mod.hpp
+++ b/src/player_race_mod.hpp
@@ -21,7 +21,7 @@ struct player_race_mod
std::string title;
std::string description;
- bool place = FALSE; /* TRUE = race race modifier, FALSE = Race modifier race */
+ bool place = false; /* true = race race modifier, false = Race modifier race */
char luck = '\0'; /* Luck */
s16b mana = 0; /* Mana % */
diff --git a/src/player_type.hpp b/src/player_type.hpp
index 47f7baa2..a5c41618 100644
--- a/src/player_type.hpp
+++ b/src/player_type.hpp
@@ -65,8 +65,8 @@ struct player_type
s32b wilderness_x = 0; /* Coordinates in the wilderness */
s32b wilderness_y = 0;
- bool wild_mode = false; /* TRUE = Small map, FLASE = Big map */
- bool old_wild_mode = false; /* TRUE = Small map, FLASE = Big map */
+ bool wild_mode = false; /* true = Small map, FLASE = Big map */
+ bool old_wild_mode = false; /* true = Small map, FLASE = Big map */
s16b mhp = 0; /* Max hit pts */
s16b chp = 0; /* Cur hit pts */
@@ -261,8 +261,8 @@ struct player_type
bool teleport = false; /* Random teleporting */
bool exp_drain = false; /* Experience draining */
- byte drain_mana = FALSE; /* mana draining */
- byte drain_life = FALSE; /* hp draining */
+ byte drain_mana = false; /* mana draining */
+ byte drain_life = false; /* hp draining */
bool magical_breath = false; /* Magical breathing -- can breath anywhere */
bool water_breath = false; /* Water breathing -- can breath underwater */
diff --git a/src/powers.cc b/src/powers.cc
index 1e33a487..a340d1c5 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -45,7 +45,7 @@
static bool power_chance(power_activation const &x_ref)
{
auto x_ptr = &x_ref;
- bool use_hp = FALSE;
+ bool use_hp = false;
int diff = x_ptr->diff;
/* Always true ? */
@@ -218,7 +218,7 @@ static void power_activate(int power)
{
if (!get_aim_dir(&dir))
break;
- if (passwall(dir, TRUE))
+ if (passwall(dir, true))
msg_print("A passage opens, and you step through.");
else
msg_print("There is no wall there!");
@@ -273,7 +273,7 @@ static void power_activate(int power)
case PWR_ROHAN:
/* Select power to use */
- while (TRUE)
+ while (true)
{
if (!get_com("Use [F]lash aura or [L]ight speed jump? ", &ch))
{
@@ -353,7 +353,7 @@ static void power_activate(int power)
case PWR_THUNDER:
/* Select power to use */
- while (TRUE)
+ while (true)
{
if (!get_com("Use [T]hunder strike, [R]ide the straight road, go [B]ack in town? ", &ch))
{
@@ -624,7 +624,7 @@ static void power_activate(int power)
if (d >= 100) return;
- if ((m_idx = place_monster_one(y, x, o_ptr->pval, 0, FALSE, MSTATUS_PET)) == 0) return;
+ if ((m_idx = place_monster_one(y, x, o_ptr->pval, 0, false, MSTATUS_PET)) == 0) return;
m_ptr = &m_list[m_idx];
m_ptr->hp = o_ptr->pval2;
@@ -674,7 +674,7 @@ static void power_activate(int power)
{
msg_print("You concentrate...");
if (get_aim_dir(&dir))
- fetch(dir, p_ptr->lev * 10, TRUE);
+ fetch(dir, p_ptr->lev * 10, true);
}
break;
@@ -826,7 +826,7 @@ static void power_activate(int power)
int i;
for (i = 0; i < 8; i++)
{
- summon_specific_friendly(p_ptr->py, p_ptr->px, p_ptr->lev, SUMMON_BIZARRE1, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, p_ptr->lev, SUMMON_BIZARRE1, false);
}
}
break;
diff --git a/src/q_betwen.cc b/src/q_betwen.cc
index 7c6573d0..d14c32d8 100644
--- a/src/q_betwen.cc
+++ b/src/q_betwen.cc
@@ -77,7 +77,7 @@ static bool quest_between_move_hook(void *, void *in_, void *)
}
/* Mark as entered */
- cquest.data[0] = TRUE;
+ cquest.data[0] = true;
p_ptr->wild_mode = false;
p_ptr->inside_quest = QUEST_BETWEEN;
@@ -120,7 +120,7 @@ static bool quest_between_gen_hook(void *, void *in_, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("between.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("between.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
/* Otherwise instadeath */
energy_use = 0;
@@ -150,18 +150,18 @@ static bool quest_between_finish_hook(void *, void *in_, void *)
/* Mega-Hack -- Actually create the Golden Horn of the Thunderlords */
- get_golden_horn()->allow_special = TRUE;
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
- get_golden_horn()->allow_special = FALSE;
+ get_golden_horn()->allow_special = true;
+ apply_magic(q_ptr, -1, true, true, true);
+ get_golden_horn()->allow_special = false;
q_ptr->discount = 100;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
/* Continue the plot */
*(quest[q_idx].plot) = QUEST_NULL;
del_hook_new(HOOK_QUEST_FINISH, quest_between_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -217,7 +217,7 @@ static bool quest_between_forbid_hook(void *, void *in_, void *)
hook_init_quest_in *in = static_cast<struct hook_init_quest_in *>(in_);
s32b q_idx = in->q_idx;
- if (q_idx != QUEST_BETWEEN) return (FALSE);
+ if (q_idx != QUEST_BETWEEN) return false;
if (p_ptr->lev < 45)
{
diff --git a/src/q_dragons.cc b/src/q_dragons.cc
index 9892bc79..6a4a19dd 100644
--- a/src/q_dragons.cc
+++ b/src/q_dragons.cc
@@ -30,7 +30,7 @@ static bool quest_dragons_gen_hook(void *, void *in_, void *)
int xstart = 2;
int ystart = 2;
- if (p_ptr->inside_quest != QUEST_DRAGONS) return FALSE;
+ if (p_ptr->inside_quest != QUEST_DRAGONS) return false;
/* Just in case we didnt talk the the mayor */
if (cquest.status == QUEST_STATUS_UNTAKEN)
@@ -54,7 +54,7 @@ static bool quest_dragons_gen_hook(void *, void *in_, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("dragons.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("dragons.map", &ystart, &xstart, cur_hgt, cur_wid, true, false);
in->dungeon_flags_ref |= DF_NO_GENO;
/* Place some columns */
@@ -105,16 +105,16 @@ static bool quest_dragons_gen_hook(void *, void *in_, void *)
}
}
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
- return TRUE;
+ return true;
}
static bool quest_dragons_death_hook(void *, void *, void *)
{
int i, mcnt = 0;
- if (p_ptr->inside_quest != QUEST_DRAGONS) return FALSE;
+ if (p_ptr->inside_quest != QUEST_DRAGONS) return false;
/* Process the monsters (backwards) */
for (i = m_max - 1; i >= 1; i--)
@@ -140,7 +140,7 @@ static bool quest_dragons_death_hook(void *, void *, void *)
quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_dragons_death_hook);
del_hook_new(HOOK_GEN_QUEST, quest_dragons_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
cmsg_print(TERM_YELLOW, "Gondolin is safer now.");
return false;
diff --git a/src/q_eol.cc b/src/q_eol.cc
index 8d3cda55..fd60ff37 100644
--- a/src/q_eol.cc
+++ b/src/q_eol.cc
@@ -92,9 +92,9 @@ static bool quest_eol_gen_hook(void *, void *, void *)
// Find Eol's r_info entry
int r_idx = get_eol();
// "Summon" Eol
- m_allow_special[r_idx] = TRUE;
- m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_ENEMY);
+ m_allow_special[r_idx] = false;
// Mark with the QUEST flag
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
}
@@ -127,16 +127,16 @@ static bool quest_eol_finish_hook(void *, void *in_, void *)
object_prep(q_ptr, lookup_kind(TV_LITE, SV_LITE_DWARVEN));
q_ptr->found = OBJ_FOUND_REWARD;
q_ptr->name2 = EGO_LITE_MAGI;
- apply_magic(q_ptr, 1, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, 1, false, false, false);
q_ptr->number = 1;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
/* Continue the plot */
*(quest[q_idx].plot) = QUEST_NIRNAETH;
quest[*(quest[q_idx].plot)].init();
del_hook_new(HOOK_QUEST_FINISH, quest_eol_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -157,7 +157,7 @@ static bool quest_eol_fail_hook(void *, void *in_, void *)
*(quest[q_idx].plot) = QUEST_NULL;
del_hook_new(HOOK_QUEST_FAIL, quest_eol_fail_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -179,7 +179,7 @@ static bool quest_eol_death_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_eol_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -220,7 +220,7 @@ static bool quest_eol_stair_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_FAILED;
del_hook_new(HOOK_STAIR, quest_eol_stair_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
}
diff --git a/src/q_evil.cc b/src/q_evil.cc
index 0e3c06eb..55f2dcfd 100644
--- a/src/q_evil.cc
+++ b/src/q_evil.cc
@@ -59,7 +59,7 @@ static bool quest_evil_gen_hook(void *, void *in_, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("evil.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("evil.map", &ystart, &xstart, cur_hgt, cur_wid, true, false);
in->dungeon_flags_ref |= DF_NO_GENO;
/* Place some random balrogs */
@@ -70,13 +70,13 @@ static bool quest_evil_gen_hook(void *, void *in_, void *)
auto const flags = f_info[cave[y][x].feat].flags;
if (!(flags & FF_PERMANENT) && (flags & FF_FLOOR))
{
- int m_idx = place_monster_one(y, x, 996, 0, FALSE, MSTATUS_ENEMY);
+ int m_idx = place_monster_one(y, x, 996, 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
--i;
}
}
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -111,7 +111,7 @@ static bool quest_evil_death_hook(void *, void *, void *)
del_hook_new(HOOK_MONSTER_DEATH, quest_evil_death_hook);
del_hook_new(HOOK_GEN_QUEST, quest_evil_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
cmsg_print(TERM_YELLOW, "Khazad-Dum is safer now.");
return false;
diff --git a/src/q_fireprof.cc b/src/q_fireprof.cc
index 7093b058..430e172e 100644
--- a/src/q_fireprof.cc
+++ b/src/q_fireprof.cc
@@ -90,7 +90,7 @@ static object_filter_t const &item_tester_hook_proofable()
/*
* This function makes sure the player has enough 'points' left to fireproof stuff.
*/
-static bool_ fireproof_enough_points(object_type *o_ptr, int *stack)
+static bool fireproof_enough_points(object_type *o_ptr, int *stack)
{
int item_value;
@@ -119,14 +119,14 @@ static bool_ fireproof_enough_points(object_type *o_ptr, int *stack)
item_value = FIREPROOF_SCROLL_POINTS * (*stack);
break;
default:
- assert(FALSE);
+ assert(false);
}
/* do we have enough points? */
if (item_value > get_item_points_remaining())
{
msg_print("I do not have enough fireproofing material for that.");
- return FALSE;
+ return false;
}
else
{
@@ -140,10 +140,10 @@ static bool_ fireproof_enough_points(object_type *o_ptr, int *stack)
cquest.status = QUEST_STATUS_REWARDED;
}
- return TRUE;
+ return true;
}
-static bool_ fireproof()
+static bool fireproof()
{
int item;
if (!get_item(&item,
@@ -152,7 +152,7 @@ static bool_ fireproof()
USE_INVEN,
item_tester_hook_proofable()))
{
- return FALSE;
+ return false;
}
/* get the object type from the number */
@@ -162,12 +162,12 @@ static bool_ fireproof()
int stack = 0;
if (!fireproof_enough_points(obj2, &stack))
{
- return FALSE;
+ return false;
}
/* Do the actual fireproofing */
{
- bool_ carry_it;
+ bool carry_it;
object_type *obj3;
object_type obj_forge;
s32b oldpval, oldpval2, oldpval3;
@@ -186,7 +186,7 @@ static bool_ fireproof()
obj3 = &obj_forge;
/* we'll need to add this to the inventory after fireproofing */
- carry_it = TRUE;
+ carry_it = true;
}
else
{
@@ -194,7 +194,7 @@ static bool_ fireproof()
obj3 = obj2;
/* we'll be dealing this while it's still in the inventory */
- carry_it = FALSE;
+ carry_it = false;
}
/* make it fireproof */
@@ -205,22 +205,22 @@ static bool_ fireproof()
oldpval = obj3->pval;
oldpval2 = obj3->pval2;
oldpval3 = obj3->pval3;
- apply_magic(obj3, -1, FALSE, FALSE, FALSE);
+ apply_magic(obj3, -1, false, false, false);
obj3->pval = oldpval;
obj3->pval2 = oldpval2;
obj3->pval3 = oldpval3;
/* put it in the inventory if it's only part of a stack */
- if (carry_it == TRUE)
+ if (carry_it == true)
{
- inven_carry(obj3, TRUE);
+ inven_carry(obj3, true);
}
/* id and notice it */
object_aware(obj3);
object_known(obj3);
- return TRUE;
+ return true;
}
}
@@ -291,7 +291,7 @@ void quest_fireproof_building(bool *paid, bool *recreate)
ret = fireproof();
/* don't loop the fireproof if there's nothing to fireproof */
- if (ret == FALSE)
+ if (ret == false)
{
break;
}
@@ -334,7 +334,7 @@ void quest_fireproof_building(bool *paid, bool *recreate)
int ret = fireproof();
/* don't loop the fireproof if there's nothing to fireproof */
- if (ret == FALSE)
+ if (ret == false)
{
break;
}
@@ -392,7 +392,7 @@ static bool fireproof_stair_hook(void *, void *, void *)
}
else
{
- bool_ ret;
+ bool ret;
if (cave[p_ptr->py][p_ptr->px].feat != FEAT_LESS)
{
@@ -406,7 +406,7 @@ static bool fireproof_stair_hook(void *, void *, void *)
ret = get_check("Really abandon the quest?");
/* if yes, then */
- if (ret == TRUE)
+ if (ret == true)
{
/* fail the quest */
cquest.status = QUEST_STATUS_FAILED;
diff --git a/src/q_god.cc b/src/q_god.cc
index 6766c06e..8c6b4cc0 100644
--- a/src/q_god.cc
+++ b/src/q_god.cc
@@ -140,7 +140,7 @@ static int MAX_NUM_GOD_QUESTS()
return 7;
}
/* Uh, oh. */
- assert(FALSE);
+ assert(false);
return 0;
}
@@ -170,7 +170,7 @@ static byte get_relic_num()
}
/* Uh, oh. */
- assert(FALSE);
+ assert(false);
}
static void get_home_coordinates(int *home1_y, int *home1_x, const char **home1,
@@ -225,7 +225,7 @@ static void get_home_coordinates(int *home1_y, int *home1_x, const char **home1,
}
else
{
- assert(FALSE); /* Uh, oh */
+ assert(false); /* Uh, oh */
}
}
@@ -406,7 +406,7 @@ static void quest_god_generate_relic()
if (inven_carry_okay(&relic))
{
- inven_carry(&relic, FALSE);
+ inven_carry(&relic, false);
}
else
{
@@ -421,7 +421,7 @@ static void quest_god_generate_relic()
}
/* Only generate once! */
- cquest_relic_generated = TRUE;
+ cquest_relic_generated = true;
/* Reset some variables */
cquest_relic_gen_tries = 0;
@@ -920,7 +920,7 @@ static bool quest_god_level_end_gen_hook(void *, void *, void *)
therefore the player has caused another level generation in
the temple and hence failed the quest.*/
- else if ((cquest_relic_generated == TRUE) &&
+ else if ((cquest_relic_generated == true) &&
(cquest.status != QUEST_STATUS_FAILED))
{
/* fail the quest, don't give another one, don't give
@@ -942,7 +942,7 @@ static bool quest_god_level_end_gen_hook(void *, void *, void *)
* unsuccessful. */
else if ((cquest_relic_gen_tries == 4) &&
- (cquest_relic_generated == FALSE))
+ (cquest_relic_generated == false))
{
quest_god_generate_relic();
}
@@ -979,7 +979,7 @@ static bool quest_god_player_level_hook(void *, void *in_, void *)
(cquest.status == QUEST_STATUS_TAKEN) ||
(cquest.status == QUEST_STATUS_FAILED) ||
(cquest_quests_given >= MAX_NUM_GOD_QUESTS()) ||
- (magik(CHANCE_OF_GOD_QUEST) == FALSE) ||
+ (magik(CHANCE_OF_GOD_QUEST) == false) ||
((dungeon_type == DUNGEON_GOD) &&
(dun_level > 0)) ||
(p_ptr->lev <= cquest_dun_minplev))
@@ -995,7 +995,7 @@ static bool quest_god_player_level_hook(void *, void *in_, void *)
{
/* This var will need resetting */
cquest.status = QUEST_STATUS_TAKEN;
- cquest_relic_generated = FALSE;
+ cquest_relic_generated = false;
cquest_quests_given = cquest_quests_given + 1;
/* actually place the dungeon in a random place */
@@ -1039,7 +1039,7 @@ static bool quest_god_get_hook(void *, void *in_, void *)
if ((cquest.status == QUEST_STATUS_TAKEN) &&
(o_ptr->tval == TV_JUNK) &&
(o_ptr->sval == get_relic_num()) &&
- (o_ptr->pval != TRUE) &&
+ (o_ptr->pval != true) &&
(cquest_relics_found < cquest_quests_given))
{
cmsg_format(TERM_L_BLUE, "%s speaks to you:", deity_info[p_ptr->pgod].name);
@@ -1068,7 +1068,7 @@ static bool quest_god_get_hook(void *, void *in_, void *)
inc_stack_size_ex(item, -1, OPTIMIZE, NO_DESCRIBE);
/* relic piece has been identified */
- o_ptr->pval = TRUE;
+ o_ptr->pval = true;
cquest_relics_found = cquest_relics_found + 1;
/* Make sure quests can be given again if neccesary */
@@ -1161,7 +1161,7 @@ static void set_god_dungeon_attributes()
}
else
{
- assert(FALSE); /* Uh, oh! */
+ assert(false); /* Uh, oh! */
}
/* W: All dungeons are 5 levels deep, and created at 2/3 of
@@ -1213,7 +1213,7 @@ static bool quest_god_birth_objects_hook(void *, void *, void *)
cquest_dun_maxdepth = 4;
cquest_dun_minplev = 0;
cquest_relic_gen_tries = 0;
- cquest_relic_generated = FALSE;
+ cquest_relic_generated = false;
return false;
}
diff --git a/src/q_haunted.cc b/src/q_haunted.cc
index 7a334730..6dc54457 100644
--- a/src/q_haunted.cc
+++ b/src/q_haunted.cc
@@ -57,7 +57,7 @@ static bool quest_haunted_gen_hook(void *, void *in_, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("haunted.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("haunted.map", &ystart, &xstart, cur_hgt, cur_wid, true, false);
in->dungeon_flags_ref |= DF_NO_GENO;
/* Place some ghosts */
@@ -68,7 +68,7 @@ static bool quest_haunted_gen_hook(void *, void *in_, void *)
auto const flags = f_info[cave[y][x].feat].flags;
if (!(flags & FF_PERMANENT) && (flags & FF_FLOOR))
{
- m_idx = place_monster_one(y, x, 477, 0, FALSE, MSTATUS_ENEMY);
+ m_idx = place_monster_one(y, x, 477, 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
--i;
}
@@ -85,13 +85,13 @@ static bool quest_haunted_gen_hook(void *, void *in_, void *)
int monsters[22] = { 65, 100, 124, 125, 133, 231, 273, 327, 365, 416, 418,
507, 508, 533, 534, 553, 554, 555, 577, 607, 622, 665};
int monster = monsters[rand_int(22)];
- m_idx = place_monster_one(y, x, monster, 0, FALSE, MSTATUS_ENEMY);
+ m_idx = place_monster_one(y, x, monster, 0, false, MSTATUS_ENEMY);
m_list[m_idx].mflag |= MFLAG_QUEST;
--i;
}
}
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -130,7 +130,7 @@ static bool quest_haunted_death_hook(void *, void *, void *)
del_hook_new(HOOK_MONSTER_DEATH, quest_haunted_death_hook);
del_hook_new(HOOK_GEN_QUEST, quest_haunted_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
cmsg_print(TERM_YELLOW, "Minas Anor is safer now.");
return false;
diff --git a/src/q_hobbit.cc b/src/q_hobbit.cc
index e3a92c44..39d76594 100644
--- a/src/q_hobbit.cc
+++ b/src/q_hobbit.cc
@@ -56,9 +56,9 @@ static bool quest_hobbit_town_gen_hook(void *, void *in_, void *)
/* Place Melinda */
int r_idx = get_melinda_proudfoot();
- m_allow_special[r_idx] = TRUE;
- place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ place_monster_one(y, x, r_idx, 0, false, MSTATUS_ENEMY);
+ m_allow_special[r_idx] = false;
return false;
}
@@ -88,9 +88,9 @@ static bool quest_hobbit_gen_hook(void *, void *, void *)
/* Place the hobbit */
int r_idx = get_merton_proudfoot();
- m_allow_special[r_idx] = TRUE;
- place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_FRIEND);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ place_monster_one(y, x, r_idx, 0, false, MSTATUS_FRIEND);
+ m_allow_special[r_idx] = false;
return false;
}
@@ -120,7 +120,7 @@ static bool quest_hobbit_give_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_GIVE, quest_hobbit_give_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -176,12 +176,12 @@ static bool quest_hobbit_chat_hook(void *, void *in_, void *)
object_prep(q_ptr, lookup_kind(TV_ROD, SV_ROD_RECALL));
q_ptr->number = 1;
q_ptr->found = OBJ_FOUND_REWARD;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
cquest.status = QUEST_STATUS_FINISHED;
del_hook_new(HOOK_MON_SPEAK, quest_hobbit_speak_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
delete_monster_idx(m_idx);
return true;
diff --git a/src/q_invas.cc b/src/q_invas.cc
index 326e54e2..e561e657 100644
--- a/src/q_invas.cc
+++ b/src/q_invas.cc
@@ -48,7 +48,7 @@ static bool quest_invasion_gen_hook(void *, void *, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("maeglin.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("maeglin.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
for (x = 3; x < xstart; x++)
{
@@ -90,7 +90,7 @@ static bool quest_invasion_ai_hook(void *, void *in_, void *out_)
cmsg_print(TERM_YELLOW, "Maeglin found the way to Gondolin! All hope is lost now!");
cquest.status = QUEST_STATUS_FAILED;
- town_info[2].destroyed = TRUE;
+ town_info[2].destroyed = true;
return false;
}
@@ -112,14 +112,14 @@ static bool quest_invasion_ai_hook(void *, void *in_, void *out_)
static bool quest_invasion_turn_hook(void *, void *, void *)
{
- if (cquest.status != QUEST_STATUS_UNTAKEN) return (FALSE);
- if (p_ptr->lev < 45) return (FALSE);
+ if (cquest.status != QUEST_STATUS_UNTAKEN) return false;
+ if (p_ptr->lev < 45) return false;
/* Wait until the end of the current quest */
- if (p_ptr->inside_quest) return ( FALSE);
+ if (p_ptr->inside_quest) return ( false);
/* Wait until the end of the astral mode */
- if (p_ptr->astral) return ( FALSE);
+ if (p_ptr->astral) return ( false);
/* Ok give the quest */
cmsg_print(TERM_YELLOW, "A Thunderlord appears in front of you and says:");
@@ -131,7 +131,7 @@ static bool quest_invasion_turn_hook(void *, void *, void *)
quest_invasion_init_hook();
del_hook_new(HOOK_END_TURN, quest_invasion_turn_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -169,7 +169,7 @@ static bool quest_invasion_death_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_invasion_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -181,9 +181,9 @@ static bool quest_invasion_stair_hook(void *, void *in_, void *)
{
struct hook_stair_in *in = static_cast<struct hook_stair_in *>(in_);
- if (p_ptr->inside_quest != QUEST_INVASION) return FALSE;
+ if (p_ptr->inside_quest != QUEST_INVASION) return false;
- if (cave[p_ptr->py][p_ptr->px].feat != FEAT_LESS) return TRUE;
+ if (cave[p_ptr->py][p_ptr->px].feat != FEAT_LESS) return true;
if (in->direction == STAIRS_UP)
{
@@ -206,13 +206,13 @@ static bool quest_invasion_stair_hook(void *, void *in_, void *)
/* Flush input */
flush();
- if (!get_check("Really abandon the quest?")) return TRUE;
+ if (!get_check("Really abandon the quest?")) return true;
cmsg_print(TERM_YELLOW, "You flee away from Maeglin and his army...");
cquest.status = QUEST_STATUS_FAILED;
- town_info[2].destroyed = TRUE;
+ town_info[2].destroyed = true;
}
del_hook_new(HOOK_STAIR, quest_invasion_stair_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
diff --git a/src/q_library.cc b/src/q_library.cc
index ca5b19c4..e72aa024 100644
--- a/src/q_library.cc
+++ b/src/q_library.cc
@@ -103,7 +103,7 @@ static s16b library_quest_place_random(int minY, int minX, int maxY, int maxX, i
{
int y = randint(maxY - minY + 1) + minY;
int x = randint(maxX - minX + 1) + minX;
- return place_monster_one(y, x, r_idx, 0, TRUE, MSTATUS_ENEMY);
+ return place_monster_one(y, x, r_idx, 0, true, MSTATUS_ENEMY);
}
static void library_quest_place_nrandom(int minY, int minX, int maxY, int maxX, int r_idx, int n)
@@ -140,17 +140,17 @@ static int library_quest_book_slots_left()
}
}
-static bool_ library_quest_book_contains_spell(int spell)
+static bool library_quest_book_contains_spell(int spell)
{
int i;
for (i = 1; i <= 3; i++)
{
if (library_quest_book_get_slot(i) == spell)
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
static void quest_library_finalize_book()
@@ -236,7 +236,7 @@ static void library_quest_print_spells(int first, int current)
static void library_quest_fill_book()
{
int width, height, margin, first, current;
- bool_ done;
+ bool done;
/* Always start with a cleared book */
library_quest_book_set_slot(1, -1);
@@ -251,9 +251,9 @@ static void library_quest_fill_book()
first = 0;
current = 0;
- done = FALSE;
+ done = false;
- while (done == FALSE)
+ while (done == false)
{
char ch;
int dir, spell_idx;
@@ -270,7 +270,7 @@ static void library_quest_fill_book()
flush();
done = get_check("Really create the book?");
} else {
- done = TRUE;
+ done = true;
}
} else if (ch == '\r') {
/* TODO: make tree of schools */
@@ -286,7 +286,7 @@ static void library_quest_fill_book()
} else if (dir == 8) {
current = current - 1;
} else if (dir == 6) {
- if (library_quest_book_contains_spell(spell_idx) == FALSE)
+ if (library_quest_book_contains_spell(spell_idx) == false)
{
library_quest_add_spell(spell_idx);
}
@@ -453,7 +453,7 @@ void quest_library_building(bool *paid, bool *recreate)
object_prep(q_ptr, lookup_kind(TV_BOOK, 61));
q_ptr->artifact_name = game->player_name;
q_ptr->found = OBJ_FOUND_REWARD;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
quest_library_finalize_book();
diff --git a/src/q_main.cc b/src/q_main.cc
index f6e6fdb4..b40f5471 100644
--- a/src/q_main.cc
+++ b/src/q_main.cc
@@ -98,7 +98,7 @@ static bool quest_morgoth_hook(void *, void *, void *)
/* Continue the plot(maybe) */
del_hook_new(HOOK_MONSTER_DEATH, quest_morgoth_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
/* Either ultra good if the one Ring is destroyed, or ultra evil if used */
if (quest[QUEST_ONE].status == QUEST_STATUS_FINISHED)
@@ -159,7 +159,7 @@ static bool quest_sauron_hook(void *, void *, void *)
*(quest[QUEST_SAURON].plot) = QUEST_MORGOTH;
quest_morgoth_init_hook();
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
}
return false;
@@ -216,7 +216,7 @@ static bool quest_necro_hook(void *, void *, void *)
quest[*(quest[QUEST_NECRO].plot)].init();
del_hook_new(HOOK_MONSTER_DEATH, quest_necro_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
}
return false;
diff --git a/src/q_narsil.cc b/src/q_narsil.cc
index f7e58d6c..298b4580 100644
--- a/src/q_narsil.cc
+++ b/src/q_narsil.cc
@@ -66,7 +66,7 @@ static bool quest_narsil_move_hook(void *, void *in_, void *)
object_prep(o_ptr, lookup_kind(TV_SWORD, SV_LONG_SWORD));
o_ptr->name1 = ART_ANDURIL;
- apply_magic(o_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(o_ptr, -1, true, true, true);
object_aware(o_ptr);
object_known(o_ptr);
inven_item_describe(i);
@@ -79,7 +79,7 @@ static bool quest_narsil_move_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_FINISHED;
del_hook_new(HOOK_MOVE, quest_narsil_move_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -116,7 +116,7 @@ static bool quest_narsil_identify_hook(void *, void *in_, void *)
add_hook_new(HOOK_MOVE, quest_narsil_move_hook, "narsil_move", NULL);
del_hook_new(HOOK_IDENTIFY, quest_narsil_identify_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
}
}
diff --git a/src/q_nazgul.cc b/src/q_nazgul.cc
index 1fe9d25f..6eda1db1 100644
--- a/src/q_nazgul.cc
+++ b/src/q_nazgul.cc
@@ -51,9 +51,9 @@ static bool quest_nazgul_gen_hook(void *, void *in_, void *)
/* Place the nazgul */
int r_idx = get_uvatha();
- m_allow_special[r_idx] = TRUE;
- m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_ENEMY);
+ m_allow_special[r_idx] = false;
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
@@ -79,13 +79,13 @@ static bool quest_nazgul_finish_hook(void *, void *in_, void *)
object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_ATHELAS));
q_ptr->found = OBJ_FOUND_REWARD;
q_ptr->number = 6;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
/* End the plot */
*(quest[q_idx].plot) = QUEST_NULL;
del_hook_new(HOOK_QUEST_FINISH, quest_nazgul_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -140,7 +140,7 @@ static bool quest_nazgul_death_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_nazgul_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
diff --git a/src/q_nirna.cc b/src/q_nirna.cc
index 2a08fbf7..a036bfa3 100644
--- a/src/q_nirna.cc
+++ b/src/q_nirna.cc
@@ -42,7 +42,7 @@ static bool quest_nirnaeth_gen_hook(void *, void *, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("nirnaeth.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("nirnaeth.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
/* Count the number of monsters */
cquest.data[0] = 0;
@@ -93,14 +93,14 @@ static bool quest_nirnaeth_finish_hook(void *, void *in_, void *)
*(quest[q_idx].plot) = QUEST_NULL;
del_hook_new(HOOK_QUEST_FINISH, quest_nirnaeth_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
static bool quest_nirnaeth_death_hook(void *, void *, void *)
{
- if (p_ptr->inside_quest != QUEST_NIRNAETH) return FALSE;
+ if (p_ptr->inside_quest != QUEST_NIRNAETH) return false;
cquest.data[1]++;
@@ -123,7 +123,7 @@ static bool quest_nirnaeth_stair_hook(void *, void *, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_STAIR, quest_nirnaeth_stair_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
diff --git a/src/q_one.cc b/src/q_one.cc
index 81be1fa5..6c48c442 100644
--- a/src/q_one.cc
+++ b/src/q_one.cc
@@ -186,11 +186,11 @@ static bool quest_one_wield_hook(void *, void *in_, void *)
* Towns aren't, right ?
* So let's destroy them !
*/
- town_info[1].destroyed = TRUE;
- town_info[2].destroyed = TRUE;
- town_info[3].destroyed = TRUE;
- town_info[4].destroyed = TRUE;
- town_info[5].destroyed = TRUE;
+ town_info[1].destroyed = true;
+ town_info[2].destroyed = true;
+ town_info[3].destroyed = true;
+ town_info[4].destroyed = true;
+ town_info[5].destroyed = true;
/* Continue the plot */
cquest.status = QUEST_STATUS_FAILED_DONE;
@@ -322,7 +322,7 @@ static bool quest_one_death_hook(void *, void *in_, void *)
q_ptr->name1 = ART_POWER;
/* Mega-Hack -- Actually create "the one ring" */
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
/* Find a space */
for (i = 0; i < INVEN_PACK; i++)
@@ -338,17 +338,17 @@ static bool quest_one_death_hook(void *, void *in_, void *)
{
char o_name[200];
- object_desc(o_name, &p_ptr->inventory[INVEN_PACK - 1], FALSE, 0);
+ object_desc(o_name, &p_ptr->inventory[INVEN_PACK - 1], false, 0);
/* Drop the item */
- inven_drop(INVEN_PACK - 1, 99, p_ptr->py, p_ptr->px, FALSE);
+ inven_drop(INVEN_PACK - 1, 99, p_ptr->py, p_ptr->px, false);
cmsg_format(TERM_VIOLET, "You feel the urge to drop your %s to make room in your inventory.", o_name);
}
/* Carry it */
cmsg_format(TERM_VIOLET, "You feel the urge to pick up that plain gold ring you see.");
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
return false;
@@ -400,7 +400,7 @@ static bool quest_one_gen_hook(void *, void *, void *)
if (tries)
{
- int m_idx = place_monster_one(y, x, test_monster_name("Sauron, the Sorcerer"), 0, FALSE, MSTATUS_ENEMY);
+ int m_idx = place_monster_one(y, x, test_monster_name("Sauron, the Sorcerer"), 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
}
diff --git a/src/q_poison.cc b/src/q_poison.cc
index fda4b6c9..b190ccaa 100644
--- a/src/q_poison.cc
+++ b/src/q_poison.cc
@@ -125,7 +125,7 @@ static bool quest_poison_gen_hook(void *, void *, void *)
int m_idx;
r_idx = get_mon_num(30);
- m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY);
+ m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
/* Sometimes make it up some levels */
@@ -171,15 +171,15 @@ static bool quest_poison_finish_hook(void *, void *in_, void *)
q_ptr->found = OBJ_FOUND_REWARD;
q_ptr->number = 1;
q_ptr->name2 = EGO_ELVENKIND;
- apply_magic(q_ptr, 1, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, 1, false, false, false);
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
/* Continue the plot */
*(quest[q_idx].plot) = QUEST_NULL;
del_hook_new(HOOK_QUEST_FINISH, quest_poison_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -212,10 +212,10 @@ static bool quest_poison_quest_hook(void *, void *in_, void *)
q_ptr->number = 99;
q_ptr->inscription = "quest";
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
del_hook_new(HOOK_INIT_QUEST, quest_poison_quest_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -293,7 +293,7 @@ static bool quest_poison_drop_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_DROP, quest_poison_drop_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -312,7 +312,7 @@ void quest_poison_init_hook()
/* Get a place to place the poison */
if (!cquest.data[1])
{
- cquest.data[1] = TRUE;
+ cquest.data[1] = true;
cquest.data[0] = rand_int(4);
if (wizard)
{
diff --git a/src/q_rand.cc b/src/q_rand.cc
index f401608f..68367d3f 100644
--- a/src/q_rand.cc
+++ b/src/q_rand.cc
@@ -106,7 +106,7 @@ void initialize_random_quests(int n)
/* XXX XXX XXX Try until valid choice is found */
while (tries)
{
- bool_ ok;
+ bool ok;
tries--;
@@ -147,12 +147,12 @@ void initialize_random_quests(int n)
}
/* Assume no explosion attacks */
- ok = TRUE;
+ ok = true;
/* Reject monsters with exploding attacks */
for (k = 0; k < 4; k++)
{
- if (r_ptr->blow[k].method == RBM_EXPLODE) ok = FALSE;
+ if (r_ptr->blow[k].method == RBM_EXPLODE) ok = false;
}
if (!ok) continue;
@@ -200,16 +200,16 @@ void initialize_random_quests(int n)
dungeon_type = old_type;
}
-bool_ is_randhero(int level)
+bool is_randhero(int level)
{
int i;
- bool_ result = FALSE;
+ bool result = false;
for (i = 0; randquest_hero[i] != -1; i++)
{
if (random_quests[level].type == randquest_hero[i])
{
- result = TRUE;
+ result = true;
break;
}
}
@@ -235,7 +235,7 @@ static void do_get_new_obj(int y, int x)
object_wipe(q_ptr[i]);
/* Make a great object */
- make_object(q_ptr[i], TRUE, TRUE, obj_theme::no_theme());
+ make_object(q_ptr[i], true, true, obj_theme::no_theme());
q_ptr[i]->found = OBJ_FOUND_REWARD;
char buf[100];
@@ -244,7 +244,7 @@ static void do_get_new_obj(int y, int x)
}
- while (TRUE)
+ while (true)
{
res = ask_menu("Choose a reward to get(a-c to choose, ESC to cancel)?", items);
@@ -270,11 +270,11 @@ static void do_get_new_obj(int y, int x)
/* Mega-Hack -- Preserve the artifact */
if (o_ptr->tval == TV_RANDART)
{
- game->random_artifacts[o_ptr->sval].generated = FALSE;
+ game->random_artifacts[o_ptr->sval].generated = false;
}
else if (o_ptr->k_ptr->flags & TR_NORM_ART)
{
- o_ptr->k_ptr->artifact = FALSE;
+ o_ptr->k_ptr->artifact = false;
}
else if (o_ptr->name1)
{
@@ -382,15 +382,15 @@ static void hero_death(s32b m_idx, s32b r_idx)
{
int r_idx = get_adventurer();
- m_allow_special[r_idx] = TRUE;
- int m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_COMPANION);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ int m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_COMPANION);
+ m_allow_special[r_idx] = false;
if (m_idx)
{
m_list[m_idx].exp = monster_exp(1 + (dun_level * 3 / 2));
m_list[m_idx].status = MSTATUS_COMPANION;
- monster_check_experience(m_idx, TRUE);
+ monster_check_experience(m_idx, true);
}
}
else
@@ -489,12 +489,12 @@ static bool quest_random_gen_hero_hook(void *, void *, void *)
int i = random_quests[dun_level].type;
- m_allow_special[random_quests[dun_level].r_idx] = TRUE;
+ m_allow_special[random_quests[dun_level].r_idx] = true;
while (i)
{
int m_idx, y = rand_range(1, cur_hgt - 2), x = rand_range(1, cur_wid - 2);
- m_idx = place_monster_one(y, x, random_quests[dun_level].r_idx, 0, FALSE, MSTATUS_ENEMY);
+ m_idx = place_monster_one(y, x, random_quests[dun_level].r_idx, 0, false, MSTATUS_ENEMY);
if (m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
@@ -502,7 +502,7 @@ static bool quest_random_gen_hero_hook(void *, void *, void *)
i--;
}
}
- m_allow_special[random_quests[dun_level].r_idx] = FALSE;
+ m_allow_special[random_quests[dun_level].r_idx] = false;
return false;
}
@@ -535,7 +535,7 @@ static bool quest_random_gen_hook(void *, void *in_, void *)
get_map_size(fmt::format("qrand{}.map", random_quests[dun_level].type).c_str(), &ysize, &xsize);
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(xsize + 2, ysize + 2, FALSE, by0, bx0, &xval, &yval))
+ if (!room_alloc(xsize + 2, ysize + 2, false, by0, bx0, &xval, &yval))
{
return false;
}
@@ -567,7 +567,7 @@ static bool quest_random_gen_hook(void *, void *in_, void *)
xstart = x1;
ystart = y1;
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file(fmt::format("qrand{}.map", random_quests[dun_level].type).c_str(), &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file(fmt::format("qrand{}.map", random_quests[dun_level].type).c_str(), &ystart, &xstart, cur_hgt, cur_wid, true, true);
for (x = x1; x < xstart; x++)
{
@@ -576,9 +576,9 @@ static bool quest_random_gen_hook(void *, void *in_, void *)
cave[y][x].info |= CAVE_ICKY | CAVE_ROOM;
if (cave[y][x].feat == FEAT_MARKER)
{
- m_allow_special[random_quests[dun_level].r_idx] = TRUE;
- int i = place_monster_one(y, x, random_quests[dun_level].r_idx, 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[random_quests[dun_level].r_idx] = FALSE;
+ m_allow_special[random_quests[dun_level].r_idx] = true;
+ int i = place_monster_one(y, x, random_quests[dun_level].r_idx, 0, false, MSTATUS_ENEMY);
+ m_allow_special[random_quests[dun_level].r_idx] = false;
if (i)
{
auto m_ptr = &m_list[i];
diff --git a/src/q_rand.hpp b/src/q_rand.hpp
index 6dcc6aef..0ca7b035 100644
--- a/src/q_rand.hpp
+++ b/src/q_rand.hpp
@@ -5,6 +5,6 @@
#include <string>
void initialize_random_quests(int n);
-bool_ is_randhero(int level);
+bool is_randhero(int level);
void quest_random_init_hook();
std::string quest_random_describe();
diff --git a/src/q_shroom.cc b/src/q_shroom.cc
index 8c14cecd..10347512 100644
--- a/src/q_shroom.cc
+++ b/src/q_shroom.cc
@@ -65,24 +65,24 @@ static bool quest_shroom_town_gen_hook(void *, void *in_, void *)
/* Throw in some dogs ;) */
y = rand_range((cur_hgt / 2) - 5, (cur_hgt / 2) + 5);
x = rand_range((cur_wid / 2) - 7, (cur_wid / 2) + 7);
- m_allow_special[get_grip()] = TRUE;
- m_idx = place_monster_one(y, x, get_grip(), 0, FALSE, MSTATUS_ENEMY);
+ m_allow_special[get_grip()] = true;
+ m_idx = place_monster_one(y, x, get_grip(), 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
- m_allow_special[get_grip()] = FALSE;
+ m_allow_special[get_grip()] = false;
y = rand_range((cur_hgt / 2) - 5, (cur_hgt / 2) + 5);
x = rand_range((cur_wid / 2) - 7, (cur_wid / 2) + 7);
- m_allow_special[get_wolf()] = TRUE;
- m_idx = place_monster_one(y, x, get_wolf(), 0, FALSE, MSTATUS_ENEMY);
+ m_allow_special[get_wolf()] = true;
+ m_idx = place_monster_one(y, x, get_wolf(), 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
- m_allow_special[get_wolf()] = FALSE;
+ m_allow_special[get_wolf()] = false;
y = rand_range((cur_hgt / 2) - 5, (cur_hgt / 2) + 5);
x = rand_range((cur_wid / 2) - 7, (cur_wid / 2) + 7);
- m_allow_special[get_fang()] = TRUE;
- m_idx = place_monster_one(y, x, get_fang(), 0, FALSE, MSTATUS_ENEMY);
+ m_allow_special[get_fang()] = true;
+ m_idx = place_monster_one(y, x, get_fang(), 0, false, MSTATUS_ENEMY);
if (m_idx) m_list[m_idx].mflag |= MFLAG_QUEST;
- m_allow_special[get_fang()] = FALSE;
+ m_allow_special[get_fang()] = false;
msg_print("You hear frenzied barking.");
}
@@ -113,9 +113,9 @@ static bool quest_shroom_town_gen_hook(void *, void *in_, void *)
}
/* Place Farmer Maggot */
- m_allow_special[get_farmer_maggot()] = TRUE;
- place_monster_one(y, x, get_farmer_maggot(), 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[get_farmer_maggot()] = FALSE;
+ m_allow_special[get_farmer_maggot()] = true;
+ place_monster_one(y, x, get_farmer_maggot(), 0, false, MSTATUS_ENEMY);
+ m_allow_special[get_farmer_maggot()] = false;
return false;
}
@@ -173,7 +173,7 @@ static bool quest_shroom_give_hook(void *, void *in_, void *)
del_hook_new(HOOK_GIVE, quest_shroom_give_hook);
del_hook_new(HOOK_CHAT, quest_shroom_speak_hook);
del_hook_new(HOOK_WILD_GEN, quest_shroom_town_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -205,7 +205,7 @@ static bool quest_shroom_give_hook(void *, void *in_, void *)
if (inven_carry_okay(q_ptr))
{
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
else
{
@@ -218,16 +218,16 @@ static bool quest_shroom_give_hook(void *, void *in_, void *)
q_ptr->found = OBJ_FOUND_REWARD;
q_ptr->number = 1;
q_ptr->name1 = 149;
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
q_ptr->discount = 100;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
delete_monster_idx(m_idx);
cquest.status = QUEST_STATUS_FINISHED;
del_hook_new(HOOK_GIVE, quest_shroom_give_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
}
else
{
@@ -254,7 +254,7 @@ static void check_dogs_alive(s32b m_idx)
del_hook_new(HOOK_MON_SPEAK, quest_shroom_speak_hook);
del_hook_new(HOOK_CHAT, quest_shroom_chat_hook);
del_hook_new(HOOK_WILD_GEN, quest_shroom_town_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
}
else
{
diff --git a/src/q_spider.cc b/src/q_spider.cc
index 123fead8..8fc6e874 100644
--- a/src/q_spider.cc
+++ b/src/q_spider.cc
@@ -45,7 +45,7 @@ static bool quest_spider_gen_hook(void *, void *, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("spiders.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("spiders.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
return true;
}
@@ -90,7 +90,7 @@ static bool quest_spider_death_hook(void *, void *, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_spider_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -116,14 +116,14 @@ static bool quest_spider_finish_hook(void *, void *in_, void *)
object_prep(q_ptr, lookup_kind(TV_POTION, SV_POTION_AUGMENTATION));
q_ptr->number = 1;
q_ptr->found = OBJ_FOUND_REWARD;
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
/* Continue the plot */
*(quest[q_idx].plot) = QUEST_POISON;
quest[*(quest[q_idx].plot)].init();
del_hook_new(HOOK_QUEST_FINISH, quest_spider_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
diff --git a/src/q_thief.cc b/src/q_thief.cc
index 5c6c9690..cf32098e 100644
--- a/src/q_thief.cc
+++ b/src/q_thief.cc
@@ -31,7 +31,7 @@ static bool quest_thieves_gen_hook(void *, void *in_, void *)
int x, y;
int xstart = 2;
int ystart = 2;
- bool_ again = TRUE;
+ bool again = true;
if (p_ptr->inside_quest != QUEST_THIEVES)
{
@@ -62,14 +62,14 @@ static bool quest_thieves_gen_hook(void *, void *in_, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("thieves.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("thieves.map", &ystart, &xstart, cur_hgt, cur_wid, true, false);
in->dungeon_flags_ref |= DF_NO_GENO;
/* Rip the inventory from the player */
cmsg_print(TERM_YELLOW, "You feel a vicious blow on your head.");
while (again)
{
- again = FALSE;
+ again = false;
for (x = 0; x < INVEN_TOTAL; x++)
{
object_type *o_ptr = &p_ptr->inventory[x];
@@ -84,18 +84,18 @@ static bool quest_thieves_gen_hook(void *, void *in_, void *)
continue;
}
- inven_drop(x, 99, 4, 24, TRUE);
+ inven_drop(x, 99, 4, 24, true);
/* Thats ugly .. but it works */
- again = TRUE;
+ again = true;
break;
}
}
del_hook_new(HOOK_GEN_QUEST, quest_thieves_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
- return TRUE;
+ return true;
}
static bool quest_thieves_hook(void *, void *, void *)
@@ -147,7 +147,7 @@ static bool quest_thieves_hook(void *, void *, void *)
quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_END_TURN, quest_thieves_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
cmsg_print(TERM_YELLOW, "You stopped the thieves and saved Bree!");
return false;
@@ -191,7 +191,7 @@ static bool quest_thieves_finish_hook(void *, void *in_, void *)
quest[*(quest[q_idx].plot)].init();
del_hook_new(HOOK_QUEST_FINISH, quest_thieves_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -207,7 +207,7 @@ static bool quest_thieves_feeling_hook(void *, void *, void *)
msg_print("All your possessions have been stolen!");
del_hook_new(HOOK_FEELING, quest_thieves_feeling_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
diff --git a/src/q_thrain.cc b/src/q_thrain.cc
index 2f681490..344d9ffd 100644
--- a/src/q_thrain.cc
+++ b/src/q_thrain.cc
@@ -136,7 +136,7 @@ static bool quest_thrain_death_hook(void *, void *in_, void *)
del_hook_new(HOOK_MONSTER_DEATH, quest_thrain_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -161,7 +161,7 @@ static bool quest_thrain_gen_hook(void *, void *in_, void *)
get_map_size("thrain.map", &ysize, &xsize);
/* Try to allocate space for room. If fails, exit */
- if (!room_alloc(xsize + 2, ysize + 2, FALSE, by0, bx0, &xval, &yval)) return false;
+ if (!room_alloc(xsize + 2, ysize + 2, false, by0, bx0, &xval, &yval)) return false;
/* Get corner values */
y1 = yval - ysize / 2;
@@ -190,7 +190,7 @@ static bool quest_thrain_gen_hook(void *, void *in_, void *)
xstart = x1;
ystart = y1;
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("thrain.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("thrain.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
for (x = x1; x < xstart; x++)
for (y = y1; y < ystart; y++)
@@ -198,9 +198,9 @@ static bool quest_thrain_gen_hook(void *, void *in_, void *)
cave[y][x].info |= CAVE_ICKY | CAVE_ROOM | CAVE_FREE;
if (cave[y][x].feat == FEAT_MARKER)
{
- m_allow_special[get_thrain()] = TRUE;
- int i = place_monster_one(y, x, get_thrain(), 0, FALSE, MSTATUS_NEUTRAL);
- m_allow_special[get_thrain()] = FALSE;
+ m_allow_special[get_thrain()] = true;
+ int i = place_monster_one(y, x, get_thrain(), 0, false, MSTATUS_NEUTRAL);
+ m_allow_special[get_thrain()] = false;
if (i) m_list[i].mflag |= MFLAG_QUEST;
}
diff --git a/src/q_troll.cc b/src/q_troll.cc
index d0f0712a..88e4b0ed 100644
--- a/src/q_troll.cc
+++ b/src/q_troll.cc
@@ -57,16 +57,16 @@ static bool quest_troll_gen_hook(void *, void *, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("trolls.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("trolls.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
for (x = 3; x < xstart; x++)
for (y = 3; y < ystart; y++)
{
if (cave[y][x].feat == FEAT_MARKER)
{
- m_allow_special[get_tom()] = TRUE;
- int m_idx = place_monster_one(y, x, get_tom(), 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[get_tom()] = FALSE;
+ m_allow_special[get_tom()] = true;
+ int m_idx = place_monster_one(y, x, get_tom(), 0, false, MSTATUS_ENEMY);
+ m_allow_special[get_tom()] = false;
if (m_idx)
{
@@ -77,7 +77,7 @@ static bool quest_troll_gen_hook(void *, void *, void *)
m_list[m_idx].mflag |= MFLAG_QUEST;
- a_allow_special[ART_GLAMDRING] = TRUE;
+ a_allow_special[ART_GLAMDRING] = true;
/* Mega-Hack -- Prepare to make "Glamdring" */
object_prep(q_ptr, lookup_kind(TV_SWORD, SV_BROAD_SWORD));
@@ -86,9 +86,9 @@ static bool quest_troll_gen_hook(void *, void *, void *)
q_ptr->name1 = ART_GLAMDRING;
/* Mega-Hack -- Actually create "Glamdring" */
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
- a_allow_special[ART_GLAMDRING] = FALSE;
+ a_allow_special[ART_GLAMDRING] = false;
/* Get new object */
o_idx = o_pop();
@@ -116,7 +116,7 @@ static bool quest_troll_gen_hook(void *, void *, void *)
}
/* Reinitialize the ambush ... hehehe */
- cquest.data[0] = FALSE;
+ cquest.data[0] = false;
return true;
}
@@ -138,7 +138,7 @@ static bool quest_troll_finish_hook(void *, void *in_, void *)
quest[*(quest[q_idx].plot)].init();
del_hook_new(HOOK_QUEST_FINISH, quest_troll_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -163,19 +163,19 @@ static bool quest_troll_death_hook(void *, void *in_, void *)
cmsg_print(TERM_YELLOW, "Without Tom, the trolls won't be able to do much.");
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_troll_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
init_flags = INIT_GET_SIZE;
- process_dungeon_file("trolls.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("trolls.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
if (cquest.data[0])
{
return false;
}
- cquest.data[0] = TRUE;
+ cquest.data[0] = true;
msg_print("Oops, seems like an ambush...");
@@ -192,7 +192,7 @@ static bool quest_troll_death_hook(void *, void *in_, void *)
c_ptr->info &= ~CAVE_SPEC;
int r_idx = (rand_int(2) == 0) ? get_forest_troll() : get_stone_troll();
- place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY);
+ place_monster_one(y, x, r_idx, 0, false, MSTATUS_ENEMY);
}
}
}
diff --git a/src/q_ultrag.cc b/src/q_ultrag.cc
index 0c8eca2d..c4752f89 100644
--- a/src/q_ultrag.cc
+++ b/src/q_ultrag.cc
@@ -163,7 +163,7 @@ static bool quest_ultra_good_stair_hook(void *, void *in_, void *)
cmsg_print(TERM_YELLOW, "It seems the level is protected by an impassable barrier of pure magic.");
cmsg_print(TERM_YELLOW, "Only the most powerful magic could remove it. You will need to use");
cmsg_print(TERM_YELLOW, "the Flame Imperishable to pass. The source of Eru Iluvatar's own power.");
- return TRUE;
+ return true;
}
else
{
@@ -219,7 +219,7 @@ static bool quest_ultra_good_death_hook(void *, void *in_, void *)
/* Remove now used hook */
del_hook_new(HOOK_MONSTER_DEATH, quest_ultra_good_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
/* End plot */
*(quest[QUEST_ULTRA_GOOD].plot) = QUEST_NULL;
@@ -237,9 +237,9 @@ static bool quest_ultra_good_death_hook(void *, void *in_, void *)
object_prep(q_ptr, lookup_kind(TV_JUNK, 255));
/* Mega-Hack -- Actually create the Flame Imperishable */
- get_flame_imperishable()->allow_special = TRUE;
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
- get_flame_imperishable()->allow_special = FALSE;
+ get_flame_imperishable()->allow_special = true;
+ apply_magic(q_ptr, -1, true, true, true);
+ get_flame_imperishable()->allow_special = false;
/* Identify it fully */
object_aware(q_ptr);
@@ -259,17 +259,17 @@ static bool quest_ultra_good_death_hook(void *, void *in_, void *)
{
char o_name[200];
- object_desc(o_name, &p_ptr->inventory[INVEN_PACK - 1], FALSE, 0);
+ object_desc(o_name, &p_ptr->inventory[INVEN_PACK - 1], false, 0);
/* Drop the item */
- inven_drop(INVEN_PACK - 1, 99, p_ptr->py, p_ptr->px, FALSE);
+ inven_drop(INVEN_PACK - 1, 99, p_ptr->py, p_ptr->px, false);
cmsg_format(TERM_VIOLET, "You feel the urge to drop your %s to make room in your inventory.", o_name);
}
/* Carry it */
cmsg_format(TERM_VIOLET, "You feel the urge to pick up the Flame Imperishable.");
- inven_carry(q_ptr, FALSE);
+ inven_carry(q_ptr, false);
}
return false;
diff --git a/src/q_wight.cc b/src/q_wight.cc
index 8eef20c3..4c4c549e 100644
--- a/src/q_wight.cc
+++ b/src/q_wight.cc
@@ -51,7 +51,7 @@ static bool quest_wight_gen_hook(void *, void *, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("wights.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE);
+ process_dungeon_file("wights.map", &ystart, &xstart, cur_hgt, cur_wid, true, true);
for (x = 3; x < xstart; x++)
{
@@ -61,9 +61,9 @@ static bool quest_wight_gen_hook(void *, void *, void *)
{
int m_idx = 0;
- m_allow_special[get_wight_king()] = TRUE;
- m_idx = place_monster_one(y, x, get_wight_king(), 0, FALSE, MSTATUS_ENEMY);
- m_allow_special[get_wight_king()] = FALSE;
+ m_allow_special[get_wight_king()] = true;
+ m_idx = place_monster_one(y, x, get_wight_king(), 0, false, MSTATUS_ENEMY);
+ m_allow_special[get_wight_king()] = false;
if (m_idx)
{
@@ -152,7 +152,7 @@ static bool quest_wight_death_hook(void *, void *in_, void *)
cquest.status = QUEST_STATUS_COMPLETED;
del_hook_new(HOOK_MONSTER_DEATH, quest_wight_death_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return false;
}
@@ -178,7 +178,7 @@ static bool quest_wight_finish_hook(void *, void *in_, void *)
quest[*(quest[q_idx].plot)].init();
del_hook_new(HOOK_QUEST_FINISH, quest_wight_finish_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
diff --git a/src/q_wolves.cc b/src/q_wolves.cc
index 03b98b1b..9ab7aa7a 100644
--- a/src/q_wolves.cc
+++ b/src/q_wolves.cc
@@ -60,7 +60,7 @@ static bool quest_wolves_gen_hook(void *, void *in_, void *)
get_mon_num_prep();
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("wolves.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("wolves.map", &ystart, &xstart, cur_hgt, cur_wid, true, false);
in->dungeon_flags_ref |= DF_NO_GENO;
/* Place some random wolves */
@@ -91,7 +91,7 @@ static bool quest_wolves_gen_hook(void *, void *in_, void *)
}
}
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
return true;
}
@@ -124,7 +124,7 @@ static bool quest_wolves_death_hook(void *, void *, void *)
del_hook_new(HOOK_MONSTER_DEATH, quest_wolves_death_hook);
del_hook_new(HOOK_GEN_QUEST, quest_wolves_gen_hook);
- process_hooks_restart = TRUE;
+ process_hooks_restart = true;
cmsg_print(TERM_YELLOW, "Lothlorien is safer now.");
return false;
diff --git a/src/quest_type.hpp b/src/quest_type.hpp
index ea12003c..b480cef7 100644
--- a/src/quest_type.hpp
+++ b/src/quest_type.hpp
@@ -9,7 +9,7 @@
*/
struct quest_type
{
- bool_ silent;
+ bool silent;
char name[40]; /* Quest name */
diff --git a/src/randart.cc b/src/randart.cc
index 6018b3d1..94d644f6 100644
--- a/src/randart.cc
+++ b/src/randart.cc
@@ -28,13 +28,13 @@
/*
* Attempt to add a power to a randart
*/
-static bool_ grab_one_power(int *ra_idx, object_type const *o_ptr, std::vector<s16b> &max_times)
+static bool grab_one_power(int *ra_idx, object_type const *o_ptr, std::vector<s16b> &max_times)
{
auto const &ra_info = game->edit_data.ra_info;
assert(max_times.size() >= ra_info.size());
- bool_ ret = FALSE;
+ bool ret = false;
std::vector<size_t> ok_ra;
@@ -42,7 +42,7 @@ static bool_ grab_one_power(int *ra_idx, object_type const *o_ptr, std::vector<s
for (size_t i = 0; i < ra_info.size(); i++)
{
auto ra_ptr = &ra_info[i];
- bool_ ok = FALSE;
+ bool ok = false;
/* Must have the correct fields */
for (auto const &filter: ra_ptr->kind_filter)
@@ -51,14 +51,14 @@ static bool_ grab_one_power(int *ra_idx, object_type const *o_ptr, std::vector<s
(filter.min_sval <= o_ptr->sval) &&
(o_ptr->sval <= filter.max_sval))
{
- ok = TRUE;
+ ok = true;
break;
}
}
if ((0 < ra_ptr->max_pval) && (ra_ptr->max_pval < o_ptr->pval))
{
- ok = FALSE;
+ ok = false;
}
if (!ok)
@@ -111,7 +111,7 @@ static bool_ grab_one_power(int *ra_idx, object_type const *o_ptr, std::vector<s
max_times[i]++;
/* Success */
- ret = TRUE;
+ ret = true;
break;
}
@@ -250,9 +250,9 @@ bool create_artifact(object_type *o_ptr, bool a_scroll, bool get_name)
char new_name[80];
int powers = 0;
s32b total_flags, total_power = 0;
- bool a_cursed = FALSE;
+ bool a_cursed = false;
s16b pval = 0;
- bool_ limit_blows = FALSE;
+ bool limit_blows = false;
strcpy(new_name, "");
@@ -343,7 +343,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll, bool get_name)
object_known(o_ptr);
strcpy(dummy_name, "");
- object_out_desc(o_ptr, NULL, FALSE, TRUE);
+ object_out_desc(o_ptr, NULL, false, true);
if (get_string("What do you want to call the artifact? ", dummy_name, 80))
{
@@ -382,7 +382,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll, bool get_name)
o_ptr->pval2 = -1;
}
- return TRUE;
+ return true;
}
@@ -404,7 +404,7 @@ bool artifact_scroll()
/* Description */
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/* Describe */
msg_format("%s %s radiate%s a blinding light!",
diff --git a/src/set_component.hpp b/src/set_component.hpp
index 48f4fda2..fed44451 100644
--- a/src/set_component.hpp
+++ b/src/set_component.hpp
@@ -9,7 +9,7 @@
constexpr std::size_t SET_MAX_SIZE = 6;
struct set_component {
- bool_ present = FALSE; /* Is it being worn? */
+ bool present = false; /* Is it being worn? */
s16b a_idx = 0; /* What artifact? */
std::array<s16b , SET_MAX_SIZE> pval; /* Pval for each combination */
std::array<object_flag_set, SET_MAX_SIZE> flags; /* Flags */
diff --git a/src/skills.cc b/src/skills.cc
index 21ec162c..ae53d6e6 100644
--- a/src/skills.cc
+++ b/src/skills.cc
@@ -211,13 +211,13 @@ static std::size_t get_idx(int i)
return 0;
}
-static bool_ is_known(int s_idx)
+static bool is_known(int s_idx)
{
auto const &s_descriptors = game->edit_data.s_descriptors;
auto const &s_info = game->s_info;
- if (wizard) return TRUE;
- if (s_info[s_idx].value || s_info[s_idx].mod) return TRUE;
+ if (wizard) return true;
+ if (s_info[s_idx].value || s_info[s_idx].mod) return true;
for (std::size_t i = 0; i < s_descriptors.size(); i++)
{
@@ -225,12 +225,12 @@ static bool_ is_known(int s_idx)
if (s_descriptors[i].father == s_idx)
{
if (is_known(i))
- return TRUE;
+ return true;
}
}
/* Ok know none */
- return FALSE;
+ return false;
}
namespace { // anonymous
@@ -242,7 +242,7 @@ struct skill_entry {
}
-static void init_table_aux(std::vector<skill_entry> *table, int father, int lev, bool_ full)
+static void init_table_aux(std::vector<skill_entry> *table, int father, int lev, bool full)
{
auto const &s_descriptors = game->edit_data.s_descriptors;
auto const &s_info = game->s_info;
@@ -267,7 +267,7 @@ static void init_table_aux(std::vector<skill_entry> *table, int father, int lev,
}
}
-static void init_table(std::vector<skill_entry> *table, bool_ full)
+static void init_table(std::vector<skill_entry> *table, bool full)
{
table->clear();
init_table_aux(table, -1, 0, full);
@@ -301,7 +301,7 @@ void dump_skills(FILE *fff)
std::vector<skill_entry> table;
table.reserve(s_descriptors.size());
- init_table(&table, TRUE);
+ init_table(&table, true);
fprintf(fff, "\nSkills (points left: %d)", p_ptr->skill_points);
@@ -439,7 +439,7 @@ static void print_skills(std::vector<skill_entry> const &table, int sel, int sta
/*
* Checks various stuff to do when skills change, like new spells, ...
*/
-void recalc_skills(bool_ init)
+void recalc_skills(bool init)
{
auto const &s_info = game->s_info;
@@ -570,7 +570,7 @@ void do_cmd_skill()
int wid, hgt;
s16b skill_points_save;
- recalc_skills(TRUE);
+ recalc_skills(true);
/* Save the screen */
screen_save();
@@ -598,9 +598,9 @@ void do_cmd_skill()
/* Initialise the skill list */
std::vector<skill_entry> table;
table.reserve(s_descriptors.size());
- init_table(&table, FALSE);
+ init_table(&table, false);
- while (TRUE)
+ while (true)
{
Term_get_size(&wid, &hgt);
@@ -620,7 +620,7 @@ void do_cmd_skill()
// Toggle the selected skill
s_info[table[sel].skill_idx].dev = !s_info[table[sel].skill_idx].dev;
// Re-populate table
- init_table(&table, FALSE);
+ init_table(&table, false);
}
/* Next page */
@@ -714,7 +714,7 @@ void do_cmd_skill()
/* Load the screen */
screen_load();
- recalc_skills(FALSE);
+ recalc_skills(false);
}
@@ -734,7 +734,7 @@ static const char *melee_names[MAX_MELEE] =
"Barehanded combat",
"Bearform combat",
};
-static bool_ melee_bool[MAX_MELEE];
+static bool melee_bool[MAX_MELEE];
static int melee_num[MAX_MELEE];
s16b get_melee_skill()
@@ -764,11 +764,11 @@ s16b get_melee_skills()
{
if ((s_info[melee_skills[i]].value > 0) && (!s_info[melee_skills[i]].hidden))
{
- melee_bool[i] = TRUE;
+ melee_bool[i] = true;
j++;
}
else
- melee_bool[i] = FALSE;
+ melee_bool[i] = false;
}
return (j);
@@ -777,7 +777,7 @@ s16b get_melee_skills()
static void choose_melee()
{
int i, j, z = 0;
- int force_drop = FALSE, style_unchanged = FALSE;
+ int force_drop = false, style_unchanged = false;
screen_save_no_flush();
@@ -795,7 +795,7 @@ static void choose_melee()
}
}
- while (TRUE)
+ while (true)
{
char c = inkey();
@@ -808,7 +808,7 @@ static void choose_melee()
if (p_ptr->melee_style == melee_skills[melee_num[z]])
{
- style_unchanged = TRUE;
+ style_unchanged = true;
break;
}
@@ -825,7 +825,7 @@ static void choose_melee()
}
else if (INVEN_PACK == inven_takeoff(i, 255, force_drop))
{
- force_drop = TRUE;
+ force_drop = true;
}
}
}
@@ -917,14 +917,14 @@ static int do_cmd_activate_skill_aux()
{
if (s_descriptors[i].action_mkey && s_info[i].value && ((!s_info[i].hidden) || (i == SKILL_LEARN)))
{
- bool_ next = FALSE;
+ bool next = false;
/* Already got it ? */
for (size_t j = 0; j < p.size(); j++)
{
if (s_descriptors[i].action_mkey == std::get<1>(p[j]))
{
- next = TRUE;
+ next = true;
break;
}
}
@@ -939,14 +939,14 @@ static int do_cmd_activate_skill_aux()
{
if (ab_info[i].action_mkey && p_ptr->has_ability(i))
{
- bool_ next = FALSE;
+ bool next = false;
/* Already got it ? */
for (size_t j = 0; j < p.size(); j++)
{
if (ab_info[i].action_mkey == std::get<1>(p[j]))
{
- next = TRUE;
+ next = true;
break;
}
}
@@ -999,7 +999,7 @@ static int do_cmd_activate_skill_aux()
strcpy(buf, "Cast a spell");
if (!get_string("Skill action? ", buf, 79))
- return FALSE;
+ return false;
/* Find the skill it is related to */
size_t i = 0;
@@ -1048,12 +1048,12 @@ void do_cmd_activate_skill()
auto const &s_info = game->s_info;
int x_idx;
- bool_ push = TRUE;
+ bool push = true;
/* Get the skill, if available */
if (repeat_pull(&x_idx))
{
- push = FALSE;
+ push = false;
}
else if (!command_arg)
{
@@ -1203,7 +1203,7 @@ void do_cmd_activate_skill()
s = get_school_spell("cast", BOOK_GEOMANCY);
if (s >= 0)
{
- lua_cast_school_spell(s, FALSE);
+ lua_cast_school_spell(s, false);
}
break;
@@ -1258,23 +1258,23 @@ void do_cmd_activate_skill()
/* Which magic forbids non FA gloves */
-bool_ forbid_gloves()
+bool forbid_gloves()
{
- if (get_skill(SKILL_SORCERY)) return (TRUE);
- if (get_skill(SKILL_MANA)) return (TRUE);
- if (get_skill(SKILL_FIRE)) return (TRUE);
- if (get_skill(SKILL_AIR)) return (TRUE);
- if (get_skill(SKILL_WATER)) return (TRUE);
- if (get_skill(SKILL_EARTH)) return (TRUE);
- if (get_skill(SKILL_THAUMATURGY)) return (TRUE);
- return (FALSE);
+ if (get_skill(SKILL_SORCERY)) return true;
+ if (get_skill(SKILL_MANA)) return true;
+ if (get_skill(SKILL_FIRE)) return true;
+ if (get_skill(SKILL_AIR)) return true;
+ if (get_skill(SKILL_WATER)) return true;
+ if (get_skill(SKILL_EARTH)) return true;
+ if (get_skill(SKILL_THAUMATURGY)) return true;
+ return false;
}
/* Which gods forbid edged weapons */
-bool_ forbid_non_blessed()
+bool forbid_non_blessed()
{
- if (p_ptr->pgod == GOD_ERU) return (TRUE);
- return (FALSE);
+ if (p_ptr->pgod == GOD_ERU) return true;
+ return false;
}
@@ -1385,7 +1385,7 @@ void do_get_new_skill()
auto &s_info = game->s_info;
/* Check if some skills didn't influence other stuff */
- recalc_skills(TRUE);
+ recalc_skills(true);
/* Grab the ones we can gain */
std::vector<size_t> available_skills;
@@ -1461,7 +1461,7 @@ void do_get_new_skill()
}
// Ask for a skill
- while (TRUE)
+ while (true)
{
char last = 'a' + (LOST_SWORD_NSKILLS-1);
char buf[80];
@@ -1473,7 +1473,7 @@ void do_get_new_skill()
{
std::size_t chosen_skill = skl[res];
- bool_ oppose = FALSE;
+ bool oppose = false;
int oppose_skill = -1;
/* Check we don't oppose a skill the player already has */
@@ -1492,7 +1492,7 @@ void do_get_new_skill()
if (found != s_descriptor.excludes.end())
{
- oppose = TRUE;
+ oppose = true;
oppose_skill = i;
break;
}
@@ -1543,7 +1543,7 @@ void do_get_new_skill()
}
/* Check if some skills didn't influence other stuff */
- recalc_skills(FALSE);
+ recalc_skills(false);
}
@@ -1587,19 +1587,19 @@ static bool can_learn_ability(int ab)
if (p_ptr->has_ability(ab))
{
- return FALSE;
+ return false;
}
if (p_ptr->skill_points < ab_info[ab].cost)
{
- return FALSE;
+ return false;
}
for (auto const &need_skill: ab_ptr->need_skills)
{
if (get_skill(need_skill.skill_idx) < need_skill.level)
{
- return FALSE;
+ return false;
}
}
@@ -1607,7 +1607,7 @@ static bool can_learn_ability(int ab)
{
if (!p_ptr->has_ability(need_ability))
{
- return FALSE;
+ return false;
}
}
@@ -1617,11 +1617,11 @@ static bool can_learn_ability(int ab)
if (ab_ptr->stat[i] > -1)
{
if (p_ptr->stat_ind[i] < ab_ptr->stat[i] - 3)
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
/* Learn an ability */
@@ -1792,7 +1792,7 @@ void do_cmd_ability()
std::end(table),
compare_abilities);
- while (TRUE)
+ while (true)
{
Term_get_size(&wid, &hgt);
diff --git a/src/skills.hpp b/src/skills.hpp
index d778fbf7..0784c9e6 100644
--- a/src/skills.hpp
+++ b/src/skills.hpp
@@ -17,8 +17,8 @@ void do_cmd_activate_skill();
const char *get_melee_name();
s16b get_melee_skills();
s16b get_melee_skill();
-bool_ forbid_gloves();
-bool_ forbid_non_blessed();
+bool forbid_gloves();
+bool forbid_non_blessed();
void compute_skills(s32b *v, s32b *m, std::size_t i);
void select_default_melee();
void do_get_new_skill();
@@ -28,4 +28,4 @@ s16b find_ability(const char *name);
void dump_abilities(FILE *fff);
void do_cmd_ability();
void apply_level_abilities(int level);
-void recalc_skills(bool_ init);
+void recalc_skills(bool init);
diff --git a/src/spell_type.cc b/src/spell_type.cc
index a549412b..55cf74e3 100644
--- a/src/spell_type.cc
+++ b/src/spell_type.cc
@@ -64,8 +64,8 @@ public:
, minimum_pval(0)
, casting_type(USE_SPELL_POINTS)
, casting_stat(0)
- , castable_while_blind(FALSE)
- , castable_while_confused(FALSE)
+ , castable_while_blind(false)
+ , castable_while_confused(false)
, device_charges({ 0, 0, 0 })
, m_device_allocation()
, random_type(-1)
@@ -155,7 +155,7 @@ void spell_type_init_mage(spell_type *spell,
break;
default:
/* Cannot happen */
- assert(FALSE);
+ assert(false);
}
/* Add first school */
@@ -374,7 +374,7 @@ bool spell_type_inertia(spell_type *spell, s32b *difficulty, s32b *delay)
if ((spell->inertia_difficulty < 0) ||
(spell->inertia_delay < 0))
{
- return FALSE;
+ return false;
}
if (difficulty != NULL)
@@ -387,7 +387,7 @@ bool spell_type_inertia(spell_type *spell, s32b *difficulty, s32b *delay)
*delay = spell->inertia_delay;
}
- return TRUE;
+ return true;
}
const char *spell_type_info(spell_type *spell)
diff --git a/src/spells1.cc b/src/spells1.cc
index 33ae80c8..b88ef636 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -145,9 +145,9 @@ void teleport_player_directed(int rad, int dir)
int min = rad / 4;
int dis = rad;
int i, d;
- bool_ look = TRUE;
- bool_ y_major = FALSE;
- bool_ x_major = FALSE;
+ bool look = true;
+ bool y_major = false;
+ bool x_major = false;
int y_neg = 1;
int x_neg = 1;
cave_type *c_ptr;
@@ -161,8 +161,8 @@ void teleport_player_directed(int rad, int dir)
/* Rooted means no move */
if (p_ptr->tim_roots) return;
- if (yfoo == 0) x_major = TRUE;
- if (xfoo == 0) y_major = TRUE;
+ if (yfoo == 0) x_major = true;
+ if (xfoo == 0) y_major = true;
if (yfoo < 0) y_neg = -1;
if (xfoo < 0) x_neg = -1;
@@ -211,7 +211,7 @@ void teleport_player_directed(int rad, int dir)
if (!cave_empty_bold(y, x)) continue;
/* This grid looks good */
- look = FALSE;
+ look = false;
/* Stop looking */
break;
@@ -254,7 +254,7 @@ void teleport_player_directed(int rad, int dir)
*/
void teleport_away(int m_idx, int dis)
{
- bool_ look = TRUE;
+ bool look = true;
monster_type *m_ptr = &m_list[m_idx];
@@ -316,7 +316,7 @@ void teleport_away(int m_idx, int dis)
if (cave[ny][nx].info & (CAVE_ICKY)) continue;
/* This grid looks good */
- look = FALSE;
+ look = false;
/* Stop looking */
break;
@@ -345,7 +345,7 @@ void teleport_away(int m_idx, int dis)
m_ptr->fx = nx;
/* Update the monster (new location) */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
/* Redraw the old grid */
lite_spot(oy, ox);
@@ -397,7 +397,7 @@ static void teleport_to_player(int m_idx)
int nx = 0;
/* Look until done */
- bool_ look = TRUE;
+ bool look = true;
while (look && --attempts)
{
/* Verify max distance */
@@ -433,7 +433,7 @@ static void teleport_to_player(int m_idx)
/* if (cave[ny][nx].info & (CAVE_ICKY)) continue; */
/* This grid looks good */
- look = FALSE;
+ look = false;
/* Stop looking */
break;
@@ -461,7 +461,7 @@ static void teleport_to_player(int m_idx)
m_ptr->fx = nx;
/* Update the monster (new location) */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
/* Redraw the old grid */
lite_spot(oy, ox);
@@ -481,7 +481,7 @@ static void teleport_to_player(int m_idx)
* Try very hard to move the player at least a quarter that distance.
*/
/* It'd be better if this was made an argument ... */
-bool_ teleport_player_bypass = FALSE;
+bool teleport_player_bypass = false;
void teleport_player(int dis)
{
@@ -492,7 +492,7 @@ void teleport_player(int dis)
int xx = -1, yy = -1;
- bool_ look = TRUE;
+ bool look = true;
if (p_ptr->resist_continuum && (!teleport_player_bypass))
{
@@ -553,7 +553,7 @@ void teleport_player(int dis)
if (cave[y][x].info & (CAVE_ICKY)) continue;
/* This grid looks good */
- look = FALSE;
+ look = false;
/* Stop looking */
break;
@@ -645,7 +645,7 @@ void get_pos_player(int dis, int *ny, int *nx)
int d, i, min, x = 0, y = 0;
int tries = 0;
- bool_ look = TRUE;
+ bool look = true;
if (dis > 200) dis = 200; /* To be on the safe side... */
@@ -682,7 +682,7 @@ void get_pos_player(int dis, int *ny, int *nx)
if (cave[y][x].info & (CAVE_ICKY)) continue;
/* This grid looks good */
- look = FALSE;
+ look = false;
/* Stop looking */
break;
@@ -760,7 +760,7 @@ void teleport_monster_to(int m_idx, int ny, int nx)
last_teleportation_x = x;
/* Update the monster (new location) */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
/* Redraw the old spot */
lite_spot(oy, ox);
@@ -1216,7 +1216,7 @@ void spellbinder_trigger()
for (auto spell_idx: spellbinder->spell_idxs)
{
msg_format("Triggering spell %s.", spell_type_name(spell_at(spell_idx)));
- lua_cast_school_spell(spell_idx, TRUE);
+ lua_cast_school_spell(spell_idx, true);
}
spellbinder->spell_idxs.clear();
@@ -1238,8 +1238,8 @@ void take_hit(int damage, const char *hit_from)
object_type *o_ptr = &p_ptr->inventory[INVEN_CARRY];
int old_chp = p_ptr->chp;
- bool_ pen_invuln = FALSE;
- bool_ monster_take = FALSE;
+ bool pen_invuln = false;
+ bool monster_take = false;
char death_message[80];
@@ -1257,7 +1257,7 @@ void take_hit(int damage, const char *hit_from)
{
if (randint(PENETRATE_INVULNERABILITY) == 1)
{
- pen_invuln = TRUE;
+ pen_invuln = true;
}
else
{
@@ -1303,10 +1303,10 @@ void take_hit(int damage, const char *hit_from)
{
msg_format("%s takes the damage instead of you.", sym_name.c_str());
o_ptr->pval2 -= damage;
- monster_take = TRUE;
+ monster_take = true;
}
- carried_monster_hit = FALSE;
+ carried_monster_hit = false;
/* Display the monster hitpoints */
p_ptr->redraw |= (PR_FRAME);
@@ -1353,11 +1353,11 @@ void take_hit(int damage, const char *hit_from)
p_ptr->leaving = true;
/* No longer a winner */
- total_winner = FALSE;
+ total_winner = false;
/* Note death */
- death = TRUE;
+ death = true;
if (get_check("Dump the screen? "))
{
@@ -1463,7 +1463,7 @@ void take_hit(int damage, const char *hit_from)
chance /= 10;
if (chance < 1) chance = 1;
for (i = 0; i < chance; i++)
- summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level / 2, type, FALSE);
+ summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level / 2, type, false);
msg_print("Melkor summons monsters to help you!");
}
}
@@ -1534,7 +1534,7 @@ void take_sanity_hit(int damage, const char *hit_from)
p_ptr->leaving = true;
/* Note death */
- death = TRUE;
+ death = true;
if (get_check("Dump the screen? "))
{
@@ -1571,7 +1571,7 @@ void take_sanity_hit(int damage, const char *hit_from)
* Does a given class of objects (usually) hate acid?
* Note that acid can either melt or corrode something.
*/
-static bool_ hates_acid(object_type *o_ptr)
+static bool hates_acid(object_type *o_ptr)
{
/* Analyze the type */
switch (o_ptr->tval)
@@ -1594,14 +1594,14 @@ static bool_ hates_acid(object_type *o_ptr)
case TV_HARD_ARMOR:
case TV_DRAG_ARMOR:
{
- return (TRUE);
+ return true;
}
/* Staffs/Scrolls are wood/paper */
case TV_STAFF:
case TV_SCROLL:
{
- return (TRUE);
+ return true;
}
/* Junk is useless */
@@ -1609,18 +1609,18 @@ static bool_ hates_acid(object_type *o_ptr)
case TV_BOTTLE:
case TV_EGG:
{
- return (TRUE);
+ return true;
}
}
- return (FALSE);
+ return false;
}
/*
* Does a given object (usually) hate electricity?
*/
-static bool_ hates_elec(object_type *o_ptr)
+static bool hates_elec(object_type *o_ptr)
{
switch (o_ptr->tval)
{
@@ -1628,11 +1628,11 @@ static bool_ hates_elec(object_type *o_ptr)
case TV_WAND:
case TV_EGG:
{
- return (TRUE);
+ return true;
}
}
- return (FALSE);
+ return false;
}
@@ -1641,7 +1641,7 @@ static bool_ hates_elec(object_type *o_ptr)
* Hafted/Polearm weapons have wooden shafts.
* Arrows/Bows are mostly wooden.
*/
-static bool_ hates_fire(object_type *o_ptr)
+static bool hates_fire(object_type *o_ptr)
{
/* Analyze the type */
switch (o_ptr->tval)
@@ -1649,7 +1649,7 @@ static bool_ hates_fire(object_type *o_ptr)
/* Special case for archers */
case TV_ARROW:
{
- return TRUE;
+ return true;
};
/* Wearable */
@@ -1662,7 +1662,7 @@ static bool_ hates_fire(object_type *o_ptr)
case TV_CLOAK:
case TV_SOFT_ARMOR:
{
- return (TRUE);
+ return true;
}
/* Books */
@@ -1670,7 +1670,7 @@ static bool_ hates_fire(object_type *o_ptr)
case TV_SYMBIOTIC_BOOK:
case TV_MUSIC_BOOK:
{
- return (TRUE);
+ return true;
}
/* Staffs/Scrolls burn */
@@ -1678,18 +1678,18 @@ static bool_ hates_fire(object_type *o_ptr)
case TV_SCROLL:
case TV_EGG:
{
- return (TRUE);
+ return true;
}
}
- return (FALSE);
+ return false;
}
/*
* Does a given object (usually) hate cold?
*/
-static bool_ hates_cold(object_type *o_ptr)
+static bool hates_cold(object_type *o_ptr)
{
switch (o_ptr->tval)
{
@@ -1699,11 +1699,11 @@ static bool_ hates_cold(object_type *o_ptr)
case TV_BOTTLE:
case TV_EGG:
{
- return (TRUE);
+ return true;
}
}
- return (FALSE);
+ return false;
}
@@ -1719,11 +1719,11 @@ static bool_ hates_cold(object_type *o_ptr)
*/
static int set_acid_destroy(object_type *o_ptr)
{
- if (!hates_acid(o_ptr)) return (FALSE);
+ if (!hates_acid(o_ptr)) return false;
auto const f = object_flags(o_ptr);
- if (f & TR_IGNORE_ACID) return (FALSE);
- return (TRUE);
+ if (f & TR_IGNORE_ACID) return false;
+ return true;
}
@@ -1732,11 +1732,11 @@ static int set_acid_destroy(object_type *o_ptr)
*/
static int set_elec_destroy(object_type *o_ptr)
{
- if (!hates_elec(o_ptr)) return (FALSE);
+ if (!hates_elec(o_ptr)) return false;
auto const f = object_flags(o_ptr);
- if (f & TR_IGNORE_ELEC) return (FALSE);
- return (TRUE);
+ if (f & TR_IGNORE_ELEC) return false;
+ return true;
}
@@ -1745,11 +1745,11 @@ static int set_elec_destroy(object_type *o_ptr)
*/
static int set_fire_destroy(object_type *o_ptr)
{
- if (!hates_fire(o_ptr)) return (FALSE);
+ if (!hates_fire(o_ptr)) return false;
auto const f = object_flags(o_ptr);
- if (f & TR_IGNORE_FIRE) return (FALSE);
- return (TRUE);
+ if (f & TR_IGNORE_FIRE) return false;
+ return true;
}
@@ -1758,11 +1758,11 @@ static int set_fire_destroy(object_type *o_ptr)
*/
static int set_cold_destroy(object_type *o_ptr)
{
- if (!hates_cold(o_ptr)) return (FALSE);
+ if (!hates_cold(o_ptr)) return false;
auto const f = object_flags(o_ptr);
- if (f & (TR_IGNORE_COLD)) return (FALSE);
- return (TRUE);
+ if (f & (TR_IGNORE_COLD)) return false;
+ return true;
}
@@ -1814,7 +1814,7 @@ static int inven_damage(inven_func typ, int perc)
{
/* Get a description */
char o_name[80];
- object_desc(o_name, o_ptr, FALSE, 3);
+ object_desc(o_name, o_ptr, false, 3);
/* Message */
msg_format("%sour %s (%c) %s destroyed!",
@@ -1895,14 +1895,14 @@ static int minus_ac()
}
/* Nothing to damage */
- if (!o_ptr->k_ptr) return (FALSE);
+ if (!o_ptr->k_ptr) return false;
/* No damage left to be done */
- if (o_ptr->ac + o_ptr->to_a <= 0) return (FALSE);
+ if (o_ptr->ac + o_ptr->to_a <= 0) return false;
/* Describe */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/* Extract the flags */
auto const flags = object_flags(o_ptr);
@@ -1912,7 +1912,7 @@ static int minus_ac()
{
msg_format("Your %s is unaffected!", o_name);
- return (TRUE);
+ return true;
}
/* Message */
@@ -1928,7 +1928,7 @@ static int minus_ac()
p_ptr->window |= (PW_EQUIP | PW_PLAYER);
/* Item was damaged */
- return (TRUE);
+ return true;
}
@@ -2060,9 +2060,9 @@ void cold_dam(int dam, const char *kb_str)
* if your stat is already drained, the "max" value will not drop all
* the way down to the "cur" value.
*/
-bool_ dec_stat(int stat, int amount, int mode)
+bool dec_stat(int stat, int amount, int mode)
{
- int cur, max, loss = 0, same, res = FALSE;
+ int cur, max, loss = 0, same, res = false;
/* Acquire current value */
@@ -2112,7 +2112,7 @@ bool_ dec_stat(int stat, int amount, int mode)
if (cur < 3) cur = 3;
/* Something happened */
- if (cur != p_ptr->stat_cur[stat]) res = TRUE;
+ if (cur != p_ptr->stat_cur[stat]) res = true;
}
/* Damage "max" value */
@@ -2148,7 +2148,7 @@ bool_ dec_stat(int stat, int amount, int mode)
if (same || (max < cur)) max = cur;
/* Something happened */
- if (max != p_ptr->stat_max[stat]) res = TRUE;
+ if (max != p_ptr->stat_max[stat]) res = true;
}
/* Apply changes */
@@ -2194,9 +2194,9 @@ bool_ dec_stat(int stat, int amount, int mode)
/*
- * Restore a stat. Return TRUE only if this actually makes a difference.
+ * Restore a stat. Return true only if this actually makes a difference.
*/
-bool_ res_stat(int stat, bool_ full)
+bool res_stat(int stat, bool full)
{
/* Fully restore */
if (full)
@@ -2215,7 +2215,7 @@ bool_ res_stat(int stat, bool_ full)
p_ptr->update |= (PU_BONUS);
/* Something happened */
- return (TRUE);
+ return true;
}
}
@@ -2236,12 +2236,12 @@ bool_ res_stat(int stat, bool_ full)
p_ptr->update |= (PU_BONUS);
/* Something happened */
- return (TRUE);
+ return true;
}
}
/* Nothing to restore */
- return (FALSE);
+ return false;
}
@@ -2255,9 +2255,9 @@ bool_ res_stat(int stat, bool_ full)
* If "mode is set to 0 then a random slot will be used, if not the "mode"
* slot will be used.
*
- * Return "TRUE" if the player notices anything
+ * Return "true" if the player notices anything
*/
-bool_ apply_disenchant(int mode)
+bool apply_disenchant(int mode)
{
int t = mode;
object_type *o_ptr;
@@ -2299,19 +2299,19 @@ bool_ apply_disenchant(int mode)
o_ptr = &p_ptr->inventory[t];
/* No item, nothing happens */
- if (!o_ptr->k_ptr) return (FALSE);
+ if (!o_ptr->k_ptr) return false;
/* Nothing to disenchant */
if ((o_ptr->to_h <= 0) && (o_ptr->to_d <= 0) && (o_ptr->to_a <= 0))
{
/* Nothing to notice */
- return (FALSE);
+ return false;
}
/* Describe the object */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/* Artifacts have 71% chance to resist */
@@ -2323,7 +2323,7 @@ bool_ apply_disenchant(int mode)
((o_ptr->number != 1) ? "" : "s"));
/* Notice */
- return (TRUE);
+ return true;
}
@@ -2351,7 +2351,7 @@ bool_ apply_disenchant(int mode)
p_ptr->window |= (PW_EQUIP | PW_PLAYER);
/* Notice */
- return (TRUE);
+ return true;
}
@@ -2898,22 +2898,22 @@ static int project_m_y;
* Note that we determine if the player can "see" anything that happens
* by taking into account: blindness, line-of-sight, and illumination.
*
- * We return "TRUE" if the effect of the projection is "obvious".
+ * We return "true" if the effect of the projection is "obvious".
*
* XXX XXX XXX We also "see" grids which are "memorized", probably a hack
*
* XXX XXX XXX Perhaps we should affect doors?
*/
-static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
+static bool project_f(int who, int r, int y, int x, int dam, int typ)
{
cave_type *c_ptr = &cave[y][x];
auto const &f_info = game->edit_data.f_info;
- bool_ obvious = FALSE;
+ bool obvious = false;
- bool_ flag = FALSE;
+ bool flag = false;
- bool_ seen;
+ bool seen;
/* XXX XXX XXX */
@@ -2955,7 +2955,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
{
cave_set_feat(y, x, FEAT_ICE);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
break;
@@ -3002,13 +3002,13 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (seen)
{
- obvious = TRUE;
+ obvious = true;
note_spot(y, x);
}
if (player_can_see_bold(y2, x2))
{
- obvious = TRUE;
+ obvious = true;
note_spot(y2, x2);
}
@@ -3033,7 +3033,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Silly thing to destroy trees when a yavanna worshipper */
inc_piety(GOD_YAVANNA, -50);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
/* Trees *will* burn */
@@ -3044,7 +3044,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Silly thing to destroy trees when a yavanna worshipper */
inc_piety(GOD_YAVANNA, -60);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
/* Ice can melt (chance == 30%) */
@@ -3058,7 +3058,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (k < 10) cave_set_feat(y, x, FEAT_DIRT);
else if (k < 30) cave_set_feat(y, x, FEAT_SHAL_WATER);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
/* Floors can become ash or lava (chance == 25%) */
@@ -3072,7 +3072,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (k < 10) cave_set_feat(y, x, FEAT_SHAL_LAVA);
else if (k < 25) cave_set_feat(y, x, FEAT_ASH);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
/* Sandwall can be turned into glass (chance == 30%) */
@@ -3090,7 +3090,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Visibility change */
p_ptr->update |= (PU_VIEW | PU_MONSTERS | PU_MON_LITE);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
}
@@ -3163,7 +3163,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (f == FEAT_FLOOR) place_floor_convert_glass(y, x);
else cave_set_feat(y, x, f);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
break;
@@ -3189,7 +3189,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Silly thing to destroy trees when a yavanna worshipper */
inc_piety(GOD_YAVANNA, -50);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
break;
@@ -3217,7 +3217,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Visibility change */
p_ptr->update |= (PU_VIEW | PU_MONSTERS | PU_MON_LITE);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
break;
@@ -3237,7 +3237,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
{
/* Message */
msg_print("There is a bright flash of light!");
- obvious = TRUE;
+ obvious = true;
/* Visibility change */
if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
@@ -3279,7 +3279,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
{
/* Message */
msg_print("The door seems stuck.");
- obvious = TRUE;
+ obvious = true;
}
}
@@ -3303,7 +3303,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (c_ptr->info & (CAVE_MARK))
{
msg_print("The wall turns into mud!");
- obvious = TRUE;
+ obvious = true;
}
/* Forget the wall */
@@ -3323,7 +3323,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
{
msg_print("The vein turns into mud!");
msg_print("You have found something!");
- obvious = TRUE;
+ obvious = true;
}
/* Forget the wall */
@@ -3346,7 +3346,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (c_ptr->info & (CAVE_MARK))
{
msg_print("The vein turns into mud!");
- obvious = TRUE;
+ obvious = true;
}
/* Forget the wall */
@@ -3363,7 +3363,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (c_ptr->info & (CAVE_MARK))
{
msg_print("The rubble turns into mud!");
- obvious = TRUE;
+ obvious = true;
}
/* Forget the wall */
@@ -3379,11 +3379,11 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (seen)
{
msg_print("There was something buried in the rubble!");
- obvious = TRUE;
+ obvious = true;
}
/* Place gold */
- place_object(y, x, FALSE, FALSE, OBJ_FOUND_RUBBLE);
+ place_object(y, x, false, false, OBJ_FOUND_RUBBLE);
}
}
@@ -3396,7 +3396,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if (c_ptr->info & (CAVE_MARK))
{
msg_print("The door turns into mud!");
- obvious = TRUE;
+ obvious = true;
}
/* Forget the wall */
@@ -3427,7 +3427,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
/* Observe */
- if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
+ if (c_ptr->info & (CAVE_MARK)) obvious = true;
/* Update some things */
p_ptr->update |= (PU_VIEW | PU_MONSTERS | PU_MON_LITE);
@@ -3444,7 +3444,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
cave_set_feat(y, x, FEAT_GLYPH);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
break;
}
@@ -3462,7 +3462,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Place a wall */
cave_set_feat(y, x, FEAT_WALL_EXTRA);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Update some things */
p_ptr->update |= (PU_VIEW | PU_MONSTERS | PU_MON_LITE);
@@ -3511,7 +3511,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Place a shallow lava */
cave_set_feat(y, x, FEAT_SHAL_LAVA);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
}
/* Deep Lava */
@@ -3523,7 +3523,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
/* Place a deep lava */
cave_set_feat(y, x, FEAT_DEEP_LAVA);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Dam is used as a counter for the number of grid to convert */
dam--;
@@ -3546,13 +3546,13 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
lite_spot(y, x);
/* Observe */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/*
* Mega-Hack -- Update the monster in the affected grid
* This allows "spear of light" (etc) to work "correctly"
*/
- if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ if (c_ptr->m_idx) update_mon(c_ptr->m_idx, false);
break;
}
@@ -3562,7 +3562,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
case GF_DARK:
{
/* Notice */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Turn off the light. */
c_ptr->info &= ~(CAVE_GLOW);
@@ -3584,7 +3584,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
* Mega-Hack -- Update the monster in the affected grid
* This allows "spear of light" (etc) to work "correctly"
*/
- if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ if (c_ptr->m_idx) update_mon(c_ptr->m_idx, false);
/* All done */
break;
@@ -3604,7 +3604,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
if ((x == p_ptr->px) && (y == p_ptr->py))
{
/* Hurt the player later */
- flag = TRUE;
+ flag = true;
/* Do not hurt this grid */
break;
@@ -3664,7 +3664,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
p_ptr->update |= (PU_VIEW | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
}
- obvious = TRUE;
+ obvious = true;
break;
}
@@ -3678,7 +3678,7 @@ static bool_ project_f(int who, int r, int y, int x, int dam, int typ)
case GF_ELEMENTAL_GROWTH:
{
- geomancy_random_floor(y, x, FALSE);
+ geomancy_random_floor(y, x, false);
break;
}
}
@@ -3733,20 +3733,20 @@ static int raise_ego[MAX_RAISE] =
*
* XXX XXX XXX We also "see" grids which are "memorized", probably a hack
*
- * We return "TRUE" if the effect of the projection is "obvious".
+ * We return "true" if the effect of the projection is "obvious".
*/
-static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
+static bool project_o(int who, int r, int y, int x, int dam, int typ)
{
auto const &r_info = game->edit_data.r_info;
cave_type *c_ptr = &cave[y][x];
- bool_ obvious = FALSE;
+ bool obvious = false;
char o_name[80];
int o_sval = 0;
- bool_ is_potion = FALSE;
+ bool is_potion = false;
/* XXX XXX XXX */
@@ -3764,10 +3764,10 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
/* Scan all objects in the grid */
for (auto const this_o_idx: object_idxs)
{
- bool_ is_art = FALSE;
- bool_ ignore = FALSE;
- bool_ plural = FALSE;
- bool_ do_kill = FALSE;
+ bool is_art = false;
+ bool ignore = false;
+ bool plural = false;
+ bool do_kill = false;
const char *note_kill = NULL;
@@ -3778,10 +3778,10 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
auto const flags = object_flags(o_ptr);
/* Get the "plural"-ness */
- if (o_ptr->number > 1) plural = TRUE;
+ if (o_ptr->number > 1) plural = true;
/* Check for artifact */
- if (artifact_p(o_ptr)) is_art = TRUE;
+ if (artifact_p(o_ptr)) is_art = true;
/* Analyze the type */
switch (typ)
@@ -3806,7 +3806,7 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
/* Adjust the radius */
radius = radius * dam / 100;
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " explode!" : " explodes!");
project(who, radius, y, x, dama, GF_SHARDS, PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL);
}
@@ -3818,9 +3818,9 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
if (hates_acid(o_ptr))
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " melt!" : " melts!");
- if (flags & TR_IGNORE_ACID) ignore = TRUE;
+ if (flags & TR_IGNORE_ACID) ignore = true;
}
break;
}
@@ -3830,9 +3830,9 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
if (hates_elec(o_ptr))
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " are destroyed!" : " is destroyed!");
- if (flags & TR_IGNORE_ELEC) ignore = TRUE;
+ if (flags & TR_IGNORE_ELEC) ignore = true;
}
break;
}
@@ -3842,9 +3842,9 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
if (hates_fire(o_ptr))
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " burn up!" : " burns up!");
- if (flags & TR_IGNORE_FIRE) ignore = TRUE;
+ if (flags & TR_IGNORE_FIRE) ignore = true;
}
break;
}
@@ -3855,8 +3855,8 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
if (hates_cold(o_ptr))
{
note_kill = (plural ? " shatter!" : " shatters!");
- do_kill = TRUE;
- if (flags & TR_IGNORE_COLD) ignore = TRUE;
+ do_kill = true;
+ if (flags & TR_IGNORE_COLD) ignore = true;
}
break;
}
@@ -3866,16 +3866,16 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
if (hates_fire(o_ptr))
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " burn up!" : " burns up!");
- if (flags & TR_IGNORE_FIRE) ignore = TRUE;
+ if (flags & TR_IGNORE_FIRE) ignore = true;
}
if (hates_elec(o_ptr))
{
- ignore = FALSE;
- do_kill = TRUE;
+ ignore = false;
+ do_kill = true;
note_kill = (plural ? " are destroyed!" : " is destroyed!");
- if (flags & TR_IGNORE_ELEC) ignore = TRUE;
+ if (flags & TR_IGNORE_ELEC) ignore = true;
}
break;
}
@@ -3885,16 +3885,16 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
if (hates_fire(o_ptr))
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " burn up!" : " burns up!");
- if (flags & TR_IGNORE_FIRE) ignore = TRUE;
+ if (flags & TR_IGNORE_FIRE) ignore = true;
}
if (hates_cold(o_ptr))
{
- ignore = FALSE;
- do_kill = TRUE;
+ ignore = false;
+ do_kill = true;
note_kill = (plural ? " shatter!" : " shatters!");
- if (flags & TR_IGNORE_COLD) ignore = TRUE;
+ if (flags & TR_IGNORE_COLD) ignore = true;
}
break;
}
@@ -3908,7 +3908,7 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
if (hates_cold(o_ptr))
{
note_kill = (plural ? " shatter!" : " shatters!");
- do_kill = TRUE;
+ do_kill = true;
}
break;
}
@@ -3916,23 +3916,23 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
/* Mana and Chaos -- destroy everything */
case GF_MANA:
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " are destroyed!" : " is destroyed!");
break;
}
case GF_DISINTEGRATE:
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " evaporate!" : " evaporates!");
break;
}
case GF_CHAOS:
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " are destroyed!" : " is destroyed!");
- if (flags & TR_RES_CHAOS) ignore = TRUE;
+ if (flags & TR_RES_CHAOS) ignore = true;
break;
}
@@ -3942,7 +3942,7 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
if (cursed_p(o_ptr))
{
- do_kill = TRUE;
+ do_kill = true;
note_kill = (plural ? " are destroyed!" : " is destroyed!");
}
break;
@@ -3956,9 +3956,9 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
{
int ego = raise_ego[rand_int(MAX_RAISE)];
- if (place_monster_one(y, x, o_ptr->pval2, ego, FALSE, (!who) ? MSTATUS_PET : MSTATUS_ENEMY))
+ if (place_monster_one(y, x, o_ptr->pval2, ego, false, (!who) ? MSTATUS_PET : MSTATUS_ENEMY))
msg_print("A monster rises from the grave!");
- do_kill = TRUE;
+ do_kill = true;
}
break;
}
@@ -3984,11 +3984,11 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
else if (r_ptr->level < 90) name = "Marilith";
else name = "Nycadaemon";
- if (place_monster_one(y, x, test_monster_name(name), 0, FALSE, (!who) ? MSTATUS_PET : MSTATUS_ENEMY))
+ if (place_monster_one(y, x, test_monster_name(name), 0, false, (!who) ? MSTATUS_PET : MSTATUS_ENEMY))
msg_print("A demon emerges from Hell!");
}
- do_kill = TRUE;
+ do_kill = true;
break;
}
default:
@@ -4002,8 +4002,8 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
/* Effect "observed" */
if (o_ptr->marked)
{
- obvious = TRUE;
- object_desc(o_name, o_ptr, FALSE, 0);
+ obvious = true;
+ object_desc(o_name, o_ptr, false, 0);
}
/* Artifacts, and other objects, get to resist */
@@ -4051,10 +4051,10 @@ static bool_ project_o(int who, int r, int y, int x, int dam, int typ)
}
/* Can the monster be hurt ? */
-bool_ hurt_monster(monster_type *m_ptr)
+bool hurt_monster(monster_type *m_ptr)
{
- if (m_ptr->status == MSTATUS_COMPANION) return FALSE;
- else return TRUE;
+ if (m_ptr->status == MSTATUS_COMPANION) return false;
+ else return true;
}
/*
@@ -4106,11 +4106,11 @@ bool_ hurt_monster(monster_type *m_ptr)
* In this function, "result" messages are postponed until the end, where
* the "note" string is appended to the monster name, if not NULL. So,
* to make a spell have "no effect" just set "note" to NULL. You should
- * also set "notice" to FALSE, or the player will learn what the spell does.
+ * also set "notice" to false, or the player will learn what the spell does.
*
- * We attempt to return "TRUE" if the player saw anything "useful" happen.
+ * We attempt to return "true" if the player saw anything "useful" happen.
*/
-bool_ project_m(int who, int r, int y, int x, int dam, int typ)
+bool project_m(int who, int r, int y, int x, int dam, int typ)
{
auto const &dungeon_flags = game->dungeon_flags;
@@ -4123,13 +4123,13 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
char killer [80];
/* Is the monster "seen"? */
- bool_ seen;
+ bool seen;
/* Were the effects "obvious" (if seen)? */
- bool_ obvious = FALSE;
+ bool obvious = false;
/* Were the effects "irrelevant"? */
- bool_ skipped = FALSE;
+ bool skipped = false;
/* Move setting */
@@ -4175,20 +4175,20 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Nobody here */
- if (!c_ptr->m_idx) return (FALSE);
+ if (!c_ptr->m_idx) return false;
/* Never affect projector */
- if (who && (c_ptr->m_idx == who)) return (FALSE);
+ if (who && (c_ptr->m_idx == who)) return false;
/*
* Don't affect already dead monsters
* Prevents problems with chain reactions of exploding monsters
*/
- if (m_ptr->hp < 0) return (FALSE);
+ if (m_ptr->hp < 0) return false;
/* Remember if the monster is within player's line of sight */
- seen = (m_ptr->ml && ((who != -101) && (who != -100))) ? TRUE : FALSE;
+ seen = (m_ptr->ml && ((who != -101) && (who != -100))) ? true : false;
/* Reduce damage by distance */
dam = (dam + r) / (r + 1);
@@ -4223,7 +4223,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (!who && (is_friend(m_ptr) >= 0))
{
- bool_ get_angry = FALSE;
+ bool get_angry = false;
/* Grrr? */
switch (typ)
{
@@ -4245,70 +4245,70 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
break; /* none of the above anger */
case GF_TRAP_DEMONSOUL:
if (r_ptr->flags & RF_DEMON)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_KILL_WALL:
if (r_ptr->flags & RF_HURT_ROCK)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_HOLY_FIRE:
if (!(r_ptr->flags & RF_GOOD))
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_TURN_UNDEAD:
case GF_DISP_UNDEAD:
if (r_ptr->flags & RF_UNDEAD)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_TURN_EVIL:
case GF_DISP_EVIL:
if (r_ptr->flags & RF_EVIL)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_DISP_GOOD:
if (r_ptr->flags & RF_GOOD)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_DISP_DEMON:
if (r_ptr->flags & RF_DEMON)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_DISP_LIVING:
case GF_UNBREATH:
if (!(r_ptr->flags & RF_UNDEAD) &&
!(r_ptr->flags & RF_NONLIVING))
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_PSI:
case GF_PSI_DRAIN:
if (!(r_ptr->flags & RF_EMPTY_MIND))
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_DOMINATION:
if (!(r_ptr->flags & RF_NO_CONF))
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_OLD_POLY:
case GF_OLD_CLONE:
if (randint(8) == 1)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_LITE:
case GF_LITE_WEAK:
if (r_ptr->flags & RF_HURT_LITE)
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_INSTA_DEATH:
- get_angry = TRUE;
+ get_angry = true;
break;
case GF_ELEMENTAL_GROWTH:
case GF_ELEMENTAL_WALL:
- get_angry = FALSE;
+ get_angry = false;
break;
}
/* Now anger it if appropriate */
- if (get_angry == TRUE && !(who))
+ if (get_angry == true && !(who))
{
switch (is_friend(m_ptr))
{
@@ -4329,11 +4329,11 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
case GF_ATTACK:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
py_attack(y, x, dam);
- skipped = TRUE;
+ skipped = true;
dam = 0;
break;
@@ -4342,7 +4342,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Death -- instant death */
case GF_DEATH:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_UNIQUE)
{
@@ -4359,14 +4359,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Magic Missile -- pure damage */
case GF_MISSILE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
break;
}
/* Acid */
case GF_ACID:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_SUSCEP_ACID)
{
note = " is hit hard.";
@@ -4383,7 +4383,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Electricity */
case GF_ELEC:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_SUSCEP_ELEC)
{
note = " is hit hard.";
@@ -4400,7 +4400,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Fire damage */
case GF_FIRE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_SUSCEP_FIRE)
{
note = " is hit hard.";
@@ -4417,7 +4417,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Cold */
case GF_COLD:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_SUSCEP_COLD)
{
note = " is hit hard.";
@@ -4434,7 +4434,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Poison */
case GF_POIS:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (magik(25)) do_pois = (10 + randint(11) + r) / (r + 1);
if (r_ptr->flags & RF_SUSCEP_POIS)
{
@@ -4455,7 +4455,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Thick Poison */
case GF_UNBREATH:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (magik(15)) do_pois = (10 + randint(11) + r) / (r + 1);
if ((r_ptr->flags & RF_NONLIVING) || (r_ptr->flags & RF_UNDEAD))
{
@@ -4469,7 +4469,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Nuclear waste */
case GF_NUKE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_IM_POIS)
{
@@ -4477,14 +4477,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
dam *= 3;
dam /= (randint(6) + 6);
}
- else if (randint(3) == 1) do_poly = TRUE;
+ else if (randint(3) == 1) do_poly = true;
break;
}
/* Holy Orb -- hurts Evil (replaced with Hellfire) */
case GF_HELL_FIRE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_EVIL)
{
dam *= 2;
@@ -4496,7 +4496,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
case GF_HOLY_FIRE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_GOOD)
{
dam = 0;
@@ -4519,14 +4519,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Arrow -- XXX no defense */
case GF_ARROW:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
break;
}
/* Plasma -- XXX perhaps check ELEC or FIRE */
case GF_PLASMA:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_RES_PLAS)
{
note = " resists.";
@@ -4539,7 +4539,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Nether -- see above */
case GF_NETHER:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_UNDEAD)
{
note = " is immune.";
@@ -4562,7 +4562,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Water (acid) damage -- Water spirits/elementals are immune */
case GF_WATER:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if ((r_ptr->d_char == 'E') &&
(starts_with(r_ptr->name, "W") ||
(strstr(r_ptr->name, "Unmaker"))))
@@ -4582,7 +4582,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Wave = Water + Force */
case GF_WAVE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if ((r_ptr->d_char == 'E') &&
(starts_with(r_ptr->name, "W") ||
(strstr(r_ptr->name, "Unmaker"))))
@@ -4675,8 +4675,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Chaos -- Chaos breathers resist */
case GF_CHAOS:
{
- if (seen) obvious = TRUE;
- do_poly = TRUE;
+ if (seen) obvious = true;
+ do_poly = true;
do_conf = (5 + randint(11) + r) / (r + 1);
if ((r_ptr->spells & SF_BR_CHAO) ||
((r_ptr->flags & RF_DEMON) && (randint(3) == 1)))
@@ -4684,7 +4684,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
note = " resists.";
dam *= 3;
dam /= (randint(6) + 6);
- do_poly = FALSE;
+ do_poly = false;
}
break;
}
@@ -4692,7 +4692,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Shards -- Shard breathers resist */
case GF_SHARDS:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (magik(33)) do_cut = (10 + randint(15) + r) / (r + 1);
if (r_ptr->spells & SF_BR_SHAR)
{
@@ -4707,7 +4707,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Rocket: Shard resistance helps */
case GF_ROCKET:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (magik(12)) do_cut = (10 + randint(15) + r) / (r + 1);
if (r_ptr->spells & SF_BR_SHAR)
@@ -4723,7 +4723,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Sound -- Sound breathers resist */
case GF_SOUND:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (who <= 0)
{
if (rand_int(100 - p_ptr->lev) < 50)
@@ -4743,7 +4743,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Confusion */
case GF_CONFUSION:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_conf = (10 + randint(15) + r) / (r + 1);
if (r_ptr->spells & SF_BR_CONF)
{
@@ -4762,7 +4762,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Disenchantment -- Breathers and Disenchanters resist */
case GF_DISENCHANT:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_RES_DISE)
{
note = " resists.";
@@ -4775,7 +4775,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Nexus -- Breathers and Existers resist */
case GF_NEXUS:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_RES_NEXU)
{
note = " resists.";
@@ -4788,7 +4788,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Force */
case GF_FORCE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/*
* If fired by player, try pushing monster.
@@ -4885,7 +4885,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Inertia -- breathers resist */
case GF_INERTIA:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->spells & SF_BR_INER)
{
note = " resists.";
@@ -4897,7 +4897,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Powerful monsters can resist */
if (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
{
- obvious = FALSE;
+ obvious = false;
}
/* Normal monsters slow down */
else
@@ -4912,7 +4912,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Time -- breathers resist */
case GF_TIME:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->spells & SF_BR_TIME)
{
note = " resists.";
@@ -4925,21 +4925,21 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Gravity -- breathers resist */
case GF_GRAVITY:
{
- bool_ resist_tele = FALSE;
+ bool resist_tele = false;
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_RES_TELE)
{
if (r_ptr->flags & RF_UNIQUE)
{
note = " is unaffected!";
- resist_tele = TRUE;
+ resist_tele = true;
}
else if (m_ptr->level > randint(100))
{
note = " resists!";
- resist_tele = TRUE;
+ resist_tele = true;
}
}
@@ -4960,7 +4960,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if ((r_ptr->flags & RF_UNIQUE) ||
(m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
{
- obvious = FALSE;
+ obvious = false;
}
/* Normal monsters slow down */
else
@@ -4980,7 +4980,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
do_stun = 0;
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
}
break;
@@ -4989,7 +4989,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Pure damage */
case GF_MANA:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
break;
}
@@ -4997,7 +4997,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Pure damage */
case GF_DISINTEGRATE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_HURT_ROCK)
{
note = " loses some skin!";
@@ -5030,7 +5030,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
case GF_PSI:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_EMPTY_MIND)
{
dam = 0;
@@ -5118,7 +5118,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
case GF_PSI_DRAIN:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->flags & RF_EMPTY_MIND)
{
dam = 0;
@@ -5176,7 +5176,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
case GF_TELEKINESIS:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_dist = 7;
/* 1. stun */
do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
@@ -5188,7 +5188,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
do_stun = 0;
/* No obvious effect */
- obvious = FALSE;
+ obvious = false;
}
break;
}
@@ -5196,14 +5196,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Meteor -- powerful magic missile */
case GF_METEOR:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
break;
}
case GF_DOMINATION:
{
if (is_friend(m_ptr) > 0) break;
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -5255,7 +5255,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
}
else
@@ -5293,7 +5293,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Ice -- Cold + Cuts + Stun */
case GF_ICE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_stun = (randint(15) + 1) / (r + 1);
if (magik(33)) do_cut = (10 + randint(15) + r) / (r + 1);
if (r_ptr->flags & RF_SUSCEP_COLD)
@@ -5315,7 +5315,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Drain Life */
case GF_OLD_DRAIN:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if ((r_ptr->flags & RF_UNDEAD) ||
(r_ptr->flags & RF_DEMON) ||
@@ -5323,7 +5323,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
(strchr("Egv", r_ptr->d_char)))
{
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
dam = 0;
}
@@ -5333,12 +5333,12 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Death Ray */
case GF_DEATH_RAY:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if ((r_ptr->flags & RF_UNDEAD) ||
(r_ptr->flags & RF_NONLIVING))
{
note = " is immune.";
- obvious = FALSE;
+ obvious = false;
dam = 0;
}
else if (((r_ptr->flags & RF_UNIQUE) &&
@@ -5347,7 +5347,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
randint(100) != 66 ))
{
note = " resists!";
- obvious = FALSE;
+ obvious = false;
dam = 0;
}
@@ -5359,10 +5359,10 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Polymorph monster (Use "dam" as "power") */
case GF_OLD_POLY:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt to polymorph (see below) */
- do_poly = TRUE;
+ do_poly = true;
/* Powerful monsters can resist */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -5370,8 +5370,8 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
(m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
{
note = " is unaffected!";
- do_poly = FALSE;
- obvious = FALSE;
+ do_poly = false;
+ obvious = false;
}
/* No "real" damage */
@@ -5384,11 +5384,11 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Clone monsters (Ignore "dam") */
case GF_OLD_CLONE:
{
- bool_ is_frien = FALSE;
+ bool is_frien = false;
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if ((is_friend(m_ptr) > 0) && (randint(3) != 1))
- is_frien = TRUE;
+ is_frien = true;
/* Heal fully */
m_ptr->hp = m_ptr->maxhp;
@@ -5397,7 +5397,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (m_ptr->mspeed < 150) m_ptr->mspeed += 10;
/* Attempt to clone. */
- if (multiply_monster(c_ptr->m_idx, is_frien, TRUE))
+ if (multiply_monster(c_ptr->m_idx, is_frien, true))
{
note = " spawns!";
}
@@ -5412,7 +5412,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Heal Monster (use "dam" as amount of healing) */
case GF_OLD_HEAL:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Wake up */
m_ptr->csleep = 0;
@@ -5438,7 +5438,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Speed Monster (Ignore "dam") */
case GF_OLD_SPEED:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Speed up */
if (m_ptr->mspeed < m_ptr->speed + 15) m_ptr->mspeed += 10;
@@ -5453,14 +5453,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Slow Monster (Use "dam" as "power") */
case GF_OLD_SLOW:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Powerful monsters can resist */
if ((r_ptr->flags & RF_UNIQUE) ||
(m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
{
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
/* Normal monsters slow down */
@@ -5479,7 +5479,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Sleep (Use "dam" as "power") */
case GF_OLD_SLEEP:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_NO_SLEEP) ||
@@ -5487,7 +5487,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else
{
@@ -5505,14 +5505,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Sleep (Use "dam" as "power") */
case GF_STASIS:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_UNIQUE) ||
(m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
{
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else
{
@@ -5531,7 +5531,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((m_ptr->mflag & MFLAG_QUEST) ||
@@ -5541,7 +5541,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else if (p_ptr->aggravate)
{
@@ -5568,7 +5568,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((m_ptr->mflag & MFLAG_QUEST) ||
@@ -5578,7 +5578,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else if (p_ptr->aggravate)
{
@@ -5605,7 +5605,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Control undead */
case GF_CONTROL_UNDEAD:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -5616,7 +5616,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else if (p_ptr->aggravate)
{
@@ -5636,7 +5636,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Control never-moving */
case GF_CHARM_UNMOVING:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -5647,7 +5647,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else if (p_ptr->aggravate)
{
@@ -5667,7 +5667,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Tame animal */
case GF_CONTROL_ANIMAL:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -5679,7 +5679,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else if (p_ptr->aggravate)
{
@@ -5700,7 +5700,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Control demon */
case GF_CONTROL_DEMON:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Attempt a saving throw */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -5711,7 +5711,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Resist */
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
else if (p_ptr->aggravate)
{
@@ -5731,7 +5731,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Confusion (Use "dam" as "power") */
case GF_OLD_CONF:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Get confused later */
do_conf = damroll(3, (dam / 2)) + 1;
@@ -5745,7 +5745,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
/* No "real" damage */
@@ -5755,7 +5755,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
case GF_STUN:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
@@ -5767,7 +5767,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
/* No "real" damage */
@@ -5778,7 +5778,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Confusion (Use "dam" as "power") */
case GF_CONF_DAM:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Get confused later */
do_conf = damroll(3, (dam / 2)) + 1;
@@ -5792,14 +5792,14 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
break;
}
case GF_STUN_DAM:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
@@ -5811,7 +5811,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
break;
}
@@ -5819,7 +5819,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Implosion is the same than Stun_dam but only affect the living */
case GF_IMPLOSION:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
@@ -5832,7 +5832,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
/* Non_living resists */
@@ -5844,7 +5844,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
break;
}
@@ -5852,7 +5852,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Confusion & Stunning (Use "dam" as "power") */
case GF_STUN_CONF:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Get confused later */
do_conf = damroll(3, (dam / 2)) + 1;
@@ -5866,7 +5866,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
@@ -5879,7 +5879,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
}
break;
}
@@ -5892,7 +5892,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_HURT_LITE)
{
/* Obvious effect */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Special effect */
note = " cringes from the light!";
@@ -5914,7 +5914,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Lite -- opposite of Dark */
case GF_LITE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
if (r_ptr->spells & SF_BR_LITE)
{
note = " resists.";
@@ -5934,7 +5934,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Dark -- opposite of Lite */
case GF_DARK:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Likes darkness... */
if ((r_ptr->spells & SF_BR_DARK) ||
@@ -5956,7 +5956,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_HURT_ROCK)
{
/* Notice effect */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Cute little message */
note = " loses some skin!";
@@ -5982,25 +5982,25 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Only affect undead */
if (r_ptr->flags & RF_UNDEAD)
{
- bool_ resists_tele = FALSE;
+ bool resists_tele = false;
if (r_ptr->flags & RF_RES_TELE)
{
if (r_ptr->flags & RF_UNIQUE)
{
note = " is unaffected!";
- resists_tele = TRUE;
+ resists_tele = true;
}
else if (m_ptr->level > randint(100))
{
note = " resists!";
- resists_tele = TRUE;
+ resists_tele = true;
}
}
if (!resists_tele)
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_dist = dam;
}
}
@@ -6009,7 +6009,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
}
/* No "real" damage */
@@ -6025,25 +6025,25 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Only affect evil */
if (r_ptr->flags & RF_EVIL)
{
- bool_ resists_tele = FALSE;
+ bool resists_tele = false;
if (r_ptr->flags & RF_RES_TELE)
{
if (r_ptr->flags & RF_UNIQUE)
{
note = " is unaffected!";
- resists_tele = TRUE;
+ resists_tele = true;
}
else if (m_ptr->level > randint(100))
{
note = " resists!";
- resists_tele = TRUE;
+ resists_tele = true;
}
}
if (!resists_tele)
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
do_dist = dam;
}
}
@@ -6052,7 +6052,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
}
/* No "real" damage */
@@ -6064,7 +6064,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Teleport monster (Use "dam" as "power") */
case GF_AWAY_ALL:
{
- bool_ resists_tele = FALSE;
+ bool resists_tele = false;
if (dungeon_flags & DF_NO_TELEPORT) break; /* No teleport on special levels */
if (r_ptr->flags & RF_RES_TELE)
@@ -6072,19 +6072,19 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_UNIQUE)
{
note = " is unaffected!";
- resists_tele = TRUE;
+ resists_tele = true;
}
else if (m_ptr->level > randint(100))
{
note = " resists!";
- resists_tele = TRUE;
+ resists_tele = true;
}
}
if (!resists_tele)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Prepare to teleport */
do_dist = dam;
@@ -6103,7 +6103,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_UNDEAD)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Apply some fear */
do_fear = damroll(3, (dam / 2)) + 1;
@@ -6113,7 +6113,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
do_fear = 0;
}
}
@@ -6122,7 +6122,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
}
/* No "real" damage */
@@ -6138,7 +6138,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_EVIL)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Apply some fear */
do_fear = damroll(3, (dam / 2)) + 1;
@@ -6148,7 +6148,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
do_fear = 0;
}
}
@@ -6157,7 +6157,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
}
/* No "real" damage */
@@ -6170,7 +6170,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
case GF_TURN_ALL:
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Apply some fear */
do_fear = damroll(3, (dam / 2)) + 1;
@@ -6182,7 +6182,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
do_fear = 0;
}
@@ -6199,7 +6199,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_UNDEAD)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " shudders.";
@@ -6210,7 +6210,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
/* No damage */
dam = 0;
@@ -6227,7 +6227,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_EVIL)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " shudders.";
@@ -6238,7 +6238,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
/* No damage */
dam = 0;
@@ -6254,7 +6254,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_GOOD)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " shudders.";
@@ -6265,7 +6265,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
/* No damage */
dam = 0;
@@ -6282,7 +6282,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
!(r_ptr->flags & RF_NONLIVING))
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " shudders.";
@@ -6293,7 +6293,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
/* No damage */
dam = 0;
@@ -6309,7 +6309,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (r_ptr->flags & RF_DEMON)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " shudders.";
@@ -6320,7 +6320,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else
{
/* Irrelevant */
- skipped = TRUE;
+ skipped = true;
/* No damage */
dam = 0;
@@ -6333,7 +6333,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
case GF_DISP_ALL:
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " shudders.";
@@ -6345,7 +6345,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Raise Death -- Heal monster */
case GF_RAISE:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Wake up */
m_ptr->csleep = 0;
@@ -6370,7 +6370,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* Trap the soul of a demon and leave body */
case GF_TRAP_DEMONSOUL:
{
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Check race */
if ((r_ptr->flags & RF_UNIQUE) ||
@@ -6379,7 +6379,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
{
/* No obvious effect */
note = " is unaffected!";
- obvious = FALSE;
+ obvious = false;
dam = 0;
}
/* Hack : drop corpse if the demon is killed by this
@@ -6427,30 +6427,30 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
note_dies = " is sucked out of life.";
} else {
/* No effect */
- skipped = TRUE;
+ skipped = true;
}
break;
}
default:
- skipped = TRUE;
+ skipped = true;
break;
}
/* Absolutely no effect */
- if (skipped) return (FALSE);
+ if (skipped) return false;
/* "Unique" monsters cannot be polymorphed */
- if (r_ptr->flags & RF_UNIQUE) do_poly = FALSE;
+ if (r_ptr->flags & RF_UNIQUE) do_poly = false;
/*
* "Quest" monsters cannot be polymorphed
*/
if (m_ptr->mflag & MFLAG_QUEST)
- do_poly = FALSE;
+ do_poly = false;
/* "Unique" monsters can only be "killed" by the player unless they are player's friends */
if ((r_ptr->flags & RF_UNIQUE) && (m_ptr->status <= MSTATUS_NEUTRAL_P))
@@ -6498,7 +6498,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
if (do_poly_monster(y, x))
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Monster polymorphs */
note = " changes!";
@@ -6525,7 +6525,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
int back = 0;
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
back = 0; /* Default of no movement */
@@ -6589,7 +6589,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
else if (do_dist)
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Message */
note = " disappears!";
@@ -6611,7 +6611,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
!(r_ptr->spells & SF_BR_WALL) && hurt_monster(m_ptr))
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Get confused */
if (m_ptr->stunned)
@@ -6636,7 +6636,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
!(r_ptr->spells & SF_BR_CHAO) && hurt_monster(m_ptr))
{
/* Obvious */
- if (seen) obvious = TRUE;
+ if (seen) obvious = true;
/* Already partially confused */
if (m_ptr->confused)
@@ -6723,7 +6723,7 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
/* XXX XXX XXX Verify this code */
/* Update the monster */
- update_mon(c_ptr->m_idx, FALSE);
+ update_mon(c_ptr->m_idx, false);
/* Redraw the monster grid */
lite_spot(y, x);
@@ -6764,10 +6764,10 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
* if this is actually a ball or a bolt spell
*
*
- * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
+ * We return "true" if any "obvious" effects were observed. XXX XXX Actually,
* we just assume that the effects were obvious, for historical reasons.
*/
-static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad)
+static bool project_p(int who, int r, int y, int x, int dam, int typ, int a_rad)
{
auto const &d_info = game->edit_data.d_info;
auto const &r_info = game->edit_data.r_info;
@@ -6777,19 +6777,19 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
int k = 0, do_move = 0, a = 0, b = 0, x1 = 0, y1 = 0;
/* Player blind-ness */
- bool_ blind = (p_ptr->blind ? TRUE : FALSE);
+ bool blind = (p_ptr->blind ? true : false);
/* Player needs a "description" (he is blind) */
- bool_ fuzzy = FALSE;
+ bool fuzzy = false;
/* Monster name (for damage) */
std::string killer;
/* Player is not here */
- if ((x != p_ptr->px) || (y != p_ptr->py)) return (FALSE);
+ if ((x != p_ptr->px) || (y != p_ptr->py)) return false;
/* Player cannot hurt himself */
- if (!who) return (FALSE);
+ if (!who) return false;
/* Bolt attack from a monster */
if ((!a_rad) && get_skill(SKILL_DODGE) && (who > 0))
@@ -6799,7 +6799,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
if ((chance > 0) && magik(chance))
{
msg_print("You dodge a magical attack!");
- return (TRUE);
+ return true;
}
}
@@ -6831,7 +6831,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP | PROJECT_KILL));
disturb();
- return TRUE;
+ return true;
}
/* XXX XXX XXX */
@@ -6843,7 +6843,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
/* If the player is blind, be more descriptive */
- if (blind) fuzzy = TRUE;
+ if (blind) fuzzy = true;
/* Did ``God'' do it? */
if (who == -99)
@@ -7732,7 +7732,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
/* Return "Anything seen?" */
- return TRUE;
+ return true;
}
@@ -7750,7 +7750,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
* flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
*
* Return:
- * TRUE if any "effects" of the projection were observed, else FALSE
+ * true if any "effects" of the projection were observed, else false
*
* Allows a monster (or player) to project a beam/bolt/ball of a given kind
* towards a given location (optionally passing over the heads of interposing
@@ -7880,7 +7880,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
* in the blast radius, in case the "illumination" of the grid was changed,
* and "update_view()" and "update_monsters()" need to be called.
*/
-bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
+bool project(int who, int rad, int y, int x, int dam, int typ, int flg)
{
int t, dist;
@@ -7894,16 +7894,16 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
auto const msec = options->delay_factor_ms();
/* Assume the player sees nothing */
- bool_ notice = FALSE;
+ bool notice = false;
/* Assume the player has seen nothing */
- bool_ visual = FALSE;
+ bool visual = false;
/* Assume the player has seen no blast grids */
- bool_ drawn = FALSE;
+ bool drawn = false;
/* Is the player blind? */
- bool_ blind = (p_ptr->blind ? TRUE : FALSE);
+ bool blind = (p_ptr->blind ? true : false);
/* Actual grids in the "path" */
std::vector<std::tuple<int, int>> path_g;
@@ -8070,7 +8070,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
}
/* Hack -- Activate delay */
- visual = TRUE;
+ visual = true;
}
/* Hack -- delay anyway for consistency */
@@ -8096,7 +8096,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
dist_hack = dist;
/* Explode */
- if (TRUE)
+ if (true)
{
/* Hack -- remove final beam grid */
if (flg & (PROJECT_BEAM))
@@ -8148,7 +8148,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
/* Speed -- ignore "non-explosions" */
- if (!grids) return (FALSE);
+ if (!grids) return false;
/* Display the "blast area" if requested */
@@ -8172,7 +8172,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
byte a;
char c;
- drawn = TRUE;
+ drawn = true;
/* Obtain the explosion pict */
p = bolt_pict(y, x, y, x, typ);
@@ -8253,7 +8253,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
x = gx[i];
/* Affect the feature in that grid */
- if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
+ if (project_f(who, dist, y, x, dam, typ)) notice = true;
/* Effect ? */
if (flg & PROJECT_STAY)
@@ -8286,7 +8286,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
x = gx[i];
/* Affect the object in the grid */
- if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
+ if (project_o(who, dist, y, x, dam, typ)) notice = true;
}
}
@@ -8315,7 +8315,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
if (grids > 1)
{
/* Affect the monster in the grid */
- if (project_m(who, dist, y, x, dam, typ)) notice = TRUE;
+ if (project_m(who, dist, y, x, dam, typ)) notice = true;
}
else
{
@@ -8353,7 +8353,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
}
else
{
- if (project_m(who, dist, y, x, dam, typ)) notice = TRUE;
+ if (project_m(who, dist, y, x, dam, typ)) notice = true;
}
}
}
@@ -8397,7 +8397,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
x = gx[i];
/* Affect the player */
- if (project_p(who, dist, y, x, dam, typ, rad)) notice = TRUE;
+ if (project_p(who, dist, y, x, dam, typ, rad)) notice = true;
}
}
@@ -8425,13 +8425,13 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
* the potion was in her inventory);
* o_ptr --- pointer to the potion object.
*/
-bool_ potion_smash_effect(int who, int y, int x, int o_sval)
+bool potion_smash_effect(int who, int y, int x, int o_sval)
{
int radius = 2;
int dt = 0;
int dam = 0;
- bool_ ident = FALSE;
- bool_ angry = FALSE;
+ bool ident = false;
+ bool angry = false;
switch (o_sval)
{
@@ -8446,7 +8446,7 @@ bool_ potion_smash_effect(int who, int y, int x, int o_sval)
case SV_POTION_DEC_CHR:
case SV_POTION_WATER: /* perhaps a 'water' attack? */
case SV_POTION_APPLE_JUICE:
- return TRUE;
+ return true;
case SV_POTION_INFRAVISION:
case SV_POTION_DETECT_INVIS:
@@ -8478,85 +8478,85 @@ bool_ potion_smash_effect(int who, int y, int x, int o_sval)
case SV_POTION_INVULNERABILITY:
case SV_POTION_NEW_LIFE:
/* All of the above potions have no effect when shattered */
- return FALSE;
+ return false;
case SV_POTION_SLOWNESS:
dt = GF_OLD_SLOW;
dam = 5;
- ident = TRUE;
- angry = TRUE;
+ ident = true;
+ angry = true;
break;
case SV_POTION_POISON:
dt = GF_POIS;
dam = 3;
- ident = TRUE;
- angry = TRUE;
+ ident = true;
+ angry = true;
break;
case SV_POTION_BLINDNESS:
dt = GF_DARK;
- ident = TRUE;
- angry = TRUE;
+ ident = true;
+ angry = true;
break;
case SV_POTION_CONFUSION: /* Booze */
dt = GF_OLD_CONF;
- ident = TRUE;
- angry = TRUE;
+ ident = true;
+ angry = true;
break;
case SV_POTION_SLEEP:
dt = GF_OLD_SLEEP;
- angry = TRUE;
- ident = TRUE;
+ angry = true;
+ ident = true;
break;
case SV_POTION_RUINATION:
case SV_POTION_DETONATIONS:
dt = GF_SHARDS;
dam = damroll(25, 25);
- angry = TRUE;
- ident = TRUE;
+ angry = true;
+ ident = true;
break;
case SV_POTION_DEATH:
dt = GF_MANA; /* !! */
dam = damroll(10, 10);
- angry = TRUE;
+ angry = true;
radius = 1;
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_SPEED:
dt = GF_OLD_SPEED;
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_CURE_LIGHT:
dt = GF_OLD_HEAL;
dam = damroll(2, 3);
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_CURE_SERIOUS:
dt = GF_OLD_HEAL;
dam = damroll(4, 3);
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_CURE_CRITICAL:
case SV_POTION_CURING:
dt = GF_OLD_HEAL;
dam = damroll(6, 3);
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_HEALING:
dt = GF_OLD_HEAL;
dam = damroll(10, 10);
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_STAR_HEALING:
case SV_POTION_LIFE:
dt = GF_OLD_HEAL;
dam = damroll(50, 50);
radius = 1;
- ident = TRUE;
+ ident = true;
break;
case SV_POTION_RESTORE_MANA: /* MANA */
dt = GF_MANA;
dam = damroll(10, 10);
radius = 1;
- ident = TRUE;
+ ident = true;
break;
default:
/* Do nothing */
@@ -8910,7 +8910,7 @@ s16b do_poly_monster(int y, int x)
* Handle polymorph --
* Create a new monster (no groups)
*/
- if (place_monster_aux(y, x, new_r_idx, FALSE, FALSE, m_ptr->status))
+ if (place_monster_aux(y, x, new_r_idx, false, false, m_ptr->status))
{
/* Get a "new" monster */
new_m_idx = c_ptr->m_idx;
diff --git a/src/spells1.hpp b/src/spells1.hpp
index a9c1c917..3a196fd6 100644
--- a/src/spells1.hpp
+++ b/src/spells1.hpp
@@ -8,7 +8,7 @@
byte spell_color(int type);
s16b poly_r_idx(int r_idx);
void get_pos_player(int dis, int *ny, int *nx);
-extern bool_ teleport_player_bypass;
+extern bool teleport_player_bypass;
void teleport_player_directed(int rad, int dir);
void teleport_away(int m_idx, int dis);
void teleport_player(int dis);
@@ -23,12 +23,12 @@ void acid_dam(int dam, const char *kb_str);
void elec_dam(int dam, const char *kb_str);
void fire_dam(int dam, const char *kb_str);
void cold_dam(int dam, const char *kb_str);
-bool_ dec_stat(int stat, int amount, int mode);
-bool_ res_stat(int stat, bool_ full);
-bool_ apply_disenchant(int mode);
-bool_ project_m(int who, int r, int y, int x, int dam, int typ);
-bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg);
-bool_ potion_smash_effect(int who, int y, int x, int o_sval);
+bool dec_stat(int stat, int amount, int mode);
+bool res_stat(int stat, bool full);
+bool apply_disenchant(int mode);
+bool project_m(int who, int r, int y, int x, int dam, int typ);
+bool project(int who, int rad, int y, int x, int dam, int typ, int flg);
+bool potion_smash_effect(int who, int y, int x, int o_sval);
void do_poly_self();
void corrupt_player();
std::string name_spell(random_spell const *);
diff --git a/src/spells2.cc b/src/spells2.cc
index 18f11758..316f0f39 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -144,7 +144,7 @@ void grow_grass(int rad)
*/
void hp_player(int num)
{
- bool_ dead = p_ptr->chp < 0;
+ bool dead = p_ptr->chp < 0;
/* Healing needed */
if (p_ptr->chp < p_ptr->mhp)
@@ -319,7 +319,7 @@ void do_dec_stat(int stat, int mode)
/*
* Restore lost "points" in a stat
*/
-bool_ do_res_stat(int stat, bool_ full)
+bool do_res_stat(int stat, bool full)
{
/* Keep a copy of the current stat, so we can evaluate it if necessary */
int cur_stat = p_ptr->stat_cur[stat];
@@ -338,11 +338,11 @@ bool_ do_res_stat(int stat, bool_ full)
}
/* Notice */
- return (TRUE);
+ return true;
}
/* Nothing obvious */
- return (FALSE);
+ return false;
}
@@ -352,7 +352,7 @@ bool_ do_res_stat(int stat, bool_ full)
* Note that this function (used by stat potions) now restores
* the stat BEFORE increasing it.
*/
-static bool_ inc_stat(int stat)
+static bool inc_stat(int stat)
{
int value, gain;
@@ -404,23 +404,23 @@ static bool_ inc_stat(int stat)
p_ptr->update |= (PU_BONUS);
/* Success */
- return (TRUE);
+ return true;
}
/* Nothing to gain */
- return (FALSE);
+ return false;
}
/*
* Gain a "point" in a stat
*/
-bool_ do_inc_stat(int stat)
+bool do_inc_stat(int stat)
{
- bool_ res;
+ bool res;
/* Restore strength */
- res = res_stat(stat, TRUE);
+ res = res_stat(stat, true);
/* Attempt to increase */
if (inc_stat(stat))
@@ -429,7 +429,7 @@ bool_ do_inc_stat(int stat)
msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
/* Notice */
- return (TRUE);
+ return true;
}
/* Restoration worked */
@@ -439,11 +439,11 @@ bool_ do_inc_stat(int stat)
msg_format("You feel less %s.", desc_stat_neg[stat]);
/* Notice */
- return (TRUE);
+ return true;
}
/* Nothing obvious */
- return (FALSE);
+ return false;
}
@@ -462,7 +462,7 @@ void identify_hooks(object_type *o_ptr)
* Identify everything being carried.
* Done by a potion of "self knowledge".
*/
-bool_ identify_pack()
+bool identify_pack()
{
/* Simply identify and know every item */
for (int i = 0; i < INVEN_TOTAL; i++)
@@ -482,7 +482,7 @@ bool_ identify_pack()
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
- return TRUE;
+ return true;
}
/*
@@ -525,22 +525,22 @@ static int enchant_table[16] =
1000
};
-static bool_ remove_curse_object(object_type *o_ptr, bool_ all)
+static bool remove_curse_object(object_type *o_ptr, bool all)
{
/* Skip non-objects */
- if (!o_ptr->k_ptr) return FALSE;
+ if (!o_ptr->k_ptr) return false;
/* Uncursed already */
- if (!cursed_p(o_ptr)) return FALSE;
+ if (!cursed_p(o_ptr)) return false;
/* Extract the flags */
auto const flags = object_flags(o_ptr);
/* Heavily Cursed Items need a special spell */
- if (!all && (flags & TR_HEAVY_CURSE)) return FALSE;
+ if (!all && (flags & TR_HEAVY_CURSE)) return false;
/* Perma-Cursed Items can NEVER be uncursed */
- if (flags & TR_PERMA_CURSE) return FALSE;
+ if (flags & TR_PERMA_CURSE) return false;
/* Strip curse flags */
o_ptr->art_flags &= ~TR_CURSED;
@@ -568,7 +568,7 @@ static bool_ remove_curse_object(object_type *o_ptr, bool_ all)
/* Window stuff */
p_ptr->window |= (PW_EQUIP);
- return TRUE;
+ return true;
}
/*
@@ -577,7 +577,7 @@ static bool_ remove_curse_object(object_type *o_ptr, bool_ all)
* Note that Items which are "Perma-Cursed" (The One Ring,
* The Crown of Morgoth) can NEVER be uncursed.
*
- * Note that if "all" is FALSE, then Items which are
+ * Note that if "all" is false, then Items which are
* "Heavy-Cursed" (Mormegil, Calris, and Weapons of Morgul)
* will not be uncursed.
*/
@@ -604,17 +604,17 @@ static int remove_curse_aux(int all)
/*
* Remove most curses
*/
-bool_ remove_curse()
+bool remove_curse()
{
- return (remove_curse_aux(FALSE) ? TRUE : FALSE);
+ return (remove_curse_aux(false) ? true : false);
}
/*
* Remove all curses
*/
-bool_ remove_all_curse()
+bool remove_all_curse()
{
- return (remove_curse_aux(TRUE) ? TRUE : FALSE);
+ return (remove_curse_aux(true) ? true : false);
}
@@ -622,7 +622,7 @@ bool_ remove_all_curse()
/*
* Restores any drained experience
*/
-bool_ restore_level()
+bool restore_level()
{
/* Restore experience */
if (p_ptr->exp < p_ptr->max_exp)
@@ -637,11 +637,11 @@ bool_ restore_level()
check_experience();
/* Did something */
- return (TRUE);
+ return true;
}
/* No effect */
- return (FALSE);
+ return false;
}
@@ -650,12 +650,12 @@ void alchemy()
int item, amt = 1;
int old_number;
long price;
- bool_ force = FALSE;
+ bool force = false;
char o_name[80];
char out_val[160];
/* Hack -- force destruction */
- if (command_arg > 0) force = TRUE;
+ if (command_arg > 0) force = true;
/* Get an item */
if (!get_item(&item,
@@ -687,7 +687,7 @@ void alchemy()
/* Describe the object */
old_number = o_ptr->number;
o_ptr->number = amt;
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
o_ptr->number = old_number;
/* Verify unless quantity given */
@@ -929,7 +929,7 @@ void report_magics()
/*
* Forget everything
*/
-bool_ lose_all_info()
+bool lose_all_info()
{
/* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
@@ -944,18 +944,18 @@ bool_ lose_all_info()
wiz_dark();
/* It worked */
- return (TRUE);
+ return true;
}
/*
* Detect all doors on current panel
*/
-bool_ detect_doors(int rad)
+bool detect_doors(int rad)
{
int y, x;
- bool_ detect = FALSE;
+ bool detect = false;
cave_type *c_ptr;
@@ -997,7 +997,7 @@ bool_ detect_doors(int rad)
lite_spot(y, x);
/* Obvious */
- detect = TRUE;
+ detect = true;
}
}
}
@@ -1016,11 +1016,11 @@ bool_ detect_doors(int rad)
/*
* Detect all stairs on current panel
*/
-bool_ detect_stairs(int rad)
+bool detect_stairs(int rad)
{
int y, x;
- bool_ detect = FALSE;
+ bool detect = false;
cave_type *c_ptr;
@@ -1051,7 +1051,7 @@ bool_ detect_stairs(int rad)
lite_spot(y, x);
/* Obvious */
- detect = TRUE;
+ detect = true;
}
}
}
@@ -1070,11 +1070,11 @@ bool_ detect_stairs(int rad)
/*
* Detect any treasure on the current panel
*/
-bool_ detect_treasure(int rad)
+bool detect_treasure(int rad)
{
int y, x;
- bool_ detect = FALSE;
+ bool detect = false;
cave_type *c_ptr;
@@ -1115,7 +1115,7 @@ bool_ detect_treasure(int rad)
lite_spot(y, x);
/* Detect */
- detect = TRUE;
+ detect = true;
}
}
}
@@ -1166,19 +1166,19 @@ template<typename P> static bool detect_monsters_fn(int radius, P p) {
if (p(r_ptr.get()))
{
/* Repair visibility later */
- repair_monsters = TRUE;
+ repair_monsters = true;
/* Hack -- Detect monster */
m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
/* Hack -- See monster */
- m_ptr->ml = TRUE;
+ m_ptr->ml = true;
/* Redraw */
if (panel_contains(y, x)) lite_spot(y, x);
/* Detect */
- flag = TRUE;
+ flag = true;
}
}
/* Result */
@@ -1188,7 +1188,7 @@ template<typename P> static bool detect_monsters_fn(int radius, P p) {
/*
* Detect all (string) monsters on current panel
*/
-static bool_ detect_monsters_string(const char *chars, int rad)
+static bool detect_monsters_string(const char *chars, int rad)
{
auto predicate = [chars](monster_race *r_ptr) -> bool {
return strchr(chars, r_ptr->d_char);
@@ -1199,11 +1199,11 @@ static bool_ detect_monsters_string(const char *chars, int rad)
{
/* Describe result */
msg_print("You sense the presence of monsters!");
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
@@ -1261,13 +1261,13 @@ template <typename P> bool detect_objects_fn(int radius, const char *object_mess
if (p(o_ptr))
{
/* Hack -- memorize it */
- o_ptr->marked = TRUE;
+ o_ptr->marked = true;
/* Redraw */
if (panel_contains(y, x)) lite_spot(y, x);
/* Detect */
- detect = TRUE;
+ detect = true;
}
}
@@ -1326,7 +1326,7 @@ bool detect_objects_normal(int rad)
/*
* Detect all "normal" monsters on the current panel
*/
-bool_ detect_monsters_normal(int rad)
+bool detect_monsters_normal(int rad)
{
auto predicate = [](monster_race *r_ptr) -> bool {
return (!(r_ptr->flags & RF_INVISIBLE)) ||
@@ -1337,11 +1337,11 @@ bool_ detect_monsters_normal(int rad)
{
/* Describe result */
msg_print("You sense the presence of monsters!");
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
@@ -1349,7 +1349,7 @@ bool_ detect_monsters_normal(int rad)
/*
* Detect all "invisible" monsters on current panel
*/
-bool_ detect_monsters_invis(int rad)
+bool detect_monsters_invis(int rad)
{
auto predicate = [](monster_race *r_ptr) -> bool {
return bool(r_ptr->flags & RF_INVISIBLE);
@@ -1359,11 +1359,11 @@ bool_ detect_monsters_invis(int rad)
{
/* Describe result */
msg_print("You sense the presence of invisible creatures!");
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
@@ -1389,18 +1389,18 @@ void detect_monsters_orcs(int rad)
/*
* Detect everything
*/
-bool_ detect_all(int rad)
+bool detect_all(int rad)
{
- bool_ detect = FALSE;
+ bool detect = false;
/* Detect everything */
- if (detect_doors(rad)) detect = TRUE;
- if (detect_stairs(rad)) detect = TRUE;
- if (detect_treasure(rad)) detect = TRUE;
- if (detect_objects_gold(rad)) detect = TRUE;
- if (detect_objects_normal(rad)) detect = TRUE;
- if (detect_monsters_invis(rad)) detect = TRUE;
- if (detect_monsters_normal(rad)) detect = TRUE;
+ if (detect_doors(rad)) detect = true;
+ if (detect_stairs(rad)) detect = true;
+ if (detect_treasure(rad)) detect = true;
+ if (detect_objects_gold(rad)) detect = true;
+ if (detect_objects_normal(rad)) detect = true;
+ if (detect_monsters_invis(rad)) detect = true;
+ if (detect_monsters_normal(rad)) detect = true;
/* Result */
return (detect);
@@ -1553,10 +1553,10 @@ object_filter_t const &item_tester_hook_artifactable()
* Note that this function can now be used on "piles" of items, and
* the larger the pile, the lower the chance of success.
*/
-bool_ enchant(object_type *o_ptr, int n, int eflag)
+bool enchant(object_type *o_ptr, int n, int eflag)
{
int i, chance, prob;
- bool_ res = FALSE;
+ bool res = false;
auto const a = artifact_p(o_ptr);
/* Extract the flags */
@@ -1599,7 +1599,7 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
if ((randint(1000) > chance) && (!a || (rand_int(100) < 50)))
{
o_ptr->to_h++;
- res = TRUE;
+ res = true;
/* break curse? */
if ((o_ptr->to_h >= 0) && (rand_int(100) < 25))
@@ -1619,7 +1619,7 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
if ((randint(1000) > chance) && (!a || (rand_int(100) < 50)))
{
o_ptr->to_d++;
- res = TRUE;
+ res = true;
/* break curse? */
if ((o_ptr->to_d >= 0) && (rand_int(100) < 25))
@@ -1640,7 +1640,7 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
if ((randint(1000) > chance) && (!a || (rand_int(100) < 50)))
{
o_ptr->pval++;
- res = TRUE;
+ res = true;
/* break curse? */
if ((o_ptr->pval >= 0) && (rand_int(100) < 25))
@@ -1660,7 +1660,7 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
if ((randint(1000) > chance) && (!a || (rand_int(100) < 50)))
{
o_ptr->to_a++;
- res = TRUE;
+ res = true;
/* break curse? */
if ((o_ptr->to_a >= 0) && (rand_int(100) < 25))
@@ -1672,7 +1672,7 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
}
/* Failure */
- if (!res) return (FALSE);
+ if (!res) return false;
/* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
@@ -1684,7 +1684,7 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
/* Success */
- return (TRUE);
+ return true;
}
@@ -1692,12 +1692,12 @@ bool_ enchant(object_type *o_ptr, int n, int eflag)
/*
* Enchant an item (in the inventory or on the floor)
* Note that "num_ac" requires armour, else weapon
- * Returns TRUE if attempted, FALSE if cancelled
+ * Returns true if attempted, false if cancelled
*/
-bool_ enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval)
+bool enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval)
{
int item;
- bool_ okay = FALSE;
+ bool okay = false;
char o_name[80];
const char *q;
const char *s;
@@ -1715,13 +1715,13 @@ bool_ enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval)
/* Get an item */
q = "Enchant which item? ";
s = "You have nothing to enchant.";
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR), object_filter)) return (FALSE);
+ if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR), object_filter)) return false;
/* Get the item */
object_type *o_ptr = get_object(item);
/* Description */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/* Describe */
msg_format("%s %s glow%s brightly!",
@@ -1729,10 +1729,10 @@ bool_ enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval)
((o_ptr->number > 1) ? "" : "s"));
/* Enchant */
- if (enchant(o_ptr, num_hit, ENCH_TOHIT)) okay = TRUE;
- if (enchant(o_ptr, num_dam, ENCH_TODAM)) okay = TRUE;
- if (enchant(o_ptr, num_ac, ENCH_TOAC)) okay = TRUE;
- if (enchant(o_ptr, num_pval, ENCH_PVAL)) okay = TRUE;
+ if (enchant(o_ptr, num_hit, ENCH_TOHIT)) okay = true;
+ if (enchant(o_ptr, num_dam, ENCH_TODAM)) okay = true;
+ if (enchant(o_ptr, num_ac, ENCH_TOAC)) okay = true;
+ if (enchant(o_ptr, num_pval, ENCH_PVAL)) okay = true;
/* Failure */
if (!okay)
@@ -1745,7 +1745,7 @@ bool_ enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval)
}
/* Something happened */
- return (TRUE);
+ return true;
}
void curse_artifact(object_type * o_ptr)
@@ -2081,7 +2081,7 @@ static void note_found_object(object_type *o_ptr)
if (artifact_p(o_ptr))
{
- object_desc(item_name, o_ptr, FALSE, 0);
+ object_desc(item_name, o_ptr, false, 0);
/* Build note and write */
sprintf(note, "Found The %s", item_name);
@@ -2095,9 +2095,9 @@ static void note_found_object(object_type *o_ptr)
/*
* Identify an object in the inventory (or on the floor)
* This routine does *not* automatically combine objects.
- * Returns TRUE if something was identified, else FALSE.
+ * Returns true if something was identified, else false.
*/
-bool_ ident_spell()
+bool ident_spell()
{
/* Get an item */
int item;
@@ -2105,7 +2105,7 @@ bool_ ident_spell()
"Identify which item? ",
"You have nothing to identify.",
(USE_EQUIP | USE_INVEN | USE_FLOOR),
- object_filter::Not(object_known_p))) return (FALSE);
+ object_filter::Not(object_known_p))) return false;
/* Get the item */
object_type *o_ptr = get_object(item);
@@ -2125,7 +2125,7 @@ bool_ ident_spell()
/* Description */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Describe */
if (item >= INVEN_WIELD)
@@ -2148,13 +2148,13 @@ bool_ ident_spell()
note_found_object(o_ptr);
/* Something happened */
- return (TRUE);
+ return true;
}
/*
* Identify all objects in the level
*/
-bool_ ident_all()
+bool ident_all()
{
int i;
@@ -2174,7 +2174,7 @@ bool_ ident_all()
}
/* Something happened */
- return (TRUE);
+ return true;
}
@@ -2218,11 +2218,11 @@ object_filter_t const &item_tester_hook_recharge()
*
* XXX XXX XXX Beware of "sliding index errors".
*/
-bool_ recharge(int power)
+bool recharge(int power)
{
int recharge_strength, recharge_amount;
int lev;
- bool_ fail = FALSE;
+ bool fail = false;
byte fail_type = 1;
char o_name[80];
@@ -2235,7 +2235,7 @@ bool_ recharge(int power)
(USE_INVEN | USE_FLOOR),
item_tester_hook_recharge()))
{
- return (FALSE);
+ return false;
}
/* Get the item */
@@ -2260,7 +2260,7 @@ bool_ recharge(int power)
if ((rand_int(recharge_strength) == 0) && (!(flags & TR_RECHARGE)))
{
/* Activate the failure code. */
- fail = TRUE;
+ fail = true;
}
/* Recharge */
@@ -2298,7 +2298,7 @@ bool_ recharge(int power)
(flags & TR_NO_RECHARGE))
{
/* Activate the failure code. */
- fail = TRUE;
+ fail = true;
}
/* If the spell didn't backfire, recharge the wand or staff. */
@@ -2339,7 +2339,7 @@ bool_ recharge(int power)
/* Artifacts are never destroyed. */
if (artifact_p(o_ptr))
{
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, true, 0);
msg_format("The recharging backfires - %s is completely drained!", o_name);
/* Artifact rods. */
@@ -2353,7 +2353,7 @@ bool_ recharge(int power)
else
{
/* Get the object description */
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, false, 0);
/*** Determine Seriousness of Failure ***/
@@ -2459,7 +2459,7 @@ bool_ recharge(int power)
p_ptr->window |= (PW_INVEN);
/* Something was done */
- return (TRUE);
+ return true;
}
@@ -2469,11 +2469,11 @@ bool_ recharge(int power)
*
* Note that affected monsters are NOT auto-tracked by this usage.
*/
-bool_ project_hack(int typ, int dam)
+bool project_hack(int typ, int dam)
{
int i, x, y;
int flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
- bool_ obvious = FALSE;
+ bool obvious = false;
/* Affect all (nearby) monsters */
@@ -2492,7 +2492,7 @@ bool_ project_hack(int typ, int dam)
if (!player_has_los_bold(y, x)) continue;
/* Jump directly to the target monster */
- if (project(0, 0, y, x, dam, typ, flg)) obvious = TRUE;
+ if (project(0, 0, y, x, dam, typ, flg)) obvious = true;
}
/* Result */
@@ -2537,7 +2537,7 @@ void project_meteor(int radius, int typ, int dam, u32b flg)
/*
* Banish evil monsters
*/
-bool_ banish_evil(int dist)
+bool banish_evil(int dist)
{
return (project_hack(GF_AWAY_EVIL, dist));
}
@@ -2583,8 +2583,8 @@ void dispel_monsters(int dam)
void aggravate_monsters(int who)
{
int i;
- bool_ sleep = FALSE;
- bool_ speed = FALSE;
+ bool sleep = false;
+ bool speed = false;
/* Aggravate everyone nearby */
@@ -2606,7 +2606,7 @@ void aggravate_monsters(int who)
{
/* Wake up */
m_ptr->csleep = 0;
- sleep = TRUE;
+ sleep = true;
}
}
@@ -2620,7 +2620,7 @@ void aggravate_monsters(int who)
{
/* Speed up */
m_ptr->mspeed = r_ptr->speed + 10;
- speed = TRUE;
+ speed = true;
}
/* Pets may get angry (50% chance) */
@@ -2648,7 +2648,7 @@ static bool get_genocide_race(const char *msg, char *typ)
cave_type *c_ptr;
msg_print(msg);
- if (!tgt_pt(&i, &j)) return FALSE;
+ if (!tgt_pt(&i, &j)) return false;
c_ptr = &cave[j][i];
@@ -2708,7 +2708,7 @@ static void genocide_aux(char typ)
}
while (!(in_bounds(wy, wx) && cave_floor_bold(wy, wx)) && --attempts);
- if (place_monster_aux(wy, wx, m_ptr->r_idx, FALSE, TRUE, MSTATUS_ENEMY))
+ if (place_monster_aux(wy, wx, m_ptr->r_idx, false, true, MSTATUS_ENEMY))
{
cmsg_format(TERM_L_BLUE, "The spell seems to produce an ... interesting effect on the %s.", buf);
}
@@ -2829,7 +2829,7 @@ void mass_genocide()
}
while (!(in_bounds(wy, wx) && cave_floor_bold(wy, wx)) && --attempts);
- if (place_monster_aux(wy, wx, m_ptr->r_idx, FALSE, TRUE, MSTATUS_ENEMY))
+ if (place_monster_aux(wy, wx, m_ptr->r_idx, false, true, MSTATUS_ENEMY))
{
cmsg_format(TERM_L_BLUE, "The spell seems to produce an ... interesting effect on the %s.", buf);
}
@@ -2889,7 +2889,7 @@ void destroy_area(int y1, int x1, int r)
cave_type *c_ptr;
- bool_ flag = FALSE;
+ bool flag = false;
if (dungeon_flags & DF_NO_GENO)
@@ -2929,7 +2929,7 @@ void destroy_area(int y1, int x1, int r)
if ((x == p_ptr->px) && (y == p_ptr->py))
{
/* Hurt the player later */
- flag = TRUE;
+ flag = true;
/* Do not hurt this grid */
continue;
@@ -3040,9 +3040,9 @@ void earthquake(int cy, int cx, int r)
int i, t, y, x, yy, xx, dy, dx, oy, ox;
int damage = 0;
int sn = 0, sy = 0, sx = 0;
- bool_ hurt = FALSE;
+ bool hurt = false;
cave_type *c_ptr;
- bool_ map[32][32];
+ bool map[32][32];
if (p_ptr->inside_quest)
{
@@ -3057,7 +3057,7 @@ void earthquake(int cy, int cx, int r)
{
for (x = 0; x < 32; x++)
{
- map[y][x] = FALSE;
+ map[y][x] = false;
}
}
@@ -3092,10 +3092,10 @@ void earthquake(int cy, int cx, int r)
if (rand_int(100) < 85) continue;
/* Damage this grid */
- map[16 + yy - cy][16 + xx - cx] = TRUE;
+ map[16 + yy - cy][16 + xx - cx] = true;
/* Hack -- Take note of player damage */
- if ((yy == p_ptr->py) && (xx == p_ptr->px)) hurt = TRUE;
+ if ((yy == p_ptr->py) && (xx == p_ptr->px)) hurt = true;
}
}
@@ -3201,7 +3201,7 @@ void earthquake(int cy, int cx, int r)
}
/* Important -- no wall on player */
- map[16 + p_ptr->py - cy][16 + p_ptr->px - cx] = FALSE;
+ map[16 + p_ptr->py - cy][16 + p_ptr->px - cx] = false;
/* Semi-wraiths have to be hurt *some*, says DG */
if (race_flags_p(PR_SEMI_WRAITH))
@@ -3323,7 +3323,7 @@ void earthquake(int cy, int cx, int r)
m_ptr->fx = sx;
/* Update the monster (new location) */
- update_mon(m_idx, TRUE);
+ update_mon(m_idx, true);
/* Redraw the old grid */
lite_spot(yy, xx);
@@ -3358,7 +3358,7 @@ void earthquake(int cy, int cx, int r)
/* Destroy location (if valid) */
if (cave_valid_bold(yy, xx))
{
- bool_ floor = cave_floor_bold(yy, xx);
+ bool floor = cave_floor_bold(yy, xx);
/* Delete objects */
delete_object(yy, xx);
@@ -3482,7 +3482,7 @@ static void cave_temp_room_lite()
auto const r_ptr = m_ptr->race();
/* Update the monster */
- update_mon(c_ptr->m_idx, FALSE);
+ update_mon(c_ptr->m_idx, false);
/* Stupid monsters rarely wake up */
if (r_ptr->flags & RF_STUPID) chance = 10;
@@ -3731,7 +3731,7 @@ void unlite_area(int dam, int rad)
* Allow "target" mode to pass over monsters
* Affect grids, objects, and monsters
*/
-bool_ fire_ball(int typ, int dir, int dam, int rad)
+bool fire_ball(int typ, int dir, int dam, int rad)
{
int tx, ty;
@@ -3862,7 +3862,7 @@ void teleport_swap(int dir)
ty = m_ptr->fy;
/* Update the monster (new location) */
- update_mon(cave[ty][tx].m_idx, TRUE);
+ update_mon(cave[ty][tx].m_idx, true);
/* Redraw the old grid */
lite_spot(ty, tx);
@@ -3973,7 +3973,7 @@ void swap_position(int lty, int ltx)
ty = m_ptr->fy;
/* Update the monster (new location) */
- update_mon(cave[ty][tx].m_idx, TRUE);
+ update_mon(cave[ty][tx].m_idx, true);
/* Redraw the old grid */
lite_spot(ty, tx);
@@ -4002,7 +4002,7 @@ void swap_position(int lty, int ltx)
/*
* Hack -- apply a "projection()" in a direction (or at the target)
*/
-bool_ project_hook(int typ, int dir, int dam, int flg)
+bool project_hook(int typ, int dir, int dam, int flg)
{
int tx, ty;
@@ -4073,7 +4073,7 @@ void lite_line(int dir)
}
-bool_ drain_life(int dir, int dam)
+bool drain_life(int dir, int dam)
{
int flg = PROJECT_STOP | PROJECT_KILL;
return (project_hook(GF_OLD_DRAIN, dir, dam, flg));
@@ -4179,7 +4179,7 @@ void call_chaos()
{
int Chaos_type, dummy, dir;
int plev = p_ptr->lev;
- bool_ line_chaos = FALSE;
+ bool line_chaos = false;
int hurt_types[30] =
{
@@ -4194,7 +4194,7 @@ void call_chaos()
};
Chaos_type = hurt_types[randint(30) - 1];
- if (randint(4) == 1) line_chaos = TRUE;
+ if (randint(4) == 1) line_chaos = true;
if (randint(6) == 1)
{
@@ -4298,7 +4298,7 @@ static void activate_hi_summon()
void activate_ty_curse()
{
int i = 0;
- bool_ stop_ty = FALSE;
+ bool stop_ty = false;
do
{
@@ -4335,7 +4335,7 @@ case 13: case 14: case 15: case 19: case 20:
set_paralyzed(randint(3));
else
set_paralyzed(randint(13));
- stop_ty = TRUE;
+ stop_ty = true;
}
if (randint(6) != 1) break;
case 21: case 22: case 23:
@@ -4352,7 +4352,7 @@ case 21: case 22: case 23:
if ((dun_level > 65) && !stop_ty)
{
summon_cyber();
- stop_ty = TRUE;
+ stop_ty = true;
break;
}
default:
@@ -4377,7 +4377,7 @@ case 21: case 22: case 23:
void activate_dg_curse()
{
int i = 0;
- bool_ stop_dg = FALSE;
+ bool stop_dg = false;
do
{
@@ -4427,7 +4427,7 @@ void activate_dg_curse()
set_paralyzed(randint(3));
else
set_paralyzed(randint(13));
- stop_dg = TRUE;
+ stop_dg = true;
}
if (randint(7) != 1) break;
case 19:
@@ -4435,7 +4435,7 @@ void activate_dg_curse()
{
msg_print("Woah! You see 10 little Morgoths dancing before you!");
set_confused(p_ptr->confused + randint(13 * 2));
- if (rand_int(2)) stop_dg = TRUE;
+ if (rand_int(2)) stop_dg = true;
}
if (randint(7) != 1) break;
case 21:
@@ -4464,7 +4464,7 @@ case 27: case 28: case 29:
summon_dragon_riders();
/* This is evil -- DG */
- if (rand_int(2)) stop_dg = TRUE;
+ if (rand_int(2)) stop_dg = true;
break;
}
default:
@@ -4626,7 +4626,7 @@ void heal_insanity(int val)
* Send the player shooting through walls in the given direction until
* they reach a non-wall space, or a monster, or a permanent wall.
*/
-bool_ passwall(int dir, bool_ safe)
+bool passwall(int dir, bool safe)
{
auto const &f_info = game->edit_data.f_info;
auto const &dungeon_flags = game->dungeon_flags;
@@ -4638,16 +4638,16 @@ bool_ passwall(int dir, bool_ safe)
int lx = p_ptr->px;
int ly = p_ptr->py;
cave_type *c_ptr;
- bool_ ok = FALSE;
+ bool ok = false;
- if (p_ptr->wild_mode) return FALSE;
- if (p_ptr->inside_quest) return FALSE;
- if (dungeon_flags & DF_NO_TELEPORT) return FALSE;
+ if (p_ptr->wild_mode) return false;
+ if (p_ptr->inside_quest) return false;
+ if (dungeon_flags & DF_NO_TELEPORT) return false;
/* Must go somewhere */
- if (dir == 5) return FALSE;
+ if (dir == 5) return false;
- while (TRUE)
+ while (true)
{
x += ddx[dir];
y += ddy[dir];
@@ -4659,7 +4659,7 @@ bool_ passwall(int dir, bool_ safe)
/* get the last working position */
x -= ddx[dir];
y -= ddy[dir];
- ok = FALSE;
+ ok = false;
break;
}
@@ -4677,7 +4677,7 @@ bool_ passwall(int dir, bool_ safe)
if (f_info[c_ptr->feat].flags & FF_WALL) continue;
/* So it must be ok */
- ok = TRUE;
+ ok = true;
break;
}
@@ -4719,7 +4719,7 @@ bool_ passwall(int dir, bool_ safe)
/* Handle stuff XXX XXX XXX */
handle_stuff();
- return (TRUE);
+ return true;
}
/*
@@ -4727,7 +4727,7 @@ bool_ passwall(int dir, bool_ safe)
*/
static void print_dungeon_batch(std::vector<int> const &dungeon_idxs,
int start,
- bool_ mode)
+ bool mode)
{
auto const &d_info = game->edit_data.d_info;
@@ -4784,7 +4784,7 @@ static int reset_recall_aux()
char which;
int start = 0;
int ret;
- bool_ mode = FALSE;
+ bool mode = false;
// Dungeons available for recall
std::vector<int> dungeons;
@@ -4814,7 +4814,7 @@ static int reset_recall_aux()
else if (which == '*' || which == '?' || which == ' ')
{
- mode = (mode) ? FALSE : TRUE;
+ mode = (mode) ? false : true;
screen_load_no_flush();
}
@@ -4899,7 +4899,7 @@ static int reset_recall_aux()
return ret;
}
-bool_ reset_recall(bool_ no_trepas_max_depth)
+bool reset_recall(bool no_trepas_max_depth)
{
auto const &d_info = game->edit_data.d_info;
@@ -4908,7 +4908,7 @@ bool_ reset_recall(bool_ no_trepas_max_depth)
/* Choose dungeon */
dun = reset_recall_aux();
- if (dun < 1) return FALSE;
+ if (dun < 1) return false;
/* Choose depth */
if (!no_trepas_max_depth)
@@ -4921,7 +4921,7 @@ bool_ reset_recall(bool_ no_trepas_max_depth)
d_info[dun].mindepth, max),
max);
- if (depth < 1) return FALSE;
+ if (depth < 1) return false;
/* Enforce minimum level */
if (depth < d_info[dun].mindepth) depth = d_info[dun].mindepth;
@@ -4932,7 +4932,7 @@ bool_ reset_recall(bool_ no_trepas_max_depth)
p_ptr->recall_dungeon = dun;
max_dlv[p_ptr->recall_dungeon] = depth;
- return TRUE;
+ return true;
}
/*
@@ -5076,7 +5076,7 @@ void geomancy_random_wall(int y, int x)
#undef TABLE_SIZE
}
-void geomancy_random_floor(int y, int x, bool_ kill_wall)
+void geomancy_random_floor(int y, int x, bool kill_wall)
{
auto const &f_info = game->edit_data.f_info;
@@ -5115,7 +5115,7 @@ void geomancy_random_floor(int y, int x, bool_ kill_wall)
#undef TABLE_SIZE
}
-static bool_ geomancy_can_tunnel(int y, int x)
+static bool geomancy_can_tunnel(int y, int x)
{
switch (cave[y][x].feat)
{
@@ -5135,9 +5135,9 @@ static bool_ geomancy_can_tunnel(int y, int x)
case FEAT_SANDWALL_H:
case FEAT_SANDWALL_K:
case FEAT_ICE_WALL:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
@@ -5176,7 +5176,7 @@ void geomancy_dig(int oy, int ox, int dir, int length)
x = x - dx;
while ((y != oy) || (x != ox))
{
- geomancy_random_floor(y, x, TRUE);
+ geomancy_random_floor(y, x, true);
/* Should we branch ? */
if (magik(20))
diff --git a/src/spells2.hpp b/src/spells2.hpp
index 3fcdf5b9..87894bff 100644
--- a/src/spells2.hpp
+++ b/src/spells2.hpp
@@ -14,36 +14,36 @@ void heal_insanity(int val);
void warding_glyph();
void explosive_rune();
void do_dec_stat(int stat, int mode);
-bool_ do_res_stat(int stat, bool_ full);
-bool_ do_inc_stat(int stat);
+bool do_res_stat(int stat, bool full);
+bool do_inc_stat(int stat);
void identify_hooks(object_type *o_ptr);
-bool_ identify_pack();
+bool identify_pack();
void identify_pack_fully();
-bool_ remove_curse();
-bool_ remove_all_curse();
-bool_ restore_level();
-bool_ lose_all_info();
-bool_ detect_doors(int rad);
-bool_ detect_stairs(int rad);
-bool_ detect_treasure(int rad);
+bool remove_curse();
+bool remove_all_curse();
+bool restore_level();
+bool lose_all_info();
+bool detect_doors(int rad);
+bool detect_stairs(int rad);
+bool detect_treasure(int rad);
bool detect_objects_gold(int rad);
bool detect_objects_normal(int rad);
-bool_ detect_monsters_normal(int rad);
-bool_ detect_monsters_invis(int rad);
+bool detect_monsters_normal(int rad);
+bool detect_monsters_invis(int rad);
void detect_monsters_orcs(int rad);
-bool_ detect_all(int rad);
+bool detect_all(int rad);
void stair_creation();
void wall_stone(int y, int x);
-bool_ enchant(object_type *o_ptr, int n, int eflag);
-bool_ enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval);
-bool_ ident_spell();
-bool_ ident_all();
-bool_ recharge(int num);
+bool enchant(object_type *o_ptr, int n, int eflag);
+bool enchant_spell(int num_hit, int num_dam, int num_ac, int num_pval);
+bool ident_spell();
+bool ident_all();
+bool recharge(int num);
void aggravate_monsters(int who);
void genocide();
void mass_genocide();
void change_wild_mode();
-bool_ banish_evil(int dist);
+bool banish_evil(int dist);
void dispel_evil(int dam);
void dispel_good(int dam);
void dispel_undead(int dam);
@@ -57,13 +57,13 @@ void unlite_area(int dam, int rad);
void fire_cloud(int typ, int dir, int dam, int rad, int time);
void fire_wave(int typ, int dir, int dam, int rad, int time, s32b eff);
void fire_wall(int typ, int dir, int dam, int time);
-bool_ fire_ball(int typ, int dir, int dam, int rad);
+bool fire_ball(int typ, int dir, int dam, int rad);
void fire_bolt(int typ, int dir, int dam);
void fire_beam(int typ, int dir, int dam);
void call_chaos();
void fire_bolt_or_beam(int prob, int typ, int dir, int dam);
void lite_line(int dir);
-bool_ drain_life(int dir, int dam);
+bool drain_life(int dir, int dam);
void wall_to_mud(int dir);
void wizard_lock(int dir);
void slow_monster(int dir);
@@ -93,14 +93,14 @@ void report_magics();
void teleport_swap(int dir);
void swap_position(int lty, int ltx);
object_filter_t const &item_tester_hook_recharge();
-bool_ project_hack(int typ, int dam);
+bool project_hack(int typ, int dam);
void project_meteor(int radius, int typ, int dam, u32b flg);
object_filter_t const &item_tester_hook_artifactable();
-bool_ passwall(int dir, bool_ safe);
-bool_ project_hook(int typ, int dir, int dam, int flg);
-bool_ reset_recall(bool_ no_trepas_max_depth);
+bool passwall(int dir, bool safe);
+bool project_hook(int typ, int dir, int dam, int flg);
+bool reset_recall(bool no_trepas_max_depth);
void geomancy_random_wall(int y, int x);
-void geomancy_random_floor(int y, int x, bool_ kill_wall);
+void geomancy_random_floor(int y, int x, bool kill_wall);
void geomancy_dig(int oy, int ox, int dir, int length);
void channel_the_elements(int y, int x, int level);
void random_resistance(object_type *o_ptr, int specific);
diff --git a/src/spells3.cc b/src/spells3.cc
index fecd8a30..aca4f947 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -768,7 +768,7 @@ casting_result demonology_summon_demon()
type = SUMMON_HI_DEMON;
}
- if (!summon_specific_friendly(p_ptr->py, p_ptr->px, level, type, TRUE))
+ if (!summon_specific_friendly(p_ptr->py, p_ptr->px, level, type, true))
{
msg_print("Something blocks your summoning!");
}
@@ -1322,9 +1322,9 @@ casting_result fire_golem()
/* Summon it */
int r_idx = get_fire_golem();
- m_allow_special[r_idx] = TRUE;
- int m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_FRIEND);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ int m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_FRIEND);
+ m_allow_special[r_idx] = false;
/* level it */
if (m_idx != 0)
@@ -1420,7 +1420,7 @@ static u32b dir_to_eff_flags(int dir)
case 8: return EFF_DIR8;
case 9: return EFF_DIR9;
default:
- assert(FALSE);
+ assert(false);
}
/* Default */
return 0;
@@ -1738,7 +1738,7 @@ casting_result geomancy_elemental_minion()
/* Summon it */
find_position(y, x, &my, &mx);
- m_idx = place_monster_one(my, mx, r_idx, 0, FALSE, MSTATUS_FRIEND);
+ m_idx = place_monster_one(my, mx, r_idx, 0, false, MSTATUS_FRIEND);
/* Level it */
if (m_idx)
@@ -1994,7 +1994,7 @@ casting_result manwe_call()
r_idx = test_monster_name("Great eagle");
assert(r_idx >= 1);
- m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_FRIEND);
+ m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_FRIEND);
if (m_idx > 0)
{
@@ -2451,7 +2451,7 @@ void meta_inertia_control_timer_callback()
else if ((p_ptr->inertia_controlled_spell != -1) &&
(!p_ptr->wild_mode))
{
- lua_cast_school_spell(p_ptr->inertia_controlled_spell, TRUE);
+ lua_cast_school_spell(p_ptr->inertia_controlled_spell, true);
}
}
@@ -2922,7 +2922,7 @@ casting_result udun_drain()
}
default:
- assert(FALSE);
+ assert(false);
}
return CAST;
@@ -3344,7 +3344,7 @@ casting_result yavanna_uproot()
/* Summon it */
find_position(y, x, &y, &x);
- m_idx = place_monster_one(y, x, test_monster_name("Ent"), 0, FALSE, MSTATUS_FRIEND);
+ m_idx = place_monster_one(y, x, test_monster_name("Ent"), 0, false, MSTATUS_FRIEND);
/* level it */
if (m_idx != 0)
@@ -3429,12 +3429,12 @@ casting_result nature_recovery()
if (get_level_s(RECOVERY, 50) >= 10)
{
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_DEX, TRUE);
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_INT, TRUE);
- do_res_stat(A_CHR, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_DEX, true);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_INT, true);
+ do_res_stat(A_CHR, true);
}
if (get_level_s(RECOVERY, 50) >= 15)
@@ -3490,7 +3490,7 @@ casting_result nature_summon_animal()
p_ptr->px,
dun_level,
SUMMON_ANIMAL,
- TRUE);
+ true);
return CAST;
}
@@ -3653,7 +3653,7 @@ casting_result device_thunderlords()
}
default:
- assert(FALSE);
+ assert(false);
return NO_CAST;
}
}
@@ -4106,7 +4106,7 @@ casting_result aule_child_spell()
find_position(p_ptr->py, p_ptr->px, &y, &x);
m_idx = place_monster_one(y, x, test_monster_name("Dwarven warrior"),
- 0, FALSE, MSTATUS_FRIEND);
+ 0, false, MSTATUS_FRIEND);
if (m_idx)
{
@@ -4161,8 +4161,8 @@ casting_result mandos_spirit_of_the_feanturi_spell()
if (level >= 20)
{
- do_res_stat(A_WIS, TRUE);
- do_res_stat(A_INT, TRUE);
+ do_res_stat(A_WIS, true);
+ do_res_stat(A_INT, true);
}
if (level >= 30)
@@ -4227,7 +4227,7 @@ casting_result mandos_call_to_the_halls_spell()
assert(r_idx >= 0);
find_position(p_ptr->py, p_ptr->px, &y, &x);
- m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_FRIEND);
+ m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_FRIEND);
if (m_idx)
{
monster_set_level(m_idx, call_to_the_halls_mlev());
@@ -4300,9 +4300,9 @@ casting_result ulmo_draught_of_ulmonan_spell()
if (level >= 10)
{
- do_res_stat(A_STR, TRUE);
- do_res_stat(A_CON, TRUE);
- do_res_stat(A_DEX, TRUE);
+ do_res_stat(A_STR, true);
+ do_res_stat(A_CON, true);
+ do_res_stat(A_DEX, true);
}
if (level >= 20)
@@ -4342,7 +4342,7 @@ casting_result ulmo_call_of_the_ulumuri_spell()
find_position(p_ptr->py, p_ptr->px, &y, &x);
- m_idx = place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_FRIEND);
+ m_idx = place_monster_one(y, x, r_idx, 0, false, MSTATUS_FRIEND);
if (m_idx)
{
monster_set_level(m_idx, call_of_the_ulumuri_mlev());
diff --git a/src/spells4.cc b/src/spells4.cc
index 1b73d573..6305439e 100644
--- a/src/spells4.cc
+++ b/src/spells4.cc
@@ -445,9 +445,9 @@ int print_spell(const char *label_, byte color, int y, s32b s)
return y + 1;
}
-void lua_cast_school_spell(s32b s, bool_ no_cost)
+void lua_cast_school_spell(s32b s, bool no_cost)
{
- bool_ use = FALSE;
+ bool use = false;
spell_type *spell = spell_at(s);
/* No magic? */
@@ -504,7 +504,7 @@ void lua_cast_school_spell(s32b s, bool_ no_cost)
}
else
{
- use = TRUE;
+ use = true;
/* failures are dangerous; we'll flush the input buffer
so it isn't missed. */
@@ -519,7 +519,7 @@ void lua_cast_school_spell(s32b s, bool_ no_cost)
}
/* Use the mana/piety */
- if (use == TRUE)
+ if (use == true)
{
/* Reduce mana */
adjust_power(s, -get_mana(s));
diff --git a/src/spells4.hpp b/src/spells4.hpp
index ad288cab..e16c358a 100644
--- a/src/spells4.hpp
+++ b/src/spells4.hpp
@@ -39,4 +39,4 @@ int print_spell(const char *label, byte color, int y, s32b s);
int school_book_length(int sval);
int spell_x(int sval, int spell_idx, int i);
bool school_book_contains_spell(int sval, s32b spell_idx);
-void lua_cast_school_spell(s32b spell_idx, bool_ no_cost);
+void lua_cast_school_spell(s32b spell_idx, bool no_cost);
diff --git a/src/spells5.cc b/src/spells5.cc
index b61afcaf..63504768 100644
--- a/src/spells5.cc
+++ b/src/spells5.cc
@@ -2315,7 +2315,7 @@ void school_spells_init()
spells_init_theme();
break;
default:
- assert(FALSE);
+ assert(false);
}
}
diff --git a/src/spells6.cc b/src/spells6.cc
index aee4c199..ea71fe83 100644
--- a/src/spells6.cc
+++ b/src/spells6.cc
@@ -164,7 +164,7 @@ long get_provided_levels(school_type *school)
}
struct get_level_school_callback_data {
- bool_ allow_spell_power;
+ bool allow_spell_power;
long bonus;
long lvl;
long num;
@@ -204,7 +204,7 @@ static bool get_level_school_callback(struct get_level_school_callback_data *dat
* allow use of Spell Power for it to apply. */
if (!school->spell_power)
{
- data->allow_spell_power = FALSE;
+ data->allow_spell_power = false;
}
/* Calculate effects of provided levels */
@@ -256,7 +256,7 @@ void get_level_school(spell_type *spell, s32b max, s32b min, s32b *level, bool *
/* Set up initial state */
get_level_school_callback_data data;
- data.allow_spell_power = TRUE;
+ data.allow_spell_power = true;
data.bonus = 0;
data.lvl = 0;
data.num = 0;
diff --git a/src/squelch/object_status.cc b/src/squelch/object_status.cc
index e079d38c..e020614f 100644
--- a/src/squelch/object_status.cc
+++ b/src/squelch/object_status.cc
@@ -34,7 +34,7 @@ status_type object_status(object_type *o_ptr)
}
else
{
- s16b slot = wield_slot_ideal(o_ptr, TRUE);
+ s16b slot = wield_slot_ideal(o_ptr, true);
if (artifact_p(o_ptr))
{
diff --git a/src/squelch/rule.cc b/src/squelch/rule.cc
index 40150a96..934e40a1 100644
--- a/src/squelch/rule.cc
+++ b/src/squelch/rule.cc
@@ -225,7 +225,7 @@ void DestroyRule::do_write_tree(TreePrinter *p) const
bool DestroyRule::do_apply_rule(object_type *o_ptr, int item_idx) const
{
// Must be identified
- if (object_aware_p(o_ptr) == FALSE)
+ if (object_aware_p(o_ptr) == false)
{
return false;
}
diff --git a/src/store.cc b/src/store.cc
index fde832d9..17e92db6 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -246,7 +246,7 @@ static owner_type const *ot_ptr = NULL;
* to adjust (by 200) to extract a usable multiplier. Note that the
* "greed" value is always something (?).
*/
-static s32b price_item(object_type *o_ptr, int greed, bool_ flip)
+static s32b price_item(object_type *o_ptr, int greed, bool flip)
{
auto const &st_info = game->edit_data.st_info;
@@ -481,7 +481,7 @@ static void mass_produce(object_type *o_ptr)
*
* See "object_similar()" for the same function for the "player"
*/
-static bool_ store_object_similar(object_type const *o_ptr, object_type *j_ptr)
+static bool store_object_similar(object_type const *o_ptr, object_type *j_ptr)
{
/* Hack -- Identical items cannot be stacked */
if (o_ptr == j_ptr) return (0);
@@ -541,7 +541,7 @@ static bool_ store_object_similar(object_type const *o_ptr, object_type *j_ptr)
if (o_ptr->discount != j_ptr->discount) return (0);
/* They match, so they must be similar */
- return (TRUE);
+ return true;
}
@@ -568,14 +568,14 @@ static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
* Note that the shop, just like a player, will not accept things
* it cannot hold. Before, one could "nuke" potions this way.
*/
-static bool_ store_check_num(object_type *o_ptr)
+static bool store_check_num(object_type *o_ptr)
{
auto const &st_info = game->edit_data.st_info;
/* Free space is always usable */
if (st_ptr->stock.size() < st_ptr->stock_size)
{
- return TRUE;
+ return true;
}
/* The "home" acts like the player */
@@ -587,7 +587,7 @@ static bool_ store_check_num(object_type *o_ptr)
/* Can the new object be combined with the old one? */
if (object_similar(&o_ref, o_ptr))
{
- return TRUE;
+ return true;
}
}
}
@@ -601,13 +601,13 @@ static bool_ store_check_num(object_type *o_ptr)
/* Can the new object be combined with the old one? */
if (store_object_similar(&o_ref, o_ptr))
{
- return TRUE;
+ return true;
}
}
}
/* But there was no room at the inn... */
- return FALSE;
+ return false;
}
@@ -1061,17 +1061,17 @@ static void store_item_optimize(int item)
* Crap is defined as any item that is "available" elsewhere
* Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
*/
-static bool_ black_market_crap(object_type *o_ptr)
+static bool black_market_crap(object_type *o_ptr)
{
auto const &st_info = game->edit_data.st_info;
/* Ego items are never crap */
- if (o_ptr->name2) return (FALSE);
+ if (o_ptr->name2) return false;
/* Good items are never crap */
- if (o_ptr->to_a > 0) return (FALSE);
- if (o_ptr->to_h > 0) return (FALSE);
- if (o_ptr->to_d > 0) return (FALSE);
+ if (o_ptr->to_a > 0) return false;
+ if (o_ptr->to_h > 0) return false;
+ if (o_ptr->to_d > 0) return false;
/* Check all stores */
for (std::size_t i = 0; i < st_info.size(); i++)
@@ -1085,13 +1085,13 @@ static bool_ black_market_crap(object_type *o_ptr)
/* Duplicate item "type", assume crappy */
if (o_ptr->k_ptr == stock_obj.k_ptr)
{
- return (TRUE);
+ return true;
}
}
}
/* Assume okay */
- return (FALSE);
+ return false;
}
@@ -1273,7 +1273,7 @@ static void store_create()
object_type forge;
object_type *q_ptr = NULL;
- bool_ obj_all_done = FALSE;
+ bool obj_all_done = false;
/* Paranoia -- no room left */
if (st_ptr->stock.size() >= st_ptr->stock_size)
@@ -1284,7 +1284,7 @@ static void store_create()
/* Hack -- consider up to four items */
for (int tries = 0; tries < 4; tries++)
{
- obj_all_done = FALSE;
+ obj_all_done = false;
/* Magic Shop */
if ((st_info[st_ptr->st_idx].name == STORE_MAGIC) &&
@@ -1299,7 +1299,7 @@ static void store_create()
/* Use the forged object */
q_ptr = &forge;
- obj_all_done = TRUE;
+ obj_all_done = true;
}
/* Temple */
@@ -1315,7 +1315,7 @@ static void store_create()
/* Use the forged object */
q_ptr = &forge;
- obj_all_done = TRUE;
+ obj_all_done = true;
}
/* Black Market */
@@ -1399,7 +1399,7 @@ static void store_create()
object_prep(q_ptr, k_idx);
/* Apply some "low-level" magic (no artifacts) */
- apply_magic(q_ptr, level, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, level, false, false, false);
/* Hack -- Charge lite's */
if (q_ptr->tval == TV_LITE)
@@ -1497,7 +1497,7 @@ static void display_entry(int pos)
/* Describe the object */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
o_name[maxwid] = '\0';
c_put_str(tval_to_attr[o_ptr->tval], o_name, i + 6, cur_col);
@@ -1523,7 +1523,7 @@ static void display_entry(int pos)
/* Describe the object (fully) */
char o_name[80];
- object_desc_store(o_name, o_ptr, TRUE, 3);
+ object_desc_store(o_name, o_ptr, true, 3);
o_name[maxwid] = '\0';
c_put_str(tval_to_attr[o_ptr->tval], o_name, i + 6, cur_col);
@@ -1536,7 +1536,7 @@ static void display_entry(int pos)
}
/* Extract the "minimum" price */
- auto const x = price_item(o_ptr, ot_ptr->inflation, FALSE);
+ auto const x = price_item(o_ptr, ot_ptr->inflation, false);
/* Can we buy one ? */
if (x > p_ptr->au) color = TERM_L_DARK;
@@ -1684,7 +1684,7 @@ static int get_stock(int *com_val, const char *pmt, int i, int j)
if ((*com_val >= i) && (*com_val <= j))
{
/* Success */
- return (TRUE);
+ return true;
}
}
@@ -1700,7 +1700,7 @@ static int get_stock(int *com_val, const char *pmt, int i, int j)
I2A(i), I2A(j), pmt);
/* Ask until done */
- while (TRUE)
+ while (true)
{
int k;
@@ -1725,12 +1725,12 @@ static int get_stock(int *com_val, const char *pmt, int i, int j)
prt("", 0, 0);
/* Cancel */
- if (command == ESCAPE) return (FALSE);
+ if (command == ESCAPE) return false;
repeat_push(*com_val);
/* Success */
- return (TRUE);
+ return true;
}
@@ -1738,14 +1738,14 @@ static int get_stock(int *com_val, const char *pmt, int i, int j)
/**
* Prompt for a yes/no during selling/buying
*
- * @return TRUE if 'yes' was selected, otherwise returns FALSE.
+ * @return true if 'yes' was selected, otherwise returns false.
*/
-static bool_ prompt_yesno(const char *prompt)
+static bool prompt_yesno(const char *prompt)
{
const char *allowed = "yn\r\n";
const char *yes = "y\r\n";
char buf[128];
- bool_ ret;
+ bool ret;
/* Build prompt */
snprintf(buf, sizeof(buf), "%s [y/n/RET/ESC] ", prompt);
@@ -1755,13 +1755,13 @@ static bool_ prompt_yesno(const char *prompt)
prt(buf, 0, 0);
/* Get answer */
- while (TRUE)
+ while (true)
{
int key = inkey();
/* ESC means no. */
if (key == ESCAPE) {
- ret = FALSE;
+ ret = false;
break;
}
@@ -1788,12 +1788,12 @@ static bool_ prompt_yesno(const char *prompt)
/*
* Haggling routine -RAK-
*
- * Return TRUE if purchase is NOT successful
+ * Return true if purchase is NOT successful
*/
-static bool_ purchase_haggle(object_type *o_ptr, s32b *price)
+static bool purchase_haggle(object_type *o_ptr, s32b *price)
{
s32b cur_ask;
- bool_ cancel = FALSE;
+ bool cancel = false;
char out_val[160];
char prompt[128];
char o_name[80];
@@ -1802,13 +1802,13 @@ static bool_ purchase_haggle(object_type *o_ptr, s32b *price)
*price = 0;
/* Extract the price */
- cur_ask = price_item(o_ptr, ot_ptr->inflation, FALSE);
+ cur_ask = price_item(o_ptr, ot_ptr->inflation, false);
/* Buy for the whole pile */
cur_ask *= o_ptr->number;
/* Describe the object (fully) */
- object_desc_store(o_name, o_ptr, TRUE, 3);
+ object_desc_store(o_name, o_ptr, true, 3);
/* Prompt */
strnfmt(out_val, sizeof(out_val), "%s: " FMTs32b, "Price", cur_ask);
@@ -1820,13 +1820,13 @@ static bool_ purchase_haggle(object_type *o_ptr, s32b *price)
if (cancel)
{
/* Cancel */
- return (TRUE);
+ return true;
}
else
{
*price = cur_ask;
/* Do not cancel */
- return (FALSE);
+ return false;
}
}
@@ -1834,12 +1834,12 @@ static bool_ purchase_haggle(object_type *o_ptr, s32b *price)
/*
* Haggling routine -RAK-
*
- * Return TRUE if purchase is NOT successful
+ * Return true if purchase is NOT successful
*/
-static bool_ sell_haggle(object_type *o_ptr, s32b *price)
+static bool sell_haggle(object_type *o_ptr, s32b *price)
{
s32b cur_ask;
- bool_ cancel = FALSE;
+ bool cancel = false;
char out_val[160];
char prompt[128];
char o_name[80];
@@ -1848,7 +1848,7 @@ static bool_ sell_haggle(object_type *o_ptr, s32b *price)
*price = 0;
/* Extract price */
- cur_ask = price_item(o_ptr, ot_ptr->inflation, TRUE);
+ cur_ask = price_item(o_ptr, ot_ptr->inflation, true);
/* Limit to shopkeeper's purse */
if (cur_ask > ot_ptr->max_cost) {
@@ -1859,7 +1859,7 @@ static bool_ sell_haggle(object_type *o_ptr, s32b *price)
cur_ask *= o_ptr->number;
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Prompt */
strnfmt(out_val, sizeof(out_val), "%s: " FMTs32b, "Price", cur_ask);
@@ -1871,13 +1871,13 @@ static bool_ sell_haggle(object_type *o_ptr, s32b *price)
if (cancel)
{
/* Cancel */
- return (TRUE);
+ return true;
}
else
{
*price = cur_ask;
/* Do not cancel */
- return (FALSE);
+ return false;
}
}
@@ -2037,7 +2037,7 @@ void store_stole()
/* Describe the transaction */
char o_name[80];
- object_desc(o_name, j_ptr, TRUE, 3);
+ object_desc(o_name, j_ptr, true, 3);
/* Message */
msg_format("You steal %s.", o_name);
@@ -2046,10 +2046,10 @@ void store_stole()
j_ptr->inscription.clear();
/* Give it to the player */
- int const item_new = inven_carry(j_ptr, FALSE);
+ int const item_new = inven_carry(j_ptr, false);
/* Describe the final result */
- object_desc(o_name, &p_ptr->inventory[item_new], TRUE, 3);
+ object_desc(o_name, &p_ptr->inventory[item_new], true, 3);
/* Message */
msg_format("You have %s (%c).",
@@ -2200,7 +2200,7 @@ void store_purchase()
}
/* Determine the "best" price (per item) */
- auto const best = price_item(j_ptr, ot_ptr->inflation, FALSE);
+ auto const best = price_item(j_ptr, ot_ptr->inflation, false);
/* Find out how many the player wants */
int amt = 1;
@@ -2296,7 +2296,7 @@ void store_purchase()
/* Describe the transaction */
char o_name[80];
- object_desc(o_name, j_ptr, TRUE, 3);
+ object_desc(o_name, j_ptr, true, 3);
/* Message */
msg_format("You bought %s for " FMTs32b " gold.", o_name, price);
@@ -2315,10 +2315,10 @@ void store_purchase()
}
/* Give it to the player */
- int const item_new = inven_carry(j_ptr, FALSE);
+ int const item_new = inven_carry(j_ptr, false);
/* Describe the final result */
- object_desc(o_name, &p_ptr->inventory[item_new], TRUE, 3);
+ object_desc(o_name, &p_ptr->inventory[item_new], true, 3);
/* Message */
msg_format("You have %s (%c).",
@@ -2398,11 +2398,11 @@ void store_purchase()
}
/* Give it to the player */
- int const item_new = inven_carry(j_ptr, FALSE);
+ int const item_new = inven_carry(j_ptr, false);
/* Describe just the result */
char o_name[80];
- object_desc(o_name, &p_ptr->inventory[item_new], TRUE, 3);
+ object_desc(o_name, &p_ptr->inventory[item_new], true, 3);
/* Message */
msg_format("You have %s (%c).", o_name, index_to_label(item_new));
@@ -2545,7 +2545,7 @@ void store_sell()
}
/* Get a full description */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, true, 3);
/* Remove any inscription for stores */
if ((cur_store_num != 7) && !museum)
@@ -2619,7 +2619,7 @@ void store_sell()
value = object_value(q_ptr) * q_ptr->number;
/* Get the description all over again */
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, true, 3);
/* Describe the result (in message buffer) */
msg_format("You sold %s for " FMTs32b " gold.", o_name, price);
@@ -2660,7 +2660,7 @@ void store_sell()
else if (museum)
{
char o2_name[80];
- object_desc(o2_name, q_ptr, TRUE, 0);
+ object_desc(o2_name, q_ptr, true, 0);
msg_print("Once you donate something, you cannot take it back.");
if (!get_check(format("Do you really want to donate %s?", o2_name))) return;
@@ -2784,13 +2784,13 @@ void store_examine()
/* Description */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Describe */
msg_format("Examining %s...", o_name);
/* Show the object's powers. */
- if (!object_out_desc(o_ptr, NULL, FALSE, TRUE))
+ if (!object_out_desc(o_ptr, NULL, false, true))
{
msg_print("You see nothing special.");
}
@@ -2812,7 +2812,7 @@ void store_examine()
/*
* Hack -- set this to leave the store
*/
-static bool_ leave_store = FALSE;
+static bool leave_store = false;
/*
@@ -2872,7 +2872,7 @@ static bool store_process_command()
/* Leave */
case ESCAPE:
{
- leave_store = TRUE;
+ leave_store = true;
break;
}
@@ -3170,7 +3170,7 @@ void do_cmd_store()
int maintain_num;
int tmp_chr;
int i;
- bool_ recreate = FALSE;
+ bool recreate = false;
cave_type *c_ptr;
@@ -3255,7 +3255,7 @@ void do_cmd_store()
}
/* Do not leave */
- leave_store = FALSE;
+ leave_store = false;
/* Interact with player */
while (!leave_store)
@@ -3288,10 +3288,10 @@ void do_cmd_store()
show_building(st_ptr);
/* Get a command */
- request_command(TRUE);
+ request_command(true);
/* Process the command */
- if (store_process_command()) recreate = TRUE;
+ if (store_process_command()) recreate = true;
/* Hack -- Character is still in "icky" mode */
character_icky = true;
@@ -3316,7 +3316,7 @@ void do_cmd_store()
msg_print("Your pack is so full that you flee the store...");
/* Leave */
- leave_store = TRUE;
+ leave_store = true;
}
/* Hack -- Flee from the home */
@@ -3326,7 +3326,7 @@ void do_cmd_store()
msg_print("Your pack is so full that you flee your home...");
/* Leave */
- leave_store = TRUE;
+ leave_store = true;
}
/* Hack -- Drop items into the home */
@@ -3344,7 +3344,7 @@ void do_cmd_store()
/* Describe it */
char o_name[80];
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, true, 3);
/* Message */
msg_format("You drop %s (%c).", o_name, index_to_label(item));
@@ -3371,7 +3371,7 @@ void do_cmd_store()
if (tmp_chr != p_ptr->stat_use[A_CHR]) display_inventory();
/* Hack -- get kicked out of the store */
- if (st_ptr->store_open >= turn) leave_store = TRUE;
+ if (st_ptr->store_open >= turn) leave_store = true;
}
/* Free turn XXX XXX XXX */
@@ -3697,7 +3697,7 @@ void do_cmd_home_trump()
}
/* Do not leave */
- leave_store = FALSE;
+ leave_store = false;
/* Interact with player */
while (!leave_store)
@@ -3742,7 +3742,7 @@ void do_cmd_home_trump()
prt("You may: ", 21, 0);
/* Get a command */
- request_command(TRUE);
+ request_command(true);
/* Process the command */
store_process_command();
@@ -3770,7 +3770,7 @@ void do_cmd_home_trump()
msg_print("Your pack is so full that you flee the store...");
/* Leave */
- leave_store = TRUE;
+ leave_store = true;
}
/* Hack -- Flee from the home */
@@ -3780,7 +3780,7 @@ void do_cmd_home_trump()
msg_print("Your pack is so full that you flee your home...");
/* Leave */
- leave_store = TRUE;
+ leave_store = true;
}
/* Hack -- Drop items into the home */
@@ -3798,7 +3798,7 @@ void do_cmd_home_trump()
/* Describe it */
char o_name[80];
- object_desc(o_name, q_ptr, TRUE, 3);
+ object_desc(o_name, q_ptr, true, 3);
/* Message */
msg_format("You drop %s (%c).", o_name, index_to_label(item));
@@ -3825,7 +3825,7 @@ void do_cmd_home_trump()
if (tmp_chr != p_ptr->stat_use[A_CHR]) display_inventory();
/* Hack -- get kicked out of the store */
- if (st_ptr->store_open >= turn) leave_store = TRUE;
+ if (st_ptr->store_open >= turn) leave_store = true;
}
diff --git a/src/tables.cc b/src/tables.cc
index 1c807d2e..6ca701a5 100644
--- a/src/tables.cc
+++ b/src/tables.cc
@@ -2405,7 +2405,7 @@ std::vector<flags_group> const &flags_groups()
quest_type quest[MAX_Q_IDX] =
{
{
- FALSE,
+ false,
"",
{
"",
@@ -2428,7 +2428,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Dol Guldur",
{
"The forest of Mirkwood is a very dangerous place to go, mainly due to",
@@ -2451,7 +2451,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Sauron",
{
"It is time to take the battle to Morgoth. But, before you can",
@@ -2474,7 +2474,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Morgoth",
{
"Your final quest is the ultimate quest that has always been",
@@ -2499,7 +2499,7 @@ quest_type quest[MAX_Q_IDX] =
/* Bree plot */
{
- FALSE,
+ false,
"Thieves!",
{
"There are thieves robbing my people! They live in a small",
@@ -2523,7 +2523,7 @@ quest_type quest[MAX_Q_IDX] =
},
{
- FALSE,
+ false,
"Random Quest",
{
"",
@@ -2547,7 +2547,7 @@ quest_type quest[MAX_Q_IDX] =
},
{
- FALSE,
+ false,
"Lost Hobbit",
{
"Merton Proudfoot, a young hobbit, seems to have disappeared.",
@@ -2571,7 +2571,7 @@ quest_type quest[MAX_Q_IDX] =
},
{
- FALSE,
+ false,
"The Dark Horseman",
{
"A dark-cloaked horseman has been spotted several times in town.",
@@ -2595,7 +2595,7 @@ quest_type quest[MAX_Q_IDX] =
},
{
- FALSE,
+ false,
"The Trolls Glade",
{
"A group of Forest Trolls settled in an abandoned forest in the",
@@ -2614,12 +2614,12 @@ quest_type quest[MAX_Q_IDX] =
&plots[PLOT_BREE],
quest_troll_init_hook,
- {FALSE, 0},
+ {false, 0},
NULL,
},
{
- FALSE,
+ false,
"The Wight Grave",
{
"The Barrow-Downs hides many mysteries and dangers.",
@@ -2638,13 +2638,13 @@ quest_type quest[MAX_Q_IDX] =
&plots[PLOT_BREE],
quest_wight_init_hook,
- {FALSE, 0},
+ {false, 0},
NULL,
},
/* Lorien plot */
{
- FALSE,
+ false,
"Spiders of Mirkwood",
{
"Powers lurk deep within Mirkwood. Spiders have blocked the",
@@ -2667,7 +2667,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Poisoned Water",
{
"A curse has beset Lothlorien. All trees along the shorelines of Nimrodel",
@@ -2691,7 +2691,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Other quests */
{
- FALSE,
+ false,
"The Broken Sword",
{
"You have found Narsil, a broken sword. It is said that the sword that",
@@ -2715,7 +2715,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Gondolin plot */
{
- FALSE,
+ false,
"Eol the Dark Elf",
{
"We have disturbing tidings. Eol the Dark Elf has come seeking his kin in",
@@ -2738,7 +2738,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Nirnaeth Arnoediad",
{
"The fortunes of war in the north turn against us.",
@@ -2761,7 +2761,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Invasion of Gondolin",
{
"Morgoth is upon us! Dragons and Balrogs have poured over secret",
@@ -2785,7 +2785,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Minas Anor Plot*/
{
- FALSE,
+ false,
"The Last Alliance",
{
"The armies of Morgoth are closing in on the last remaining strongholds",
@@ -2808,7 +2808,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"The One Ring",
{
"Find the One Ring, then bring it to Mount Doom, in Mordor, to drop",
@@ -2832,7 +2832,7 @@ quest_type quest[MAX_Q_IDX] =
},
{
- FALSE,
+ false,
"Mushroom supplies",
{
"Farmer Maggot asked you to bring him back his mushrooms.",
@@ -2856,7 +2856,7 @@ quest_type quest[MAX_Q_IDX] =
},
{
- FALSE,
+ false,
"The prisoner of Dol Guldur",
{
"You keep hearing distress cries in the dark tower of",
@@ -2881,7 +2881,7 @@ quest_type quest[MAX_Q_IDX] =
/* The 2 ultra endings go here */
{
- FALSE,
+ false,
"Falling Toward Apotheosis",
{
"You must enter the Void where Melkor spirit lurks to destroy",
@@ -2904,7 +2904,7 @@ quest_type quest[MAX_Q_IDX] =
NULL,
},
{
- FALSE,
+ false,
"Falling Toward Apotheosis",
{
"You must now launch an onslaught on Valinor itself to eliminate",
@@ -2928,7 +2928,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* More Lorien */
{
- FALSE,
+ false,
"Wolves!",
{
"There are wolves pestering my people! They gather in a hut",
@@ -2952,7 +2952,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* More Gondolin */
{
- FALSE,
+ false,
"Dragons!",
{
"There are dragons pestering my people! They gather in a",
@@ -2976,7 +2976,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* More Minas Anor */
{
- FALSE,
+ false,
"Haunted House!",
{
"There are undead pestering my people! They gather in a hut",
@@ -3000,7 +3000,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Khazad-Dum Plot*/
{
- FALSE,
+ false,
"Evil!",
{
"We have burrowed too deep, and let out some creatures of",
@@ -3024,7 +3024,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Bounty */
{
- FALSE,
+ false,
"Bounty quest",
{
"", /* dynamic desc */
@@ -3038,7 +3038,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Fireproofing */
{
- FALSE,
+ false,
"Old Mages quest",
{
"", /* dynamic desc */
@@ -3052,7 +3052,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* Library */
{
- FALSE,
+ false,
"Library quest",
{
"", /* dynamic desc */
@@ -3066,7 +3066,7 @@ quest_type quest[MAX_Q_IDX] =
},
/* God quest */
{
- FALSE,
+ false,
"God quest",
{
"", /* dynamic desc */
@@ -3081,7 +3081,7 @@ quest_type quest[MAX_Q_IDX] =
4 /* dun_maxdepth */,
0 /* dun_minplev */,
0 /* relic_gen_tries */,
- FALSE /* relic_generated */,
+ false /* relic_generated */,
1 /* dung_x */,
1 /* dung_y */,
},
@@ -3093,94 +3093,94 @@ quest_type quest[MAX_Q_IDX] =
/* List of powers for Symbiants/Powers */
monster_power monster_powers[] =
{
- { SF_SHRIEK_IDX, "Aggravate Monster", 1, FALSE },
- { SF_MULTIPLY_IDX, "Multiply", 10, FALSE },
- { SF_S_ANIMAL_IDX, "Summon Animal", 30, FALSE },
- { SF_ROCKET_IDX, "Fire a Rocket", 40, TRUE },
- { SF_ARROW_1_IDX, "Light Arrow", 1, FALSE },
- { SF_ARROW_2_IDX, "Minor Arrow", 3, FALSE },
- { SF_ARROW_3_IDX, "Major Arrow", 7, TRUE },
- { SF_ARROW_4_IDX, "Great Arrow", 9, TRUE },
- { SF_BR_ACID_IDX, "Breathe Acid", 10, FALSE },
- { SF_BR_ELEC_IDX, "Breathe Lightning", 10, FALSE },
- { SF_BR_FIRE_IDX, "Breathe Fire", 10, FALSE },
- { SF_BR_COLD_IDX, "Breathe Cold", 10, FALSE },
- { SF_BR_POIS_IDX, "Breathe Poison", 15, TRUE },
- { SF_BR_NETH_IDX, "Breathe Nether", 30, TRUE },
- { SF_BR_LITE_IDX, "Breathe Light", 20, TRUE },
- { SF_BR_DARK_IDX, "Breathe Dark", 20, TRUE },
- { SF_BR_CONF_IDX, "Breathe Confusion", 15, TRUE },
- { SF_BR_SOUN_IDX, "Breathe Sound", 30, TRUE },
- { SF_BR_CHAO_IDX, "Breathe Chaos", 30, TRUE },
- { SF_BR_DISE_IDX, "Breathe Disenchantment", 30, TRUE },
- { SF_BR_NEXU_IDX, "Breathe Nexus", 30, TRUE },
- { SF_BR_TIME_IDX, "Breathe Time", 30, TRUE },
- { SF_BR_INER_IDX, "Breathe Inertia", 30, TRUE },
- { SF_BR_GRAV_IDX, "Breathe Gravity", 30, TRUE },
- { SF_BR_SHAR_IDX, "Breathe Shards", 30, TRUE },
- { SF_BR_PLAS_IDX, "Breathe Plasma", 30, TRUE },
- { SF_BR_WALL_IDX, "Breathe Force", 30, TRUE },
- { SF_BR_MANA_IDX, "Breathe Mana", 40, TRUE },
- { SF_BA_NUKE_IDX, "Nuke Ball", 30, TRUE },
- { SF_BR_NUKE_IDX, "Breathe Nuke", 40, TRUE },
- { SF_BA_CHAO_IDX, "Chaos Ball", 30, TRUE },
- { SF_BR_DISI_IDX, "Breathe Disintegration", 40, TRUE },
- { SF_BA_ACID_IDX, "Acid Ball", 8, FALSE },
- { SF_BA_ELEC_IDX, "Lightning Ball", 8, FALSE },
- { SF_BA_FIRE_IDX, "Fire Ball", 8, FALSE },
- { SF_BA_COLD_IDX, "Cold Ball", 8, FALSE },
- { SF_BA_POIS_IDX, "Poison Ball", 20, TRUE },
- { SF_BA_NETH_IDX, "Nether Ball", 20, TRUE },
- { SF_BA_WATE_IDX, "Water Ball", 20, TRUE },
- { SF_BA_MANA_IDX, "Mana Ball", 50, TRUE },
- { SF_BA_DARK_IDX, "Darkness Ball", 20, TRUE },
- { SF_CAUSE_1_IDX, "Cause Light Wounds", 20, FALSE },
- { SF_CAUSE_2_IDX, "Cause Medium Wounds", 30, FALSE },
- { SF_CAUSE_3_IDX, "Cause Critical Wounds", 35, TRUE },
- { SF_CAUSE_4_IDX, "Cause Mortal Wounds", 45, TRUE },
- { SF_BO_ACID_IDX, "Acid Bolt", 5, FALSE },
- { SF_BO_ELEC_IDX, "Lightning Bolt", 5, FALSE },
- { SF_BO_FIRE_IDX, "Fire Bolt", 5, FALSE },
- { SF_BO_COLD_IDX, "Cold Bolt", 5, FALSE },
- { SF_BO_POIS_IDX, "Poison Bolt", 10, TRUE },
- { SF_BO_NETH_IDX, "Nether Bolt", 15, TRUE },
- { SF_BO_WATE_IDX, "Water Bolt", 20, TRUE },
- { SF_BO_MANA_IDX, "Mana Bolt", 25, TRUE },
- { SF_BO_PLAS_IDX, "Plasma Bolt", 20, TRUE },
- { SF_BO_ICEE_IDX, "Ice Bolt", 20, TRUE },
- { SF_MISSILE_IDX, "Magic Missile", 1, FALSE },
- { SF_SCARE_IDX, "Scare", 4, FALSE },
- { SF_BLIND_IDX, "Blindness", 6, FALSE },
- { SF_CONF_IDX, "Confusion", 7, FALSE },
- { SF_SLOW_IDX, "Slowness", 10, FALSE },
- { SF_HOLD_IDX, "Paralyse", 10, FALSE },
- { SF_HASTE_IDX, "Haste Self", 50, FALSE },
- { SF_HAND_DOOM_IDX, "Hand of Doom", 30, TRUE },
- { SF_HEAL_IDX, "Healing", 60, FALSE },
- { SF_S_ANIMALS_IDX, "Summon Animals", 60, TRUE },
- { SF_BLINK_IDX, "Phase Door", 2, FALSE },
- { SF_TPORT_IDX, "Teleport", 10, FALSE },
- { SF_TELE_TO_IDX, "Teleport To", 20, TRUE },
- { SF_TELE_AWAY_IDX, "Teleport Away", 20, FALSE },
- { SF_TELE_LEVEL_IDX, "Teleport Level", 20, TRUE },
- { SF_DARKNESS_IDX, "Darkness", 3, FALSE },
- { SF_RAISE_DEAD_IDX, "Raise the Dead", 400, TRUE },
- { SF_S_THUNDERLORD_IDX, "Summon Thunderlords", 90, TRUE },
- { SF_S_KIN_IDX, "Summon Kin", 80, FALSE },
- { SF_S_HI_DEMON_IDX, "Summon Greater Demons", 90, TRUE },
- { SF_S_MONSTER_IDX, "Summon Monster", 50, FALSE },
- { SF_S_MONSTERS_IDX, "Summon Monsters", 60, TRUE },
- { SF_S_ANT_IDX, "Summon Ants", 30, FALSE },
- { SF_S_SPIDER_IDX, "Summon Spider", 30, FALSE },
- { SF_S_HOUND_IDX, "Summon Hound", 50, TRUE },
- { SF_S_HYDRA_IDX, "Summon Hydra", 40, TRUE },
- { SF_S_ANGEL_IDX, "Summon Angel", 60, TRUE },
- { SF_S_DEMON_IDX, "Summon Demon", 60, TRUE },
- { SF_S_UNDEAD_IDX, "Summon Undead", 70, TRUE },
- { SF_S_DRAGON_IDX, "Summon Dragon", 70, TRUE },
- { SF_S_HI_UNDEAD_IDX, "Summon High Undead", 90, TRUE },
- { SF_S_HI_DRAGON_IDX, "Summon High Dragon", 90, TRUE },
- { SF_S_WRAITH_IDX, "Summon Wraith", 90, TRUE },
+ { SF_SHRIEK_IDX, "Aggravate Monster", 1, false },
+ { SF_MULTIPLY_IDX, "Multiply", 10, false },
+ { SF_S_ANIMAL_IDX, "Summon Animal", 30, false },
+ { SF_ROCKET_IDX, "Fire a Rocket", 40, true },
+ { SF_ARROW_1_IDX, "Light Arrow", 1, false },
+ { SF_ARROW_2_IDX, "Minor Arrow", 3, false },
+ { SF_ARROW_3_IDX, "Major Arrow", 7, true },
+ { SF_ARROW_4_IDX, "Great Arrow", 9, true },
+ { SF_BR_ACID_IDX, "Breathe Acid", 10, false },
+ { SF_BR_ELEC_IDX, "Breathe Lightning", 10, false },
+ { SF_BR_FIRE_IDX, "Breathe Fire", 10, false },
+ { SF_BR_COLD_IDX, "Breathe Cold", 10, false },
+ { SF_BR_POIS_IDX, "Breathe Poison", 15, true },
+ { SF_BR_NETH_IDX, "Breathe Nether", 30, true },
+ { SF_BR_LITE_IDX, "Breathe Light", 20, true },
+ { SF_BR_DARK_IDX, "Breathe Dark", 20, true },
+ { SF_BR_CONF_IDX, "Breathe Confusion", 15, true },
+ { SF_BR_SOUN_IDX, "Breathe Sound", 30, true },
+ { SF_BR_CHAO_IDX, "Breathe Chaos", 30, true },
+ { SF_BR_DISE_IDX, "Breathe Disenchantment", 30, true },
+ { SF_BR_NEXU_IDX, "Breathe Nexus", 30, true },
+ { SF_BR_TIME_IDX, "Breathe Time", 30, true },
+ { SF_BR_INER_IDX, "Breathe Inertia", 30, true },
+ { SF_BR_GRAV_IDX, "Breathe Gravity", 30, true },
+ { SF_BR_SHAR_IDX, "Breathe Shards", 30, true },
+ { SF_BR_PLAS_IDX, "Breathe Plasma", 30, true },
+ { SF_BR_WALL_IDX, "Breathe Force", 30, true },
+ { SF_BR_MANA_IDX, "Breathe Mana", 40, true },
+ { SF_BA_NUKE_IDX, "Nuke Ball", 30, true },
+ { SF_BR_NUKE_IDX, "Breathe Nuke", 40, true },
+ { SF_BA_CHAO_IDX, "Chaos Ball", 30, true },
+ { SF_BR_DISI_IDX, "Breathe Disintegration", 40, true },
+ { SF_BA_ACID_IDX, "Acid Ball", 8, false },
+ { SF_BA_ELEC_IDX, "Lightning Ball", 8, false },
+ { SF_BA_FIRE_IDX, "Fire Ball", 8, false },
+ { SF_BA_COLD_IDX, "Cold Ball", 8, false },
+ { SF_BA_POIS_IDX, "Poison Ball", 20, true },
+ { SF_BA_NETH_IDX, "Nether Ball", 20, true },
+ { SF_BA_WATE_IDX, "Water Ball", 20, true },
+ { SF_BA_MANA_IDX, "Mana Ball", 50, true },
+ { SF_BA_DARK_IDX, "Darkness Ball", 20, true },
+ { SF_CAUSE_1_IDX, "Cause Light Wounds", 20, false },
+ { SF_CAUSE_2_IDX, "Cause Medium Wounds", 30, false },
+ { SF_CAUSE_3_IDX, "Cause Critical Wounds", 35, true },
+ { SF_CAUSE_4_IDX, "Cause Mortal Wounds", 45, true },
+ { SF_BO_ACID_IDX, "Acid Bolt", 5, false },
+ { SF_BO_ELEC_IDX, "Lightning Bolt", 5, false },
+ { SF_BO_FIRE_IDX, "Fire Bolt", 5, false },
+ { SF_BO_COLD_IDX, "Cold Bolt", 5, false },
+ { SF_BO_POIS_IDX, "Poison Bolt", 10, true },
+ { SF_BO_NETH_IDX, "Nether Bolt", 15, true },
+ { SF_BO_WATE_IDX, "Water Bolt", 20, true },
+ { SF_BO_MANA_IDX, "Mana Bolt", 25, true },
+ { SF_BO_PLAS_IDX, "Plasma Bolt", 20, true },
+ { SF_BO_ICEE_IDX, "Ice Bolt", 20, true },
+ { SF_MISSILE_IDX, "Magic Missile", 1, false },
+ { SF_SCARE_IDX, "Scare", 4, false },
+ { SF_BLIND_IDX, "Blindness", 6, false },
+ { SF_CONF_IDX, "Confusion", 7, false },
+ { SF_SLOW_IDX, "Slowness", 10, false },
+ { SF_HOLD_IDX, "Paralyse", 10, false },
+ { SF_HASTE_IDX, "Haste Self", 50, false },
+ { SF_HAND_DOOM_IDX, "Hand of Doom", 30, true },
+ { SF_HEAL_IDX, "Healing", 60, false },
+ { SF_S_ANIMALS_IDX, "Summon Animals", 60, true },
+ { SF_BLINK_IDX, "Phase Door", 2, false },
+ { SF_TPORT_IDX, "Teleport", 10, false },
+ { SF_TELE_TO_IDX, "Teleport To", 20, true },
+ { SF_TELE_AWAY_IDX, "Teleport Away", 20, false },
+ { SF_TELE_LEVEL_IDX, "Teleport Level", 20, true },
+ { SF_DARKNESS_IDX, "Darkness", 3, false },
+ { SF_RAISE_DEAD_IDX, "Raise the Dead", 400, true },
+ { SF_S_THUNDERLORD_IDX, "Summon Thunderlords", 90, true },
+ { SF_S_KIN_IDX, "Summon Kin", 80, false },
+ { SF_S_HI_DEMON_IDX, "Summon Greater Demons", 90, true },
+ { SF_S_MONSTER_IDX, "Summon Monster", 50, false },
+ { SF_S_MONSTERS_IDX, "Summon Monsters", 60, true },
+ { SF_S_ANT_IDX, "Summon Ants", 30, false },
+ { SF_S_SPIDER_IDX, "Summon Spider", 30, false },
+ { SF_S_HOUND_IDX, "Summon Hound", 50, true },
+ { SF_S_HYDRA_IDX, "Summon Hydra", 40, true },
+ { SF_S_ANGEL_IDX, "Summon Angel", 60, true },
+ { SF_S_DEMON_IDX, "Summon Demon", 60, true },
+ { SF_S_UNDEAD_IDX, "Summon Undead", 70, true },
+ { SF_S_DRAGON_IDX, "Summon Dragon", 70, true },
+ { SF_S_HI_UNDEAD_IDX, "Summon High Undead", 90, true },
+ { SF_S_HI_DRAGON_IDX, "Summon High Dragon", 90, true },
+ { SF_S_WRAITH_IDX, "Summon Wraith", 90, true },
};
@@ -3470,7 +3470,7 @@ tval_desc tval_descs[] =
/*
* List of the between exits
* s16b corresp; Corresponding between gate
- * bool_ dungeon; Do we exit in a dungeon or in the wild ?
+ * bool dungeon; Do we exit in a dungeon or in the wild ?
*
* s16b wild_x, wild_y; Wilderness spot to land onto
* s16b p_ptr->px, p_ptr->py; Location of the map
diff --git a/src/town_type.hpp b/src/town_type.hpp
index db87ad23..738f4bec 100644
--- a/src/town_type.hpp
+++ b/src/town_type.hpp
@@ -19,7 +19,7 @@ struct town_type
byte flags = 0; /* Town flags */
- bool_ stocked = FALSE; /* Is the town actualy stocked ? */
+ bool stocked = false; /* Is the town actualy stocked ? */
- bool_ destroyed = FALSE; /* Is the town destroyed? */
+ bool destroyed = false; /* Is the town destroyed? */
};
diff --git a/src/util.cc b/src/util.cc
index c25045fd..8628fdb2 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -265,7 +265,7 @@ errr my_fgets(FILE *fff, char *buf, unsigned long n)
{
unsigned long i = 0;
- while (TRUE)
+ while (true)
{
int c = fgetc(fff);
@@ -625,7 +625,7 @@ static void trigger_text_to_ascii(char **bufptr, const char **strptr)
{
char *s = *bufptr;
const char *str = *strptr;
- bool_ mod_status[MAX_MACRO_MOD];
+ bool mod_status[MAX_MACRO_MOD];
int i, len = 0;
int shiftstatus = 0;
@@ -635,7 +635,7 @@ static void trigger_text_to_ascii(char **bufptr, const char **strptr)
return;
for (i = 0; macro_modifier_chr[i]; i++)
- mod_status[i] = FALSE;
+ mod_status[i] = false;
str++;
/* Examine modifier keys */
@@ -649,7 +649,7 @@ static void trigger_text_to_ascii(char **bufptr, const char **strptr)
}
if (!macro_modifier_chr[i]) break;
str += len;
- mod_status[i] = TRUE;
+ mod_status[i] = true;
if ('S' == macro_modifier_chr[i])
shiftstatus = 1;
}
@@ -844,7 +844,7 @@ void text_to_ascii(char *buf, const char *str)
}
-static bool_ trigger_ascii_to_text(char **bufptr, const char **strptr)
+static bool trigger_ascii_to_text(char **bufptr, const char **strptr)
{
char *s = *bufptr;
const char *str = *strptr;
@@ -853,7 +853,7 @@ static bool_ trigger_ascii_to_text(char **bufptr, const char **strptr)
const char *tmp;
if (macro_template == NULL)
- return FALSE;
+ return false;
*s++ = '\\';
*s++ = '[';
@@ -880,11 +880,11 @@ static bool_ trigger_ascii_to_text(char **bufptr, const char **strptr)
key_code[j] = '\0';
break;
default:
- if (ch != *str) return FALSE;
+ if (ch != *str) return false;
str++;
}
}
- if (*str++ != (char)13) return FALSE;
+ if (*str++ != (char)13) return false;
for (i = 0; i < max_macrotrigger; i++)
{
@@ -893,7 +893,7 @@ static bool_ trigger_ascii_to_text(char **bufptr, const char **strptr)
break;
}
if (i == max_macrotrigger)
- return FALSE;
+ return false;
tmp = macro_trigger_name[i];
while (*tmp) *s++ = *tmp++;
@@ -902,7 +902,7 @@ static bool_ trigger_ascii_to_text(char **bufptr, const char **strptr)
*bufptr = s;
*strptr = str;
- return TRUE;
+ return true;
}
@@ -1011,7 +1011,7 @@ void ascii_to_text(char *buf, const char *str)
/*
* Determine if any macros have ever started with a given character.
*/
-static bool_ macro__use[256];
+static bool macro__use[256];
/*
@@ -1183,7 +1183,7 @@ errr macro_add(const char *pat, const char *act)
macro__act[n] = strdup(act);
/* Efficiency */
- macro__use[(byte)(pat[0])] = TRUE;
+ macro__use[(byte)(pat[0])] = true;
/* Success */
return (0);
@@ -1194,7 +1194,7 @@ errr macro_add(const char *pat, const char *act)
/*
* Local "need flush" variable
*/
-static bool_ flush_later = FALSE;
+static bool flush_later = false;
/*
@@ -1202,14 +1202,14 @@ static bool_ flush_later = FALSE;
*
* Do not match any macros until "ascii 30" is found.
*/
-static bool_ parse_macro = FALSE;
+static bool parse_macro = false;
/*
* Local variable -- we are inside a "macro trigger"
*
* Strip all keypresses until a low ascii value is found.
*/
-static bool_ parse_under = FALSE;
+static bool parse_under = false;
/*
@@ -1222,7 +1222,7 @@ static bool_ parse_under = FALSE;
void flush()
{
/* Do it later */
- flush_later = TRUE;
+ flush_later = true;
}
@@ -1292,7 +1292,7 @@ static char inkey_aux()
/* End "macro action" */
- if (ch == 30) parse_macro = FALSE;
+ if (ch == 30) parse_macro = false;
/* Inside "macro action" */
if (ch == 30) return (ch);
@@ -1317,7 +1317,7 @@ static char inkey_aux()
/* Wait for a macro, or a timeout */
- while (TRUE)
+ while (true)
{
/* Check for pending macro */
k = macro_find_maybe(buf);
@@ -1387,7 +1387,7 @@ static char inkey_aux()
/* Begin "macro action" */
- parse_macro = TRUE;
+ parse_macro = true;
/* Push the "end of macro action" key */
if (Term_key_push(30)) return (0);
@@ -1422,32 +1422,32 @@ static char inkey_aux()
*/
static const char *inkey_next = NULL;
-bool_ inkey_flag = FALSE;
+bool inkey_flag = false;
/*
* Get a keypress from the user.
*
* This function recognizes a few "global parameters". These are variables
-* which, if set to TRUE before calling this function, will have an effect
-* on this function, and which are always reset to FALSE by this function
+* which, if set to true before calling this function, will have an effect
+* on this function, and which are always reset to false by this function
* before this function returns. Thus they function just like normal
* parameters, except that most calls to this function can ignore them.
*
-* If "inkey_scan" is TRUE, then we will immediately return "zero" if no
+* If "inkey_scan" is true, then we will immediately return "zero" if no
* keypress is available, instead of waiting for a keypress.
*
-* If "inkey_base" is TRUE, then all macro processing will be bypassed.
-* If "inkey_base" and "inkey_scan" are both TRUE, then this function will
+* If "inkey_base" is true, then all macro processing will be bypassed.
+* If "inkey_base" and "inkey_scan" are both true, then this function will
* not return immediately, but will wait for a keypress for as long as the
* normal macro matching code would, allowing the direct entry of macro
* triggers. The "inkey_base" flag is extremely dangerous!
*
-* If "inkey_flag" is TRUE, then we will assume that we are waiting for a
+* If "inkey_flag" is true, then we will assume that we are waiting for a
* normal command, and we will only show the cursor if "hilite_player" is
-* TRUE (or if the player is in a store), instead of always showing the
+* true (or if the player is in a store), instead of always showing the
* cursor. The various "main-xxx.c" files should avoid saving the game
-* in response to a "menu item" request unless "inkey_flag" is TRUE, to
+* in response to a "menu item" request unless "inkey_flag" is true, to
* prevent savefile corruption.
*
* If we are waiting for a keypress, and no keypress is ready, then we will
@@ -1479,7 +1479,7 @@ bool_ inkey_flag = FALSE;
*
* Hack -- Note the use of "inkey_next" to allow "keymaps" to be processed.
*/
-static char inkey_real(bool_ inkey_scan)
+static char inkey_real(bool inkey_scan)
{
int v;
@@ -1487,7 +1487,7 @@ static char inkey_real(bool_ inkey_scan)
char ch = 0;
- bool_ done = FALSE;
+ bool done = false;
term *old = Term;
@@ -1498,7 +1498,7 @@ static char inkey_real(bool_ inkey_scan)
ch = *inkey_next++;
/* Cancel the various "global parameters" */
- inkey_base = inkey_flag = inkey_scan = FALSE;
+ inkey_base = inkey_flag = inkey_scan = false;
/* Accept result */
macro_recorder_add(ch);
@@ -1548,7 +1548,7 @@ static char inkey_real(bool_ inkey_scan)
Term_activate(angband_term[0]);
/* Only once */
- done = TRUE;
+ done = true;
}
@@ -1572,7 +1572,7 @@ static char inkey_real(bool_ inkey_scan)
}
/* Wait */
- while (TRUE)
+ while (true)
{
/* Check for (and remove) a pending key */
if (0 == Term_inkey(&ch, false, true))
@@ -1629,7 +1629,7 @@ static char inkey_real(bool_ inkey_scan)
ch = 0;
/* End "macro trigger" */
- parse_under = FALSE;
+ parse_under = false;
}
@@ -1647,7 +1647,7 @@ static char inkey_real(bool_ inkey_scan)
ch = 0;
/* Begin "macro trigger" */
- parse_under = TRUE;
+ parse_under = true;
}
/* Inside "macro trigger" */
@@ -1668,7 +1668,7 @@ static char inkey_real(bool_ inkey_scan)
/* Cancel the various "global parameters" */
- inkey_base = inkey_flag = FALSE;
+ inkey_base = inkey_flag = false;
/* Return the keypress */
@@ -1677,11 +1677,11 @@ static char inkey_real(bool_ inkey_scan)
}
char inkey() {
- return inkey_real(FALSE);
+ return inkey_real(false);
}
char inkey_scan() {
- return inkey_real(TRUE);
+ return inkey_real(true);
}
/*
@@ -1790,7 +1790,7 @@ void cmsg_print(byte color, const char *msg)
msg_flush(p);
/* Forget it */
- msg_flag = FALSE;
+ msg_flag = false;
/* Reset */
p = 0;
@@ -1884,7 +1884,7 @@ void cmsg_print(byte color, const char *msg)
}
/* Remember the message */
- msg_flag = TRUE;
+ msg_flag = true;
/* Remember the position */
p += n + 1;
@@ -2353,7 +2353,7 @@ static char complete_buf[100];
static int complete_command(char *buf, int clen, int mlen)
{
int i, j = 1, max = clen;
- bool_ gotone = FALSE;
+ bool gotone = false;
/* Forget the characters after the end of the string. */
complete_buf[clen] = '\0';
@@ -2371,7 +2371,7 @@ static int complete_command(char *buf, int clen, int mlen)
if (!gotone)
{
sprintf(buf, "%.*s", mlen, cli_ptr->comm);
- gotone = TRUE;
+ gotone = true;
}
/* For later matches, simply notice how much of buf it
* matches. */
@@ -2416,12 +2416,12 @@ bool askfor_aux(std::string *buf, std::size_t max_len)
* Pressing RETURN right away accepts the default entry.
* Normal chars clear the default and append the char.
* Backspace clears the default or deletes the final char.
-* ESCAPE clears the buffer and the window and returns FALSE.
-* RETURN accepts the current buffer contents and returns TRUE.
+* ESCAPE clears the buffer and the window and returns false.
+* RETURN accepts the current buffer contents and returns true.
*/
-static bool_ askfor_aux_complete = FALSE;
+static bool askfor_aux_complete = false;
-bool_ askfor_aux(char *buf, int len)
+bool askfor_aux(char *buf, int len)
{
int y, x;
@@ -2431,7 +2431,7 @@ bool_ askfor_aux(char *buf, int len)
int wid, hgt;
- bool_ done = FALSE;
+ bool done = false;
/* Locate the cursor */
@@ -2476,13 +2476,13 @@ bool_ askfor_aux(char *buf, int len)
{
case ESCAPE:
k = 0;
- done = TRUE;
+ done = true;
break;
case '\n':
case '\r':
k = strlen(buf);
- done = TRUE;
+ done = true;
break;
case '\t':
@@ -2530,17 +2530,17 @@ bool_ askfor_aux(char *buf, int len)
}
/* Aborted */
- if (i == ESCAPE) return (FALSE);
+ if (i == ESCAPE) return false;
/* Success */
- return (TRUE);
+ return true;
}
-bool_ askfor_aux_with_completion(char *buf, int len)
+bool askfor_aux_with_completion(char *buf, int len)
{
- askfor_aux_complete = TRUE;
- bool_ res = askfor_aux(buf, len);
- askfor_aux_complete = FALSE;
+ askfor_aux_complete = true;
+ bool res = askfor_aux(buf, len);
+ askfor_aux_complete = false;
return res;
}
@@ -2552,11 +2552,11 @@ bool_ askfor_aux_with_completion(char *buf, int len)
* Note that the initial contents of the string is used as
* the default response, so be sure to "clear" it if needed.
*
-* We clear the input, and return FALSE, on "ESCAPE".
+* We clear the input, and return false, on "ESCAPE".
*/
-bool_ get_string(const char *prompt, char *buf, int len)
+bool get_string(const char *prompt, char *buf, int len)
{
- bool_ res;
+ bool res;
/* Paranoia XXX XXX XXX */
msg_print(NULL);
@@ -2582,7 +2582,7 @@ bool_ get_string(const char *prompt, char *buf, int len)
*
* Note that "[y/n]" is appended to the prompt.
*/
-bool_ get_check(const char *prompt)
+bool get_check(const char *prompt)
{
int i;
@@ -2598,7 +2598,7 @@ bool_ get_check(const char *prompt)
prt(buf, 0, 0);
/* Get an acceptable answer */
- while (TRUE)
+ while (true)
{
i = inkey();
if (options->quick_messages) break;
@@ -2611,14 +2611,14 @@ bool_ get_check(const char *prompt)
prt("", 0, 0);
/* Normal negation */
- if ((i != 'Y') && (i != 'y')) return (FALSE);
+ if ((i != 'Y') && (i != 'y')) return false;
/* Success */
- return (TRUE);
+ return true;
}
-bool_ get_check(std::string const &prompt)
+bool get_check(std::string const &prompt)
{
return get_check(prompt.c_str());
}
@@ -2629,9 +2629,9 @@ bool_ get_check(std::string const &prompt)
*
* The "prompt" should take the form "Command: "
*
-* Returns TRUE unless the character is "Escape"
+* Returns true unless the character is "Escape"
*/
-bool_ get_com(const char *prompt, char *command)
+bool get_com(const char *prompt, char *command)
{
/* Paranoia XXX XXX XXX */
msg_print(NULL);
@@ -2646,10 +2646,10 @@ bool_ get_com(const char *prompt, char *command)
prt("", 0, 0);
/* Handle "cancel" */
- if (*command == ESCAPE) return (FALSE);
+ if (*command == ESCAPE) return false;
/* Success */
- return (TRUE);
+ return true;
}
@@ -2843,10 +2843,10 @@ void request_command(int shopping)
else
{
/* Hack -- no flush needed */
- msg_flag = FALSE;
+ msg_flag = false;
/* Activate "command mode" */
- inkey_flag = TRUE;
+ inkey_flag = true;
/* Get a command */
cmd = inkey();
@@ -2938,7 +2938,7 @@ void request_command(int shopping)
if ((cmd == ' ') || (cmd == '\n') || (cmd == '\r'))
{
/* Get a real command */
- bool_ temp = get_com("Command: ", &cmd_char);
+ bool temp = get_com("Command: ", &cmd_char);
cmd = cmd_char;
if (!temp)
@@ -3237,7 +3237,7 @@ static u32b get_number(u32b def, u32b max, int y, int x, char *cmd)
u32b res = def;
/* Player has not typed anything yet */
- bool_ no_keys = TRUE;
+ bool no_keys = true;
/* Begin the input with default */
prt(format("%lu", def), y, x);
@@ -3252,7 +3252,7 @@ static u32b get_number(u32b def, u32b max, int y, int x, char *cmd)
if ((*cmd == 0x7F) || (*cmd == KTRL('H')))
{
/* Override the default */
- no_keys = FALSE;
+ no_keys = false;
/* Delete a digit */
res = res / 10;
@@ -3266,7 +3266,7 @@ static u32b get_number(u32b def, u32b max, int y, int x, char *cmd)
/* Override the default */
if (no_keys)
{
- no_keys = FALSE;
+ no_keys = false;
res = 0;
}
@@ -3507,7 +3507,7 @@ int ask_menu(const char *ask, const std::vector<std::string> &items)
/* Save the screen */
screen_save_no_flush();
- while (TRUE)
+ while (true)
{
/* Display list */
screen_load_no_flush();
diff --git a/src/util.hpp b/src/util.hpp
index 0ec4beb1..54de07ed 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -60,12 +60,12 @@ void text_out_c(byte a, std::string const &str);
void clear_from(int row);
int ask_menu(const char *ask, const std::vector<std::string> &items);
bool askfor_aux(std::string *buf, std::size_t max_len);
-bool_ askfor_aux(char *buf, int len);
-bool_ askfor_aux_with_completion(char *buf, int len);
-bool_ get_string(const char *prompt, char *buf, int len);
-bool_ get_check(const char *prompt);
-bool_ get_check(std::string const &prompt);
-bool_ get_com(const char *prompt, char *command);
+bool askfor_aux(char *buf, int len);
+bool askfor_aux_with_completion(char *buf, int len);
+bool get_string(const char *prompt, char *buf, int len);
+bool get_check(const char *prompt);
+bool get_check(std::string const &prompt);
+bool get_com(const char *prompt, char *command);
s32b get_quantity(const char *prompt, s32b max);
extern char request_command_ignore_keymaps[MAX_IGNORE_KEYMAPS];
extern bool request_command_inven_mode;
diff --git a/src/variable.cc b/src/variable.cc
index 5aa45427..9a0fd49a 100644
--- a/src/variable.cc
+++ b/src/variable.cc
@@ -25,7 +25,7 @@ char *macro_trigger_keycode[2][MAX_MACRO_TRIG];
* Various things
*/
-bool_ character_generated; /* The character exists */
+bool character_generated; /* The character exists */
bool character_dungeon; /* The character has a dungeon */
bool character_loaded; /* The character was loaded from a savefile */
@@ -50,17 +50,17 @@ s16b command_new; /* Command chaining from inven/equip view */
s32b energy_use; /* Energy use this turn */
-bool_ create_up_stair; /* Auto-create "up stairs" */
-bool_ create_down_stair; /* Auto-create "down stairs" */
+bool create_up_stair; /* Auto-create "up stairs" */
+bool create_down_stair; /* Auto-create "down stairs" */
-bool_ create_up_shaft; /* Auto-create "up shaft" */
-bool_ create_down_shaft; /* Auto-create "down shaft" */
+bool create_up_shaft; /* Auto-create "up shaft" */
+bool create_down_shaft; /* Auto-create "down shaft" */
-bool_ msg_flag; /* Used in msg_print() for "buffering" */
+bool msg_flag; /* Used in msg_print() for "buffering" */
-bool_ alive; /* True if game is running */
+bool alive; /* True if game is running */
-bool_ death; /* True if player has died */
+bool death; /* True if player has died */
s16b running; /* Current counter for running, if any */
s16b resting; /* Current counter for resting, if any */
@@ -76,25 +76,25 @@ s16b monster_level; /* Current monster creation level */
s32b turn; /* Current game turn */
s32b old_turn; /* Turn when level began (feelings) */
-bool_ wizard; /* Is the player currently in Wizard mode? */
+bool wizard; /* Is the player currently in Wizard mode? */
u16b total_winner; /* Semi-Hack -- Game has been won */
u16b has_won; /* Semi-Hack -- Game has been won */
u16b noscore; /* Track various "cheating" conditions */
-bool_ inkey_base; /* See the "inkey()" function */
+bool inkey_base; /* See the "inkey()" function */
s16b coin_type; /* Hack -- force coin type */
-bool_ shimmer_monsters; /* Hack -- optimize multi-hued monsters */
-bool_ shimmer_objects; /* Hack -- optimize multi-hued objects */
+bool shimmer_monsters; /* Hack -- optimize multi-hued monsters */
+bool shimmer_objects; /* Hack -- optimize multi-hued objects */
-bool_ repair_monsters; /* Hack -- optimize detect monsters */
+bool repair_monsters; /* Hack -- optimize detect monsters */
-bool_ hack_mind;
+bool hack_mind;
int artifact_bias;
-bool_ is_autosave = FALSE;
+bool is_autosave = false;
s16b inven_cnt; /* Number of items in inventory */
s16b equip_cnt; /* Number of items in equipment */
@@ -146,7 +146,7 @@ struct options *options = nullptr;
s16b feeling; /* Most recent feeling */
s16b rating; /* Level's current rating */
-bool_ good_item_flag; /* True if "Artifact" on this level */
+bool good_item_flag; /* True if "Artifact" on this level */
/*
* Dungeon size info
@@ -231,7 +231,7 @@ char **macro__act;
/*
* Array of macro types [MACRO_MAX]
*/
-bool_ *macro__cmd;
+bool *macro__cmd;
/*
* Current macro action [1024]
@@ -488,16 +488,16 @@ u16b max_m_idx;
int init_flags;
/* True if on an ambush */
-bool_ ambush_flag;
+bool ambush_flag;
/* True if on fated level */
-bool_ fate_flag;
+bool fate_flag;
/* No breeders */
s16b no_breeds;
/* Carried monsters can't take the damage if this is them which attack the player */
-bool_ carried_monster_hit = FALSE;
+bool carried_monster_hit = false;
/*
* Random artifacts.
@@ -529,13 +529,13 @@ s16b *max_dlv;
s16b doppleganger;
/* To allow wilderness encounters */
-bool_ generate_encounter = FALSE;
+bool generate_encounter = false;
/*
* Such an ugly hack ...
*/
-bool_ *m_allow_special;
-bool_ *a_allow_special;
+bool *m_allow_special;
+bool *a_allow_special;
/*
* Plots
@@ -600,14 +600,14 @@ s32b DUNGEON_ASTRAL_WILD_Y = 19;
const char *get_version_string()
{
static char version_str[80];
- static bool_ initialized = 0;
+ static bool initialized = 0;
if (!initialized) {
sprintf(version_str, "%s %ld.%ld.%ld%s",
game_module,
(long int) VERSION_MAJOR,
(long int) VERSION_MINOR,
(long int) VERSION_PATCH, IS_CVS);
- initialized = TRUE;
+ initialized = true;
}
return version_str;
}
diff --git a/src/variable.hpp b/src/variable.hpp
index cdef5848..cf91137d 100644
--- a/src/variable.hpp
+++ b/src/variable.hpp
@@ -45,12 +45,12 @@ extern s16b command_dir;
extern s16b command_wrk;
extern s16b command_new;
extern s32b energy_use;
-extern bool_ create_up_stair;
-extern bool_ create_down_stair;
-extern bool_ create_up_shaft;
-extern bool_ create_down_shaft;
-extern bool_ alive;
-extern bool_ death;
+extern bool create_up_stair;
+extern bool create_down_stair;
+extern bool create_up_shaft;
+extern bool create_down_shaft;
+extern bool alive;
+extern bool death;
extern s16b running;
extern s16b resting;
extern s16b cur_hgt;
@@ -62,15 +62,15 @@ extern s16b object_level;
extern s16b monster_level;
extern s32b turn;
extern s32b old_turn;
-extern bool_ wizard;
+extern bool wizard;
extern u16b total_winner;
extern u16b has_won;
extern u16b noscore;
-extern bool_ inkey_base;
+extern bool inkey_base;
extern s16b coin_type;
-extern bool_ shimmer_monsters;
-extern bool_ shimmer_objects;
-extern bool_ repair_monsters;
+extern bool shimmer_monsters;
+extern bool shimmer_objects;
+extern bool repair_monsters;
extern s16b inven_cnt;
extern s16b equip_cnt;
extern s16b o_max;
@@ -82,15 +82,15 @@ extern int total_friends;
extern s32b total_friend_levels;
extern int leaving_quest;
extern char summon_kin_type;
-extern bool_ hack_mind;
-extern bool_ is_autosave;
+extern bool hack_mind;
+extern bool is_autosave;
extern int artifact_bias;
extern FILE *text_out_file;
extern void (*text_out_hook)(byte a, const char *str);
extern int text_out_indent;
extern s16b feeling;
extern s16b rating;
-extern bool_ good_item_flag;
+extern bool good_item_flag;
extern s16b max_panel_rows, max_panel_cols;
extern s16b panel_row_min, panel_row_max;
extern s16b panel_col_min, panel_col_max;
@@ -118,7 +118,7 @@ extern byte temp_x[TEMP_MAX];
extern s16b macro__num;
extern char **macro__pat;
extern char **macro__act;
-extern bool_ *macro__cmd;
+extern bool *macro__cmd;
extern char *macro__buf;
extern u32b window_flag[ANGBAND_TERM_MAX];
extern u32b window_mask[ANGBAND_TERM_MAX];
@@ -151,10 +151,10 @@ extern bool (*get_object_hook)(object_kind const *k_ptr);
extern u16b max_o_idx;
extern u16b max_m_idx;
extern int init_flags;
-extern bool_ ambush_flag;
-extern bool_ fate_flag;
+extern bool ambush_flag;
+extern bool fate_flag;
extern s16b no_breeds;
-extern bool_ carried_monster_hit;
+extern bool carried_monster_hit;
extern s32b RANDART_WEAPON;
extern s32b RANDART_ARMOR;
extern s32b RANDART_JEWEL;
@@ -162,9 +162,9 @@ extern fate fates[MAX_FATES];
extern byte dungeon_type;
extern s16b *max_dlv;
extern s16b doppleganger;
-extern bool_ generate_encounter;
-extern bool_ *m_allow_special;
-extern bool_ *a_allow_special;
+extern bool generate_encounter;
+extern bool *m_allow_special;
+extern bool *a_allow_special;
extern s16b plots[MAX_PLOTS];
extern random_quest random_quests[MAX_RANDOM_QUEST];
extern s16b schools_count;
@@ -201,7 +201,7 @@ extern char *ANGBAND_DIR_XTRA;
extern term *angband_term[ANGBAND_TERM_MAX];
extern char angband_term_name[ANGBAND_TERM_MAX][80];
extern byte angband_color_table[256][4];
-extern bool_ character_generated;
+extern bool character_generated;
extern bool character_icky;
-extern bool_ inkey_flag;
-extern bool_ msg_flag;
+extern bool inkey_flag;
+extern bool msg_flag;
diff --git a/src/wild.cc b/src/wild.cc
index a9a959bc..9de0f371 100644
--- a/src/wild.cc
+++ b/src/wild.cc
@@ -154,7 +154,7 @@ static void plasma_recursive(int x1, int y1, int x2, int y2,
*
* Return the number of floor grids
*/
-static int generate_area(int y, int x, bool_ border, bool_ corner)
+static int generate_area(int y, int x, bool border, bool corner)
{
auto const &wilderness = game->wilderness;
auto const &wf_info = game->edit_data.wf_info;
@@ -245,7 +245,7 @@ static int generate_area(int y, int x, bool_ border, bool_ corner)
/* Initialize the town */
init_flags = INIT_CREATE_DUNGEON;
- process_dungeon_file("t_info.txt", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("t_info.txt", &ystart, &xstart, cur_hgt, cur_wid, true, false);
}
else
{
@@ -379,13 +379,13 @@ void wilderness_gen()
auto const &f_info = game->edit_data.f_info;
int i, y, x, hack_floor;
- bool_ daytime;
+ bool daytime;
int xstart = 0;
int ystart = 0;
cave_type *c_ptr;
/* Init the wilderness */
- process_dungeon_file("w_info.txt", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("w_info.txt", &ystart, &xstart, cur_hgt, cur_wid, true, false);
x = p_ptr->wilderness_x;
y = p_ptr->wilderness_y;
@@ -397,7 +397,7 @@ void wilderness_gen()
get_mon_num_prep();
/* North border */
- generate_area(y - 1, x, TRUE, FALSE);
+ generate_area(y - 1, x, true, false);
for (i = 1; i < MAX_WID - 1; i++)
{
@@ -405,7 +405,7 @@ void wilderness_gen()
}
/* South border */
- generate_area(y + 1, x, TRUE, FALSE);
+ generate_area(y + 1, x, true, false);
for (i = 1; i < MAX_WID - 1; i++)
{
@@ -413,7 +413,7 @@ void wilderness_gen()
}
/* West border */
- generate_area(y, x - 1, TRUE, FALSE);
+ generate_area(y, x - 1, true, false);
for (i = 1; i < MAX_HGT - 1; i++)
{
@@ -421,7 +421,7 @@ void wilderness_gen()
}
/* East border */
- generate_area(y, x + 1, TRUE, FALSE);
+ generate_area(y, x + 1, true, false);
for (i = 1; i < MAX_HGT - 1; i++)
{
@@ -429,24 +429,24 @@ void wilderness_gen()
}
/* North west corner */
- generate_area(y - 1, x - 1, FALSE, TRUE);
+ generate_area(y - 1, x - 1, false, true);
border.north_west = cave[MAX_HGT - 2][MAX_WID - 2].feat;
/* North east corner */
- generate_area(y - 1, x + 1, FALSE, TRUE);
+ generate_area(y - 1, x + 1, false, true);
border.north_east = cave[MAX_HGT - 2][1].feat;
/* South west corner */
- generate_area(y + 1, x - 1, FALSE, TRUE);
+ generate_area(y + 1, x - 1, false, true);
border.south_west = cave[1][MAX_WID - 2].feat;
/* South east corner */
- generate_area(y + 1, x + 1, FALSE, TRUE);
+ generate_area(y + 1, x + 1, false, true);
border.south_east = cave[1][1].feat;
/* Create terrain of the current area */
- hack_floor = generate_area(y, x, FALSE, FALSE);
+ hack_floor = generate_area(y, x, false, false);
/* Special boundary walls -- North */
@@ -504,9 +504,9 @@ void wilderness_gen()
/* Day time */
if ((turn % (10L * DAY)) < ((10L * DAY) / 2))
- daytime = TRUE;
+ daytime = true;
else
- daytime = FALSE;
+ daytime = false;
/* Light up or darken the area */
for (y = 0; y < cur_hgt; y++)
@@ -542,7 +542,7 @@ void wilderness_gen()
player_place(p_ptr->oldpy, p_ptr->oldpx);
{
- int lim = (generate_encounter == TRUE) ? 60 : MIN_M_ALLOC_TN;
+ int lim = (generate_encounter == true) ? 60 : MIN_M_ALLOC_TN;
/*
* Can't have more monsters than floor grids -1(for the player,
@@ -554,11 +554,11 @@ void wilderness_gen()
for (i = 0; i < lim; i++)
{
/* Make a resident */
- alloc_monster((generate_encounter == TRUE) ? 0 : 3, (generate_encounter == TRUE) ? FALSE : TRUE);
+ alloc_monster((generate_encounter == true) ? 0 : 3, (generate_encounter == true) ? false : true);
}
- if (generate_encounter) ambush_flag = TRUE;
- generate_encounter = FALSE;
+ if (generate_encounter) ambush_flag = true;
+ generate_encounter = false;
}
/* Set rewarded quests to finished */
@@ -596,7 +596,7 @@ void wilderness_gen_small()
}
/* Init the wilderness */
- process_dungeon_file("w_info.txt", &ystart, &xstart, cur_hgt, cur_wid, TRUE, FALSE);
+ process_dungeon_file("w_info.txt", &ystart, &xstart, cur_hgt, cur_wid, true, false);
/* Fill the map */
for (std::size_t x = 0; x < wilderness.width(); x++)
@@ -675,7 +675,7 @@ void reveal_wilderness_around_player(int y, int x, int h, int w)
if (distance(y, x, j, i) >= w) continue;
/* New we know here */
- wilderness(i, j).known = TRUE;
+ wilderness(i, j).known = true;
/* Only if we are in overview */
if (p_ptr->wild_mode)
@@ -698,7 +698,7 @@ void reveal_wilderness_around_player(int y, int x, int h, int w)
if (!in_bounds(j, i)) continue;
/* New we know here */
- wilderness(i, j).known = TRUE;
+ wilderness(i, j).known = true;
/* Only if we are in overview */
if (p_ptr->wild_mode)
@@ -1039,9 +1039,9 @@ static void place_townspeople(int qy, int qx)
if (rand_int(100)) continue;
r_idx = get_mon_num(0);
- m_allow_special[r_idx] = TRUE;
- m_idx = place_monster_one(y, x, r_idx, 0, TRUE, MSTATUS_ENEMY);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ m_idx = place_monster_one(y, x, r_idx, 0, true, MSTATUS_ENEMY);
+ m_allow_special[r_idx] = false;
if (m_idx)
{
@@ -1221,7 +1221,7 @@ static void town_gen_hidden()
/* Find a good spot */
int x;
int y;
- while (TRUE)
+ while (true)
{
y = rand_range(1, cur_hgt - 2);
x = rand_range(1, cur_wid - 2);
diff --git a/src/wilderness_map.hpp b/src/wilderness_map.hpp
index 54b12e32..27f6d10b 100644
--- a/src/wilderness_map.hpp
+++ b/src/wilderness_map.hpp
@@ -11,5 +11,5 @@ struct wilderness_map
int feat = 0; /* Wilderness feature */
seed_t seed = seed_t::system(); /* Seed for the RNG when building tile */
u16b entrance = 0; /* Entrance for dungeons */
- bool_ known = FALSE; /* Is it seen by the player ? */
+ bool known = false; /* Is it seen by the player ? */
};
diff --git a/src/wizard2.cc b/src/wizard2.cc
index d2c37959..c86b9766 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -188,7 +188,7 @@ static void wiz_create_named_art()
/* Save the name */
q_ptr->name1 = a_idx;
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
/* Apply any random resistances/powers */
random_artifact_resistance(q_ptr);
@@ -418,7 +418,7 @@ static void wiz_display_item(object_type *o_ptr)
for (i = 1; i <= 23; i++) prt("", i, j - 2);
/* Describe fully */
- object_desc_store(buf, o_ptr, TRUE, 3);
+ object_desc_store(buf, o_ptr, true, 3);
prt(buf, 2, j);
@@ -716,7 +716,7 @@ static void wiz_reroll_item(object_type *o_ptr)
char ch;
- bool_ changed = FALSE;
+ bool changed = false;
/* Hack -- leave artifacts alone */
@@ -733,7 +733,7 @@ static void wiz_reroll_item(object_type *o_ptr)
/* Main loop. Ask for magification and artifactification */
- while (TRUE)
+ while (true)
{
/* Display full item debug information */
wiz_display_item(q_ptr);
@@ -741,14 +741,14 @@ static void wiz_reroll_item(object_type *o_ptr)
/* Ask wizard what to do. */
if (!get_com("[a]ccept, [b]ad, [n]ormal, [g]ood, [e]xcellent, [r]andart? ", &ch))
{
- changed = FALSE;
+ changed = false;
break;
}
/* Create/change it! */
if (ch == 'A' || ch == 'a')
{
- changed = TRUE;
+ changed = true;
break;
}
@@ -756,28 +756,28 @@ static void wiz_reroll_item(object_type *o_ptr)
else if (ch == 'b' || ch == 'B')
{
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, dun_level, FALSE, FALSE, FALSE, boost::make_optional(-2));
+ apply_magic(q_ptr, dun_level, false, false, false, boost::make_optional(-2));
}
/* Apply normal magic, but first clear object */
else if (ch == 'n' || ch == 'N')
{
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, dun_level, false, false, false);
}
/* Apply good magic, but first clear object */
else if (ch == 'g' || ch == 'g')
{
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, dun_level, FALSE, TRUE, FALSE);
+ apply_magic(q_ptr, dun_level, false, true, false);
}
/* Apply great magic, but first clear object */
else if (ch == 'e' || ch == 'e')
{
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, dun_level, FALSE, TRUE, TRUE);
+ apply_magic(q_ptr, dun_level, false, true, true);
}
/* Apply great magic, but first clear object */
@@ -833,7 +833,7 @@ static void wiz_statistics(object_type *o_ptr)
char ch;
const char *quality;
- bool_ good, great;
+ bool good, great;
object_type forge;
object_type *q_ptr;
@@ -845,7 +845,7 @@ static void wiz_statistics(object_type *o_ptr)
{
if (o_ptr->tval == TV_RANDART)
{
- random_artifacts[o_ptr->sval].generated = FALSE;
+ random_artifacts[o_ptr->sval].generated = false;
}
else
{
@@ -855,7 +855,7 @@ static void wiz_statistics(object_type *o_ptr)
/* Interact */
- while (TRUE)
+ while (true)
{
const char *pmt = "Roll for [n]ormal, [g]ood, or [e]xcellent treasure? ";
@@ -867,26 +867,26 @@ static void wiz_statistics(object_type *o_ptr)
if (ch == 'n' || ch == 'N')
{
- good = FALSE;
- great = FALSE;
+ good = false;
+ great = false;
quality = "normal";
}
else if (ch == 'g' || ch == 'G')
{
- good = TRUE;
- great = FALSE;
+ good = true;
+ great = false;
quality = "good";
}
else if (ch == 'e' || ch == 'E')
{
- good = TRUE;
- great = TRUE;
+ good = true;
+ great = true;
quality = "excellent";
}
else
{
- good = FALSE;
- great = FALSE;
+ good = false;
+ great = false;
break;
}
@@ -935,7 +935,7 @@ static void wiz_statistics(object_type *o_ptr)
{
if (q_ptr->tval == TV_RANDART)
{
- random_artifacts[q_ptr->sval].generated = FALSE;
+ random_artifacts[q_ptr->sval].generated = false;
}
else
{
@@ -993,7 +993,7 @@ static void wiz_statistics(object_type *o_ptr)
{
if (o_ptr->tval == TV_RANDART)
{
- random_artifacts[o_ptr->sval].generated = TRUE;
+ random_artifacts[o_ptr->sval].generated = true;
}
else
{
@@ -1055,11 +1055,11 @@ static void do_cmd_wiz_play()
/* The item was not changed */
- bool_ changed = FALSE;
+ bool changed = false;
/* Icky */
- character_icky = TRUE;
+ character_icky = true;
/* Save the screen */
Term_save();
@@ -1074,7 +1074,7 @@ static void do_cmd_wiz_play()
/* The main loop */
- while (TRUE)
+ while (true)
{
char ch;
@@ -1084,13 +1084,13 @@ static void do_cmd_wiz_play()
/* Get choice */
if (!get_com("[a]ccept [s]tatistics [r]eroll [t]weak [q]uantity apply[m]agic? ", &ch))
{
- changed = FALSE;
+ changed = false;
break;
}
if (ch == 'A' || ch == 'a')
{
- changed = TRUE;
+ changed = true;
break;
}
@@ -1121,7 +1121,7 @@ static void do_cmd_wiz_play()
object_prep(q_ptr, q_ptr->k_ptr->idx);
q_ptr->name2 = e;
q_ptr->name2b = eb;
- apply_magic(q_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, dun_level, false, false, false);
}
}
@@ -1130,7 +1130,7 @@ static void do_cmd_wiz_play()
Term_load();
/* Not Icky */
- character_icky = FALSE;
+ character_icky = false;
/* Accept change */
@@ -1178,7 +1178,7 @@ static void wiz_create_item()
/* Icky */
- character_icky = TRUE;
+ character_icky = true;
/* Save the screen */
Term_save();
@@ -1190,7 +1190,7 @@ static void wiz_create_item()
Term_load();
/* Not Icky */
- character_icky = FALSE;
+ character_icky = false;
/* Return if failed */
@@ -1203,7 +1203,7 @@ static void wiz_create_item()
object_prep(q_ptr, k_idx);
/* Apply magic (no messages, no artifacts) */
- apply_magic(q_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, dun_level, false, false, false);
/* Drop the object from heaven */
drop_near(q_ptr, -1, p_ptr->py, p_ptr->px);
@@ -1239,7 +1239,7 @@ static void wiz_create_item_2()
object_prep(q_ptr, k_idx);
/* Apply magic (no messages, no artifacts) */
- apply_magic(q_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(q_ptr, dun_level, false, false, false);
/* Drop the object from heaven */
drop_near(q_ptr, -1, p_ptr->py, p_ptr->px);
@@ -1260,12 +1260,12 @@ void do_cmd_wiz_cure_all()
remove_all_curse();
/* Restore stats */
- res_stat(A_STR, TRUE);
- res_stat(A_INT, TRUE);
- res_stat(A_WIS, TRUE);
- res_stat(A_CON, TRUE);
- res_stat(A_DEX, TRUE);
- res_stat(A_CHR, TRUE);
+ res_stat(A_STR, true);
+ res_stat(A_INT, true);
+ res_stat(A_WIS, true);
+ res_stat(A_CON, true);
+ res_stat(A_DEX, true);
+ res_stat(A_CHR, true);
/* Restore the level */
restore_level();
@@ -1380,7 +1380,7 @@ static void do_cmd_wiz_summon(int num)
*
* XXX XXX XXX This function is rather dangerous
*/
-static void do_cmd_wiz_named(std::size_t r_idx, bool_ slp)
+static void do_cmd_wiz_named(std::size_t r_idx, bool slp)
{
auto const &r_info = game->edit_data.r_info;
@@ -1404,9 +1404,9 @@ static void do_cmd_wiz_named(std::size_t r_idx, bool_ slp)
if (!cave_empty_bold(y, x)) continue;
/* Place it (allow groups) */
- m_allow_special[r_idx] = TRUE;
- int m_idx = place_monster_aux(y, x, r_idx, slp, TRUE, MSTATUS_ENEMY);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ int m_idx = place_monster_aux(y, x, r_idx, slp, true, MSTATUS_ENEMY);
+ m_allow_special[r_idx] = false;
// If summoning succeeded, we stop.
if (m_idx)
@@ -1422,7 +1422,7 @@ static void do_cmd_wiz_named(std::size_t r_idx, bool_ slp)
*
* XXX XXX XXX This function is rather dangerous
*/
-void do_cmd_wiz_named_friendly(std::size_t r_idx, bool_ slp)
+void do_cmd_wiz_named_friendly(std::size_t r_idx, bool slp)
{
auto const &r_info = game->edit_data.r_info;
@@ -1446,9 +1446,9 @@ void do_cmd_wiz_named_friendly(std::size_t r_idx, bool_ slp)
if (!cave_empty_bold(y, x)) continue;
/* Place it (allow groups) */
- m_allow_special[r_idx] = TRUE;
- int m_idx = place_monster_aux(y, x, r_idx, slp, TRUE, MSTATUS_PET);
- m_allow_special[r_idx] = FALSE;
+ m_allow_special[r_idx] = true;
+ int m_idx = place_monster_aux(y, x, r_idx, slp, true, MSTATUS_PET);
+ m_allow_special[r_idx] = false;
// Stop if we succeeded
if (m_idx)
@@ -1586,7 +1586,7 @@ void do_cmd_debug()
/* Good Objects */
case 'g':
if (command_arg <= 0) command_arg = 1;
- acquirement(p_ptr->py, p_ptr->px, command_arg, FALSE);
+ acquirement(p_ptr->py, p_ptr->px, command_arg, false);
break;
/* Hitpoint rerating */
@@ -1613,12 +1613,12 @@ void do_cmd_debug()
/* Summon _friendly_ named monster */
case 'N':
- do_cmd_wiz_named_friendly(command_arg, TRUE);
+ do_cmd_wiz_named_friendly(command_arg, true);
break;
/* Summon Named Monster */
case 'n':
- do_cmd_wiz_named(command_arg, TRUE);
+ do_cmd_wiz_named(command_arg, true);
break;
/* Object playing routines */
@@ -1662,7 +1662,7 @@ void do_cmd_debug()
case 'U':
{
p_ptr->necro_extra |= CLASS_UNDEAD;
- do_cmd_wiz_named(5, TRUE);
+ do_cmd_wiz_named(5, true);
p_ptr->necro_extra2 = 1;
@@ -1688,9 +1688,9 @@ void do_cmd_debug()
/* Teleport */
case 't':
- teleport_player_bypass = TRUE;
+ teleport_player_bypass = true;
teleport_player(100);
- teleport_player_bypass = FALSE;
+ teleport_player_bypass = false;
break;
/* Teleport to a town */
@@ -1702,7 +1702,7 @@ void do_cmd_debug()
/* Very Good Objects */
case 'v':
if (command_arg <= 0) command_arg = 1;
- acquirement(p_ptr->py, p_ptr->px, command_arg, TRUE);
+ acquirement(p_ptr->py, p_ptr->px, command_arg, true);
break;
/* Wizard Light the Level */
@@ -1748,7 +1748,7 @@ void do_cmd_debug()
int i;
gain_fate(command_arg);
for (i = 0; i < MAX_FATES; i++)
- fates[i].know = TRUE;
+ fates[i].know = true;
break;
}
diff --git a/src/wizard2.hpp b/src/wizard2.hpp
index 13eab608..cd477d1f 100644
--- a/src/wizard2.hpp
+++ b/src/wizard2.hpp
@@ -6,5 +6,5 @@
void do_cmd_rerate();
void do_cmd_wiz_cure_all();
-void do_cmd_wiz_named_friendly(std::size_t r_idx, bool_ slp);
+void do_cmd_wiz_named_friendly(std::size_t r_idx, bool slp);
void do_cmd_debug();
diff --git a/src/xtra1.cc b/src/xtra1.cc
index a13361a7..adf529bd 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -1217,7 +1217,7 @@ static void fix_object()
/* Display object info */
if (tracked_object &&
- !object_out_desc(tracked_object, NULL, FALSE, FALSE))
+ !object_out_desc(tracked_object, NULL, false, false))
{
text_out("You see nothing special.");
}
@@ -2088,7 +2088,7 @@ void calc_body()
if ((!p_ptr->body_parts[i]) && p_ptr->inventory[i + INVEN_WIELD].k_ptr)
{
/* Drop it NOW ! */
- inven_takeoff(i + INVEN_WIELD, 255, TRUE);
+ inven_takeoff(i + INVEN_WIELD, 255, true);
}
}
}
@@ -2637,11 +2637,11 @@ static void apply_lflags(LF const &lflags)
/**
* Are barehand fighter's hands empty?
*/
-static bool_ monk_empty_hands()
+static bool monk_empty_hands()
{
if (p_ptr->melee_style != SKILL_HAND)
{
- return FALSE;
+ return false;
}
for (int i = 0; p_ptr->body_parts[i] == INVEN_WIELD; i++)
@@ -2650,11 +2650,11 @@ static bool_ monk_empty_hands()
if (o_ptr->k_ptr)
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
@@ -2678,7 +2678,7 @@ static bool_ monk_empty_hands()
* are actually added in later, at the appropriate place.
*
* This function induces various "status" messages, unless silent is
- * TRUE.
+ * true.
*/
void calc_bonuses(bool silent)
{
@@ -2687,14 +2687,14 @@ void calc_bonuses(bool silent)
auto &s_info = game->s_info;
auto const &a_info = game->edit_data.a_info;
- static bool_ monk_notify_aux = FALSE;
+ static bool monk_notify_aux = false;
int i, j, hold;
int old_speed;
bool old_see_inv;
int old_dis_ac;
int old_dis_to_a;
object_type *o_ptr;
- bool_ monk_armour_aux;
+ bool monk_armour_aux;
/* Save the old computed_flags */
@@ -2957,9 +2957,9 @@ void calc_bonuses(bool silent)
}
/* Extract the item flags */
- object_flags_no_set = TRUE;
+ object_flags_no_set = true;
auto flags = object_flags(o_ptr);
- object_flags_no_set = FALSE;
+ object_flags_no_set = false;
/* MEGA ugly hack -- set spacetime distortion resistance */
if (o_ptr->name1 == ART_ANCHOR)
@@ -3431,7 +3431,7 @@ void calc_bonuses(bool silent)
/* Assume not heavy */
- p_ptr->heavy_shoot = FALSE;
+ p_ptr->heavy_shoot = false;
/* It is hard to carholdry a heavy bow */
if (hold < o_ptr->weight / 10)
@@ -3441,7 +3441,7 @@ void calc_bonuses(bool silent)
p_ptr->dis_to_h += 2 * (hold - o_ptr->weight / 10);
/* Heavy Bow */
- p_ptr->heavy_shoot = TRUE;
+ p_ptr->heavy_shoot = true;
}
/* Take note of required "tval" for missiles */
@@ -3656,7 +3656,7 @@ void calc_bonuses(bool silent)
/* Assume okay */
p_ptr->icky_wield = false;
- monk_armour_aux = FALSE;
+ monk_armour_aux = false;
if (get_weaponmastery_skill() != -1)
{
@@ -3784,7 +3784,7 @@ void calc_bonuses(bool silent)
if (monk_heavy_armor())
{
- monk_armour_aux = TRUE;
+ monk_armour_aux = true;
}
/* Affect Skill -- stealth (bonus one) */
@@ -4051,13 +4051,13 @@ void update_stuff()
{
p_ptr->update &= ~(PU_DISTANCE);
p_ptr->update &= ~(PU_MONSTERS);
- update_monsters(TRUE);
+ update_monsters(true);
}
if (p_ptr->update & (PU_MONSTERS))
{
p_ptr->update &= ~(PU_MONSTERS);
- update_monsters(FALSE);
+ update_monsters(false);
}
if (p_ptr->update & (PU_MON_LITE))
@@ -4336,7 +4336,7 @@ void gain_fate(byte fate)
{
case FATE_FIND_O:
{
- while (TRUE)
+ while (true)
{
obj_theme theme;
@@ -4369,7 +4369,7 @@ void gain_fate(byte fate)
level = rand_range(max_dlv[dungeon_type] - 20, max_dlv[dungeon_type] + 20);
fates[i].level = (level < 1) ? 1 : (level > 98) ? 98 : level;
fates[i].serious = rand_int(2);
- fates[i].know = FALSE;
+ fates[i].know = false;
if (wizard) msg_format("New fate : Find object %d on level %d", fates[i].o_idx, fates[i].level);
break;
}
@@ -4381,7 +4381,7 @@ void gain_fate(byte fate)
level = rand_range(max_dlv[dungeon_type] - 20, max_dlv[dungeon_type] + 20);
fates[i].level = (level < 1) ? 1 : (level > 98) ? 98 : level;
fates[i].serious = rand_int(2);
- fates[i].know = FALSE;
+ fates[i].know = false;
if (wizard) msg_format("New fate : Meet monster %d on level %d", fates[i].r_idx, fates[i].level);
break;
@@ -4389,21 +4389,21 @@ void gain_fate(byte fate)
fates[i].a_idx = get_artifact_idx(max_dlv[dungeon_type] + randint(10));
level = rand_range(max_dlv[dungeon_type] - 20, max_dlv[dungeon_type] + 20);
fates[i].level = (level < 1) ? 1 : (level > 98) ? 98 : level;
- fates[i].serious = TRUE;
- fates[i].know = FALSE;
+ fates[i].serious = true;
+ fates[i].know = false;
if (wizard) msg_format("New fate : Find artifact %d on level %d", fates[i].a_idx, fates[i].level);
break;
case FATE_DIE:
level = rand_range(max_dlv[dungeon_type] - 20, max_dlv[dungeon_type] + 20);
fates[i].level = (level < 1) ? 1 : (level > 98) ? 98 : level;
- fates[i].serious = TRUE;
- fates[i].know = FALSE;
+ fates[i].serious = true;
+ fates[i].know = false;
if ((wizard) || (p_ptr->precognition)) msg_format("New fate : Death on level %d", fates[i].level);
break;
case FATE_NO_DIE_MORTAL:
- fates[i].serious = TRUE;
+ fates[i].serious = true;
p_ptr->no_mortal = true;
if ((wizard) || (p_ptr->precognition)) msg_format("New fate : Never to die by the hand of a mortal being.");
break;
@@ -4523,7 +4523,7 @@ std::string fate_desc(int fate)
std::string dump_fates()
{
- bool_ pending = FALSE;
+ bool pending = false;
fmt::MemoryWriter w;
diff --git a/src/xtra2.cc b/src/xtra2.cc
index 9d3968f6..97bdca34 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -73,9 +73,9 @@ static void corrupt_corrupted();
* Set "p_ptr->parasite" and "p_ptr->parasite_r_idx"
* notice observable changes
*/
-bool_ set_parasite(int v, int r)
+bool set_parasite(int v, int r)
{
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -86,7 +86,7 @@ bool_ set_parasite(int v, int r)
if (!p_ptr->parasite)
{
msg_print("You feel something growing in you.");
- notice = TRUE;
+ notice = true;
}
}
@@ -109,7 +109,7 @@ bool_ set_parasite(int v, int r)
}
while (!(in_bounds(wy, wx) && cave_floor_bold(wy, wx)) && --attempts);
- if (place_monster_one(wy, wx, p_ptr->parasite_r_idx, 0, FALSE, MSTATUS_ENEMY))
+ if (place_monster_one(wy, wx, p_ptr->parasite_r_idx, 0, false, MSTATUS_ENEMY))
{
cmsg_format(TERM_L_BLUE, "Your body convulses and spawns %s.", r_name);
p_ptr->food -= 750;
@@ -120,7 +120,7 @@ bool_ set_parasite(int v, int r)
{
cmsg_print(TERM_L_BLUE, "The hideous thing growing in you seems to die.");
}
- notice = TRUE;
+ notice = true;
}
}
@@ -129,7 +129,7 @@ bool_ set_parasite(int v, int r)
p_ptr->parasite_r_idx = r;
/* Nothing to notice */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -138,13 +138,13 @@ bool_ set_parasite(int v, int r)
p_ptr->update |= (PU_BONUS);
/* Result */
- return (TRUE);
+ return true;
}
/*
* Set a simple player field.
*/
-static bool_ set_simple_field(
+static bool set_simple_field(
s16b *p_field,
s16b v,
byte activate_color,
@@ -152,7 +152,7 @@ static bool_ set_simple_field(
byte deactivate_color,
const char *deactivate_msg)
{
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -163,7 +163,7 @@ static bool_ set_simple_field(
if (!*p_field)
{
cmsg_print(activate_color, activate_msg);
- notice = TRUE;
+ notice = true;
}
}
@@ -173,7 +173,7 @@ static bool_ set_simple_field(
if (*p_field)
{
cmsg_print(deactivate_color, deactivate_msg);
- notice = TRUE;
+ notice = true;
}
}
@@ -182,7 +182,7 @@ static bool_ set_simple_field(
/* Nothing to notice */
if (!notice)
- return (FALSE);
+ return false;
/* Disturb */
disturb_on_state();
@@ -191,16 +191,16 @@ static bool_ set_simple_field(
p_ptr->update |= (PU_BONUS);
/* Result */
- return (TRUE);
+ return true;
}
/*
* Set "p_ptr->tim_project" and others
* notice observable changes
*/
-bool_ set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag)
+bool set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_project, v,
TERM_WHITE, "Your weapon starts glowing.",
TERM_WHITE, "Your weapon stops glowing.");
@@ -219,9 +219,9 @@ bool_ set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag)
* Set "p_ptr->tim_roots" and others
* notice observable changes
*/
-bool_ set_roots(int v, s16b ac, s16b dam)
+bool set_roots(int v, s16b ac, s16b dam)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_roots, v,
TERM_WHITE, "Roots dive into the floor from your feet.",
TERM_WHITE, "The roots of your feet suddenly vanish.");
@@ -238,7 +238,7 @@ bool_ set_roots(int v, s16b ac, s16b dam)
* Set "p_ptr->tim_(magic|water)_breath" and others
* notice observable changes
*/
-bool_ set_tim_breath(int v, bool_ magical)
+bool set_tim_breath(int v, bool magical)
{
if (magical)
{
@@ -259,7 +259,7 @@ bool_ set_tim_breath(int v, bool_ magical)
/*
* Set timered precognition
*/
-bool_ set_tim_precognition(int v)
+bool set_tim_precognition(int v)
{
return set_simple_field(
&p_ptr->tim_precognition, v,
@@ -271,7 +271,7 @@ bool_ set_tim_precognition(int v)
* Set "p_ptr->absorb_soul"
* notice observable changes
*/
-bool_ set_absorb_soul(int v)
+bool set_absorb_soul(int v)
{
return set_simple_field(
&p_ptr->absorb_soul, v,
@@ -283,7 +283,7 @@ bool_ set_absorb_soul(int v)
* Set "p_ptr->disrupt_shield"
* notice observable changes
*/
-bool_ set_disrupt_shield(int v)
+bool set_disrupt_shield(int v)
{
return set_simple_field(
&p_ptr->disrupt_shield, v,
@@ -295,7 +295,7 @@ bool_ set_disrupt_shield(int v)
* Set "p_ptr->prob_travel"
* notice observable changes
*/
-bool_ set_prob_travel(int v)
+bool set_prob_travel(int v)
{
return set_simple_field(
&p_ptr->prob_travel, v,
@@ -307,9 +307,9 @@ bool_ set_prob_travel(int v)
* Set "p_ptr->tim_invis", and "p_ptr->tim_inv_pow",
* notice observable changes
*/
-bool_ set_invis(int v, int p)
+bool set_invis(int v, int p)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_invisible, v,
TERM_WHITE, "You feel your body fade away.",
TERM_WHITE, "You are no longer invisible.");
@@ -325,7 +325,7 @@ bool_ set_invis(int v, int p)
* Set "p_ptr->tim_poison",
* notice observable changes
*/
-bool_ set_poison(int v)
+bool set_poison(int v)
{
return set_simple_field(
&p_ptr->tim_poison, v,
@@ -336,7 +336,7 @@ bool_ set_poison(int v)
/*
* Set "no_breeds"
*/
-bool_ set_no_breeders(int v)
+bool set_no_breeders(int v)
{
return set_simple_field(
&no_breeds, v,
@@ -347,7 +347,7 @@ bool_ set_no_breeders(int v)
/*
* Set "p_ptr->tim_deadly"
*/
-bool_ set_tim_deadly(int v)
+bool set_tim_deadly(int v)
{
return set_simple_field(
&p_ptr->tim_deadly, v,
@@ -358,7 +358,7 @@ bool_ set_tim_deadly(int v)
/*
* Set "p_ptr->tim_ffall"
*/
-bool_ set_tim_ffall(int v)
+bool set_tim_ffall(int v)
{
return set_simple_field(
&p_ptr->tim_ffall, v,
@@ -369,7 +369,7 @@ bool_ set_tim_ffall(int v)
/*
* Set "p_ptr->tim_fly"
*/
-bool_ set_tim_fly(int v)
+bool set_tim_fly(int v)
{
return set_simple_field(
&p_ptr->tim_fly, v,
@@ -380,7 +380,7 @@ bool_ set_tim_fly(int v)
/*
* Set "p_ptr->tim_reflect"
*/
-bool_ set_tim_reflect(int v)
+bool set_tim_reflect(int v)
{
return set_simple_field(
&p_ptr->tim_reflect, v,
@@ -391,7 +391,7 @@ bool_ set_tim_reflect(int v)
/*
* Set "p_ptr->strike"
*/
-bool_ set_strike(int v)
+bool set_strike(int v)
{
return set_simple_field(
&p_ptr->strike, v,
@@ -402,7 +402,7 @@ bool_ set_strike(int v)
/*
* Set "p_ptr->oppose_cc"
*/
-bool_ set_oppose_cc(int v)
+bool set_oppose_cc(int v)
{
return set_simple_field(
&p_ptr->oppose_cc, v,
@@ -414,11 +414,11 @@ bool_ set_oppose_cc(int v)
* Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
* notice observable changes
*/
-bool_ set_mimic(int v, int p, int level)
+bool set_mimic(int v, int p, int level)
{
auto &s_info = game->s_info;
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -430,7 +430,7 @@ bool_ set_mimic(int v, int p, int level)
{
msg_print("You feel your body change.");
p_ptr->mimic_form = p;
- notice = TRUE;
+ notice = true;
}
}
@@ -441,7 +441,7 @@ bool_ set_mimic(int v, int p, int level)
{
msg_print("You are no longer transformed.");
p_ptr->mimic_form = 0;
- notice = TRUE;
+ notice = true;
if (p == resolve_mimic_name("Bear"))
{
s_info[SKILL_BEAR].hidden = true;
@@ -456,7 +456,7 @@ bool_ set_mimic(int v, int p, int level)
p_ptr->mimic_level = level;
/* Nothing to notice */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -468,7 +468,7 @@ bool_ set_mimic(int v, int p, int level)
p_ptr->update |= (PU_BODY | PU_BONUS | PU_SANITY);
/* Result */
- return (TRUE);
+ return true;
}
/*
@@ -479,9 +479,9 @@ bool_ set_mimic(int v, int p, int level)
* Note that blindness is currently the only thing which can affect
* "player_can_see_bold()".
*/
-bool_ set_blind(int v)
+bool set_blind(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->blind, v,
TERM_WHITE, "You are blind!",
TERM_WHITE, "You can see again.");
@@ -516,9 +516,9 @@ bool_ set_blind(int v)
* Note that blindness is currently the only thing which can affect
* "player_can_see_bold()".
*/
-bool_ set_lite(int v)
+bool set_lite(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_lite, v,
TERM_WHITE, "You suddenly seem brighter!",
TERM_WHITE, "You are no longer bright.");
@@ -545,9 +545,9 @@ bool_ set_lite(int v)
/*
* Set "p_ptr->confused", notice observable changes
*/
-bool_ set_confused(int v)
+bool set_confused(int v)
{
- bool_ notice =
+ bool notice =
set_simple_field(
&p_ptr->confused, v,
TERM_WHITE, "You are confused!",
@@ -570,9 +570,9 @@ bool_ set_confused(int v)
/*
* Set "p_ptr->poisoned", notice observable changes
*/
-bool_ set_poisoned(int v)
+bool set_poisoned(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->poisoned, v,
TERM_WHITE, "You are poisoned!",
TERM_WHITE, "You are no longer poisoned.");
@@ -594,9 +594,9 @@ bool_ set_poisoned(int v)
/*
* Set "p_ptr->afraid", notice observable changes
*/
-bool_ set_afraid(int v)
+bool set_afraid(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->afraid, v,
TERM_WHITE, "You are terrified!",
TERM_WHITE, "You feel bolder now.");
@@ -618,9 +618,9 @@ bool_ set_afraid(int v)
/*
* Mechanics for setting the "paralyzed" field.
*/
-static bool_ set_paralyzed_aux(int v)
+static bool set_paralyzed_aux(int v)
{
- bool_ notice;
+ bool notice;
/* Normal processing */
notice = set_simple_field(
@@ -644,7 +644,7 @@ static bool_ set_paralyzed_aux(int v)
/*
* Set "p_ptr->paralyzed", notice observable changes
*/
-bool_ set_paralyzed(int v)
+bool set_paralyzed(int v)
{
/* Paralysis effects do not accumulate -- this is to
prevent the uninteresting insta-death effect, but
@@ -652,7 +652,7 @@ bool_ set_paralyzed(int v)
faster than the player. */
if (p_ptr->paralyzed > 0) {
- return FALSE;
+ return false;
}
/* Normal processing */
@@ -673,9 +673,9 @@ void dec_paralyzed()
*
* Note that we must redraw the map when hallucination changes.
*/
-bool_ set_image(int v)
+bool set_image(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->image, v,
TERM_WHITE, "Oh, wow! Everything looks so cosmic now!",
TERM_WHITE, "You can see clearly again.");
@@ -702,9 +702,9 @@ bool_ set_image(int v)
/*
* Set "p_ptr->lightspeed", notice observable changes
*/
-bool_ set_light_speed(int v)
+bool set_light_speed(int v)
{
- bool_ notice =
+ bool notice =
set_simple_field(
&p_ptr->lightspeed, v,
TERM_WHITE, "You feel as if time has stopped!",
@@ -720,9 +720,9 @@ bool_ set_light_speed(int v)
return notice;
}
-bool_ set_fast(int v, int p)
+bool set_fast(int v, int p)
{
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -733,7 +733,7 @@ bool_ set_fast(int v, int p)
if (!p_ptr->fast)
{
msg_print("You feel yourself moving faster!");
- notice = TRUE;
+ notice = true;
}
}
@@ -744,7 +744,7 @@ bool_ set_fast(int v, int p)
{
msg_print("You feel yourself slow down.");
p = 0;
- notice = TRUE;
+ notice = true;
}
}
@@ -753,7 +753,7 @@ bool_ set_fast(int v, int p)
p_ptr->speed_factor = p;
/* Nothing to notice */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -765,16 +765,16 @@ bool_ set_fast(int v, int p)
handle_stuff();
/* Result */
- return (TRUE);
+ return true;
}
/*
* Set "p_ptr->slow", notice observable changes
*/
-bool_ set_slow(int v)
+bool set_slow(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->slow, v,
TERM_WHITE, "You feel yourself moving slower!",
TERM_WHITE, "You feel yourself speed up.");
@@ -793,9 +793,9 @@ bool_ set_slow(int v)
/*
* Set "p_ptr->shield", notice observable changes
*/
-bool_ set_shield(int v, int p, s16b o, s16b d1, s16b d2)
+bool set_shield(int v, int p, s16b o, s16b d1, s16b d2)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->shield, v,
TERM_WHITE, "A mystic shield forms around your body!",
TERM_WHITE, "Your mystic shield crumbles away.");
@@ -822,9 +822,9 @@ bool_ set_shield(int v, int p, s16b o, s16b d1, s16b d2)
/*
* Set "p_ptr->blessed", notice observable changes
*/
-bool_ set_blessed(int v)
+bool set_blessed(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->blessed, v,
TERM_WHITE, "You feel righteous!",
TERM_WHITE, "The prayer has expired.");
@@ -843,9 +843,9 @@ bool_ set_blessed(int v)
/*
* Set "p_ptr->hero", notice observable changes
*/
-bool_ set_hero(int v)
+bool set_hero(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->hero, v,
TERM_WHITE, "You feel like a hero!",
TERM_WHITE, "The heroism wears off.");
@@ -866,9 +866,9 @@ bool_ set_hero(int v)
/*
* Set "p_ptr->holy", notice observable changes
*/
-bool_ set_holy(int v)
+bool set_holy(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->holy, v,
TERM_WHITE, "You feel a holy aura around you!",
TERM_WHITE, "The holy aura vanishes.");
@@ -886,9 +886,9 @@ bool_ set_holy(int v)
/*
* Set "p_ptr->shero", notice observable changes
*/
-bool_ set_shero(int v)
+bool set_shero(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->shero, v,
TERM_WHITE, "You feel like a killing machine!",
TERM_WHITE, "You feel less berserk.");
@@ -916,9 +916,9 @@ bool_ set_shero(int v)
/*
* Set "p_ptr->protevil", notice observable changes
*/
-bool_ set_protevil(int v)
+bool set_protevil(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->protevil, v,
TERM_WHITE, "You feel safe from evil!",
TERM_WHITE, "You no longer feel safe from evil.");
@@ -936,9 +936,9 @@ bool_ set_protevil(int v)
/*
* Set "p_ptr->set_shadow", notice observable changes
*/
-bool_ set_shadow(int v)
+bool set_shadow(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_wraith, v,
TERM_WHITE, "You leave the physical world and turn into a wraith-being!",
TERM_WHITE, "You feel opaque.");
@@ -968,9 +968,9 @@ bool_ set_shadow(int v)
/*
* Set "p_ptr->invuln", notice observable changes
*/
-bool_ set_invuln(int v)
+bool set_invuln(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->invuln, v,
TERM_L_BLUE, "Invulnerability!",
TERM_L_RED, "The invulnerability wears off.");
@@ -999,9 +999,9 @@ bool_ set_invuln(int v)
/*
* Set "p_ptr->tim_esp", notice observable changes
*/
-bool_ set_tim_esp(int v)
+bool set_tim_esp(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_esp, v,
TERM_WHITE, "You feel your consciousness expand!",
TERM_WHITE, "Your consciousness contracts again.");
@@ -1022,9 +1022,9 @@ bool_ set_tim_esp(int v)
/*
* Set "p_ptr->tim_thunder", notice observable changes
*/
-bool_ set_tim_thunder(int v, int p1, int p2)
+bool set_tim_thunder(int v, int p1, int p2)
{
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -1035,7 +1035,7 @@ bool_ set_tim_thunder(int v, int p1, int p2)
if (!p_ptr->tim_thunder)
{
msg_print("The air around you charges with lightning!");
- notice = TRUE;
+ notice = true;
}
}
@@ -1045,7 +1045,7 @@ bool_ set_tim_thunder(int v, int p1, int p2)
if (p_ptr->tim_thunder)
{
msg_print("The air around you discharges.");
- notice = TRUE;
+ notice = true;
p1 = p2 = 0;
}
}
@@ -1056,7 +1056,7 @@ bool_ set_tim_thunder(int v, int p1, int p2)
p_ptr->tim_thunder_p2 = p2;
/* Nothing to notice */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -1071,15 +1071,15 @@ bool_ set_tim_thunder(int v, int p1, int p2)
handle_stuff();
/* Result */
- return (TRUE);
+ return true;
}
/*
* Set "p_ptr->tim_invis", notice observable changes
*/
-bool_ set_tim_invis(int v)
+bool set_tim_invis(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_invis, v,
TERM_WHITE, "Your eyes feel very sensitive!",
TERM_WHITE, "Your eyes feel less sensitive.");
@@ -1101,9 +1101,9 @@ bool_ set_tim_invis(int v)
/*
* Set "p_ptr->tim_infra", notice observable changes
*/
-bool_ set_tim_infra(int v)
+bool set_tim_infra(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->tim_infra, v,
TERM_WHITE, "Your eyes begin to tingle!",
TERM_WHITE, "Your eyes stop tingling.");
@@ -1125,9 +1125,9 @@ bool_ set_tim_infra(int v)
/*
* Set "p_ptr->oppose_acid", notice observable changes
*/
-bool_ set_oppose_acid(int v)
+bool set_oppose_acid(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->oppose_acid, v,
TERM_WHITE, "You feel resistant to acid!",
TERM_WHITE, "You feel less resistant to acid.");
@@ -1146,9 +1146,9 @@ bool_ set_oppose_acid(int v)
/*
* Set "p_ptr->oppose_elec", notice observable changes
*/
-bool_ set_oppose_elec(int v)
+bool set_oppose_elec(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->oppose_elec, v,
TERM_WHITE, "You feel resistant to electricity!",
TERM_WHITE, "You feel less resistant to electricity.");
@@ -1167,9 +1167,9 @@ bool_ set_oppose_elec(int v)
/*
* Set "p_ptr->oppose_fire", notice observable changes
*/
-bool_ set_oppose_fire(int v)
+bool set_oppose_fire(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->oppose_fire, v,
TERM_WHITE, "You feel resistant to fire!",
TERM_WHITE, "You feel less resistant to fire.");
@@ -1188,9 +1188,9 @@ bool_ set_oppose_fire(int v)
/*
* Set "p_ptr->oppose_cold", notice observable changes
*/
-bool_ set_oppose_cold(int v)
+bool set_oppose_cold(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->oppose_cold, v,
TERM_WHITE, "You feel resistant to cold!",
TERM_WHITE, "You feel less resistant to cold.");
@@ -1209,9 +1209,9 @@ bool_ set_oppose_cold(int v)
/*
* Set "p_ptr->oppose_pois", notice observable changes
*/
-bool_ set_oppose_pois(int v)
+bool set_oppose_pois(int v)
{
- bool_ notice = set_simple_field(
+ bool notice = set_simple_field(
&p_ptr->oppose_pois, v,
TERM_WHITE, "You feel resistant to poison!",
TERM_WHITE, "You feel less resistant to poison.");
@@ -1230,9 +1230,9 @@ bool_ set_oppose_pois(int v)
/*
* Set "p_ptr->tim_regen", notice observable changes
*/
-bool_ set_tim_regen(int v, int p)
+bool set_tim_regen(int v, int p)
{
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -1243,7 +1243,7 @@ bool_ set_tim_regen(int v, int p)
if (!p_ptr->tim_regen)
{
msg_print("Your body regenerates much more quickly!");
- notice = TRUE;
+ notice = true;
}
}
@@ -1254,7 +1254,7 @@ bool_ set_tim_regen(int v, int p)
{
p = 0;
msg_print("Your body regenerates much more slowly.");
- notice = TRUE;
+ notice = true;
}
}
@@ -1263,7 +1263,7 @@ bool_ set_tim_regen(int v, int p)
p_ptr->tim_regen_pow = p;
/* Nothing to notice */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -1272,7 +1272,7 @@ bool_ set_tim_regen(int v, int p)
handle_stuff();
/* Result */
- return (TRUE);
+ return true;
}
@@ -1281,10 +1281,10 @@ bool_ set_tim_regen(int v, int p)
*
* Note the special code to only notice "range" changes.
*/
-bool_ set_stun(int v)
+bool set_stun(int v)
{
int old_aux, new_aux;
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
@@ -1394,7 +1394,7 @@ bool_ set_stun(int v)
}
/* Notice */
- notice = TRUE;
+ notice = true;
}
/* Decrease cut */
@@ -1411,14 +1411,14 @@ bool_ set_stun(int v)
}
/* Notice */
- notice = TRUE;
+ notice = true;
}
/* Use the value */
p_ptr->stun = v;
/* No change */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -1433,7 +1433,7 @@ bool_ set_stun(int v)
handle_stuff();
/* Result */
- return (TRUE);
+ return true;
}
@@ -1442,11 +1442,11 @@ bool_ set_stun(int v)
*
* Note the special code to only notice "range" changes.
*/
-bool_ set_cut(int v)
+bool set_cut(int v)
{
int old_aux, new_aux;
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -1592,7 +1592,7 @@ bool_ set_cut(int v)
}
/* Notice */
- notice = TRUE;
+ notice = true;
if (randint(1000) < v || randint(16) == 1)
{
@@ -1619,14 +1619,14 @@ bool_ set_cut(int v)
}
/* Notice */
- notice = TRUE;
+ notice = true;
}
/* Use the value */
p_ptr->cut = v;
/* No change */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -1641,7 +1641,7 @@ bool_ set_cut(int v)
handle_stuff();
/* Result */
- return (TRUE);
+ return true;
}
void drop_from_wild()
@@ -1681,11 +1681,11 @@ void drop_from_wild()
* game turns, or 500/(100/5) = 25 player turns (if nothing else is
* affecting the player speed).
*/
-bool_ set_food(int v)
+bool set_food(int v)
{
int old_aux, new_aux;
- bool_ notice = FALSE;
+ bool notice = false;
/* Hack -- Force good values */
v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
@@ -1795,7 +1795,7 @@ bool_ set_food(int v)
}
/* Change */
- notice = TRUE;
+ notice = true;
}
/* Food decrease */
@@ -1833,14 +1833,14 @@ bool_ set_food(int v)
}
/* Change */
- notice = TRUE;
+ notice = true;
}
/* Use the value */
p_ptr->food = v;
/* Nothing to notice */
- if (!notice) return (FALSE);
+ if (!notice) return false;
/* Disturb */
disturb_on_state();
@@ -1855,7 +1855,7 @@ bool_ set_food(int v)
handle_stuff();
/* Result */
- return (TRUE);
+ return true;
}
@@ -1865,7 +1865,7 @@ bool_ set_food(int v)
void check_experience()
{
int gained = 0;
- bool_ level_corruption = FALSE;
+ bool level_corruption = false;
/* Hack -- lower limit */
@@ -1929,7 +1929,7 @@ void check_experience()
if ((race_flags_p(PR_CORRUPT)) &&
(randint(3) == 1))
{
- level_corruption = TRUE;
+ level_corruption = true;
}
}
@@ -1972,7 +1972,7 @@ void check_experience()
{
msg_print("You feel different...");
corrupt_corrupted();
- level_corruption = FALSE;
+ level_corruption = false;
}
}
@@ -2183,17 +2183,17 @@ void place_corpse(monster_type *m_ptr)
* Check if monster race is in a given list. The list
* must be NULL-terminated.
*/
-static bool_ monster_race_in_list_p(monster_type *m_ptr, const char *races[])
+static bool monster_race_in_list_p(monster_type *m_ptr, const char *races[])
{
int i=0;
for (i=0; races[i] != NULL; i++)
{
if (m_ptr->r_idx == test_monster_name(races[i])) {
- return TRUE;
+ return true;
}
}
/* Not found */
- return FALSE;
+ return false;
}
/*
@@ -2406,7 +2406,7 @@ void monster_death(int m_idx)
auto const r_ptr = m_ptr->race();
- bool_ create_stairs = FALSE;
+ bool create_stairs = false;
int force_coin = get_coin_type(r_ptr);
object_type forge;
@@ -2562,7 +2562,7 @@ void monster_death(int m_idx)
{
if (is_friend(m_ptr) > 0)
{
- if (summon_specific_friendly(wy, wx, 100, SUMMON_DAWN, FALSE))
+ if (summon_specific_friendly(wy, wx, 100, SUMMON_DAWN, false))
{
if (player_can_see_bold(wy, wx))
msg_print ("A new warrior steps forth!");
@@ -2626,7 +2626,7 @@ void monster_death(int m_idx)
q_ptr->name1 = ART_GROND;
/* Mega-Hack -- Actually create "Grond" */
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
/* Drop it in the dungeon */
drop_near(q_ptr, -1, y, x);
@@ -2641,7 +2641,7 @@ void monster_death(int m_idx)
q_ptr->name1 = ART_MORGOTH;
/* Mega-Hack -- Actually create "Morgoth" */
- apply_magic(q_ptr, -1, TRUE, TRUE, TRUE);
+ apply_magic(q_ptr, -1, true, true, true);
q_ptr->found = OBJ_FOUND_MONSTER;
q_ptr->found_aux1 = m_ptr->r_idx;
@@ -2663,7 +2663,7 @@ void monster_death(int m_idx)
object_prep(q_ptr, lookup_kind(TV_RING, SV_RING_INVIS));
q_ptr->number = 1;
- apply_magic(q_ptr, -1, TRUE, TRUE, FALSE);
+ apply_magic(q_ptr, -1, true, true, false);
q_ptr->found = OBJ_FOUND_MONSTER;
q_ptr->found_aux1 = m_ptr->r_idx;
@@ -2685,7 +2685,7 @@ void monster_death(int m_idx)
object_prep(q_ptr, lookup_kind(TV_RING, SV_RING_SPECIAL));
q_ptr->number = 1;
- apply_magic(q_ptr, -1, TRUE, TRUE, FALSE);
+ apply_magic(q_ptr, -1, true, true, false);
/* Create a random artifact */
create_artifact(q_ptr, true, false);
@@ -2775,7 +2775,7 @@ void monster_death(int m_idx)
}
while (!(in_bounds(yy, xx) && cave_floor_bold(yy, xx)) && --attempts);
- place_monster_aux(yy, xx, test_monster_name("Great Wyrm of Power"), FALSE, FALSE, m_ptr->status);
+ place_monster_aux(yy, xx, test_monster_name("Great Wyrm of Power"), false, false, m_ptr->status);
}
/* Let monsters explode! */
@@ -2946,7 +2946,7 @@ void monster_death(int m_idx)
/*
* Decreases monsters hit points, handling monster death.
*
- * We return TRUE if the monster has been killed (and deleted).
+ * We return true if the monster has been killed (and deleted).
*
* We announce monster death (using an optional "death message"
* if given, and a otherwise a generic killed/destroyed message).
@@ -3288,11 +3288,11 @@ static void panel_bounds()
/*
* Handle a request to change the current panel
*
- * Return TRUE if the panel was changed.
+ * Return true if the panel was changed.
*
* Also used in do_cmd_locate()
*/
-bool_ change_panel(int dy, int dx)
+bool change_panel(int dy, int dx)
{
int y, x;
int wid, hgt;
@@ -3330,11 +3330,11 @@ bool_ change_panel(int dy, int dx)
handle_stuff();
/* Success */
- return (TRUE);
+ return true;
}
/* No changes */
- return (FALSE);
+ return false;
}
@@ -3344,7 +3344,7 @@ bool_ change_panel(int dy, int dx)
*
* "Update" forces a "full update" to take place.
*
- * The map is reprinted if necessary, and "TRUE" is returned.
+ * The map is reprinted if necessary, and "true" is returned.
*/
void verify_panel()
{
@@ -3570,15 +3570,15 @@ void resize_window()
*/
static const char *look_mon_desc(int m_idx)
{
- bool_ living = TRUE;
+ bool living = true;
/* Determine if the monster is "living" (vs "undead") */
monster_type *m_ptr = &m_list[m_idx];
auto const r_ptr = m_ptr->race();
- if (r_ptr->flags & RF_UNDEAD) living = FALSE;
- if (r_ptr->flags & RF_DEMON) living = FALSE;
- if (r_ptr->flags & RF_NONLIVING) living = FALSE;
- if (strchr("Egv", r_ptr->d_char)) living = FALSE;
+ if (r_ptr->flags & RF_UNDEAD) living = false;
+ if (r_ptr->flags & RF_DEMON) living = false;
+ if (r_ptr->flags & RF_NONLIVING) living = false;
+ if (strchr("Egv", r_ptr->d_char)) living = false;
/* Healthy monsters */
@@ -3638,28 +3638,28 @@ static bool target_able(int m_idx)
monster_type *m_ptr = &m_list[m_idx];
/* Monster must be alive */
- if (!m_ptr->r_idx) return (FALSE);
+ if (!m_ptr->r_idx) return false;
/* Monster must be visible */
- if (!m_ptr->ml) return (FALSE);
+ if (!m_ptr->ml) return false;
/* Monster must be projectable */
- if (!projectable(p_ptr->py, p_ptr->px, m_ptr->fy, m_ptr->fx)) return (FALSE);
+ if (!projectable(p_ptr->py, p_ptr->px, m_ptr->fy, m_ptr->fx)) return false;
/* Hack -- no targeting hallucinations */
- if (p_ptr->image) return (FALSE);
+ if (p_ptr->image) return false;
/* Dont target pets */
- if (is_friend(m_ptr) > 0) return (FALSE);
+ if (is_friend(m_ptr) > 0) return false;
/* Honor flag */
- if (r_info[m_ptr->r_idx].flags & RF_NO_TARGET) return (FALSE);
+ if (r_info[m_ptr->r_idx].flags & RF_NO_TARGET) return false;
/* XXX XXX XXX Hack -- Never target trappers */
- /* if (CLEAR_ATTR && (CLEAR_CHAR)) return (FALSE); */
+ /* if (CLEAR_ATTR && (CLEAR_CHAR)) return false; */
/* Assume okay */
- return (TRUE);
+ return true;
}
@@ -3668,12 +3668,12 @@ static bool target_able(int m_idx)
/*
* Update (if necessary) and verify (if possible) the target.
*
- * We return TRUE if the target is "okay" and FALSE otherwise.
+ * We return true if the target is "okay" and false otherwise.
*/
-bool_ target_okay()
+bool target_okay()
{
/* Accept stationary targets */
- if (target_who < 0) return (TRUE);
+ if (target_who < 0) return true;
/* Check moving targets */
if (target_who > 0)
@@ -3688,12 +3688,12 @@ bool_ target_okay()
target_col = m_ptr->fx;
/* Good target */
- return (TRUE);
+ return true;
}
}
/* Assume no target */
- return (FALSE);
+ return false;
}
@@ -3749,17 +3749,17 @@ static s16b target_pick(point p, int dy, int dx, std::vector<point> const &point
/*
* Hack -- determine if a given location is "interesting"
*/
-static bool_ target_set_accept(int y, int x)
+static bool target_set_accept(int y, int x)
{
auto const &r_info = game->edit_data.r_info;
auto const &f_info = game->edit_data.f_info;
/* Player grid is always interesting */
- if ((y == p_ptr->py) && (x == p_ptr->px)) return (TRUE);
+ if ((y == p_ptr->py) && (x == p_ptr->px)) return true;
/* Handle hallucination */
- if (p_ptr->image) return (FALSE);
+ if (p_ptr->image) return false;
/* Examine the grid */
@@ -3771,7 +3771,7 @@ static bool_ target_set_accept(int y, int x)
monster_type *m_ptr = &m_list[c_ptr->m_idx];
/* Visible monsters */
- if (m_ptr->ml) return (TRUE);
+ if (m_ptr->ml) return true;
}
/* Scan all objects in the grid */
@@ -3783,7 +3783,7 @@ static bool_ target_set_accept(int y, int x)
/* Memorized object */
if (o_ptr->marked)
{
- return (TRUE);
+ return true;
}
}
@@ -3791,17 +3791,17 @@ static bool_ target_set_accept(int y, int x)
if (c_ptr->info & (CAVE_MARK))
{
/* Hack -- Doors are boring */
- if (c_ptr->feat == FEAT_OPEN) return (FALSE);
- if (c_ptr->feat == FEAT_BROKEN) return (FALSE);
+ if (c_ptr->feat == FEAT_OPEN) return false;
+ if (c_ptr->feat == FEAT_BROKEN) return false;
if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL)) return (FALSE);
+ (c_ptr->feat <= FEAT_DOOR_TAIL)) return false;
/* Accept 'naturally' interesting features */
- if (f_info[c_ptr->feat].flags & FF_NOTICE) return (TRUE);
+ if (f_info[c_ptr->feat].flags & FF_NOTICE) return true;
}
/* Nope */
- return (FALSE);
+ return false;
}
@@ -3849,17 +3849,17 @@ static std::vector<point> target_set_prepare(int mode)
}
-bool_ target_object(int y, int x, int mode, const char *info, bool_ *boring,
+bool target_object(int y, int x, int mode, const char *info, bool *boring,
object_type *o_ptr, char *out_val, const char **s1, const char **s2, const char **s3,
int *query)
{
char o_name[80];
/* Not boring */
- *boring = FALSE;
+ *boring = false;
/* Obtain an object description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Describe the object */
sprintf(out_val, "%s%s%s%s [%s]", *s1, *s2, *s3, o_name, info);
@@ -3868,10 +3868,10 @@ bool_ target_object(int y, int x, int mode, const char *info, bool_ *boring,
*query = inkey();
/* Always stop at "normal" keys */
- if ((*query != '\r') && (*query != '\n') && (*query != ' ')) return (TRUE);
+ if ((*query != '\r') && (*query != '\n') && (*query != ' ')) return true;
/* Sometimes stop at "space" key */
- if ((*query == ' ') && !(mode & (TARGET_LOOK))) return (TRUE);
+ if ((*query == ' ') && !(mode & (TARGET_LOOK))) return true;
/* Change the intro */
*s1 = "It is ";
@@ -3881,7 +3881,7 @@ bool_ target_object(int y, int x, int mode, const char *info, bool_ *boring,
/* Preposition */
*s2 = "on ";
- return (FALSE);
+ return false;
}
/*
@@ -3921,7 +3921,7 @@ static int target_set_aux(int y, int x, int mode, const char *info_)
const char *s2;
const char *s3;
- bool_ boring;
+ bool boring;
int feat;
@@ -3937,7 +3937,7 @@ static int target_set_aux(int y, int x, int mode, const char *info_)
query = ' ';
/* Assume boring */
- boring = TRUE;
+ boring = true;
/* Default */
s1 = "You see ";
@@ -3999,12 +3999,12 @@ static int target_set_aux(int y, int x, int mode, const char *info_)
/* Visible */
if (m_ptr->ml)
{
- bool_ recall = FALSE;
+ bool recall = false;
char m_name[80];
/* Not boring */
- boring = FALSE;
+ boring = false;
/* Get the monster name ("a kobold") */
monster_desc(m_name, m_ptr, 0x08);
@@ -4119,7 +4119,7 @@ static int target_set_aux(int y, int x, int mode, const char *info_)
/* Obtain an object description */
char o_name[80];
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, true, 3);
/* Describe the object */
sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, o_name, info.c_str());
@@ -4336,15 +4336,15 @@ static int target_set_aux(int y, int x, int mode, const char *info_)
* This command will cancel any old target, even if used from
* inside the "look" command.
*/
-bool_ target_set(int mode)
+bool target_set(int mode)
{
int i, d, m;
int y = p_ptr->py;
int x = p_ptr->px;
- bool_ done = FALSE;
+ bool done = false;
- bool_ flag = TRUE;
+ bool flag = true;
char query;
@@ -4413,7 +4413,7 @@ bool_ target_set(int mode)
case ESCAPE:
case 'q':
{
- done = TRUE;
+ done = true;
break;
}
@@ -4428,7 +4428,7 @@ bool_ target_set(int mode)
target_who = c_ptr->m_idx;
target_row = y;
target_col = x;
- done = TRUE;
+ done = true;
}
else
{
@@ -4485,7 +4485,7 @@ bool_ target_set(int mode)
case 'o':
{
- flag = FALSE;
+ flag = false;
break;
}
@@ -4568,7 +4568,7 @@ bool_ target_set(int mode)
case ESCAPE:
case 'q':
{
- done = TRUE;
+ done = true;
break;
}
@@ -4580,7 +4580,7 @@ bool_ target_set(int mode)
target_who = -1;
target_row = y;
target_col = x;
- done = TRUE;
+ done = true;
break;
}
@@ -4605,7 +4605,7 @@ bool_ target_set(int mode)
case 'm':
{
- flag = TRUE;
+ flag = true;
break;
}
@@ -4696,10 +4696,10 @@ bool_ target_set(int mode)
handle_stuff();
/* Failure to set target */
- if (!target_who) return (FALSE);
+ if (!target_who) return false;
/* Success */
- return (TRUE);
+ return true;
}
@@ -4715,7 +4715,7 @@ bool_ target_set(int mode)
*
* Note that confusion over-rides any (explicit?) user choice.
*/
-bool_ get_aim_dir(int *dp)
+bool get_aim_dir(int *dp)
{
int dir;
@@ -4730,7 +4730,7 @@ bool_ get_aim_dir(int *dp)
/* Verify */
if (!(*dp == 5 && !target_okay()))
{
- return (TRUE);
+ return true;
}
}
@@ -4800,7 +4800,7 @@ bool_ get_aim_dir(int *dp)
}
/* No direction */
- if (!dir) return (FALSE);
+ if (!dir) return false;
/* Save the direction */
command_dir = dir;
@@ -4827,7 +4827,7 @@ bool_ get_aim_dir(int *dp)
repeat_push(dir);
/* A "valid" direction was entered */
- return (TRUE);
+ return true;
}
@@ -4848,13 +4848,13 @@ bool_ get_aim_dir(int *dp)
* This function tracks and uses the "global direction", and uses
* that as the "desired direction", to which "confusion" is applied.
*/
-bool_ get_rep_dir(int *dp)
+bool get_rep_dir(int *dp)
{
int dir;
if (repeat_pull(dp))
{
- return (TRUE);
+ return true;
}
/* Initialize */
@@ -4882,7 +4882,7 @@ bool_ get_rep_dir(int *dp)
if (dir == 5) dir = 0;
/* Aborted */
- if (!dir) return (FALSE);
+ if (!dir) return false;
/* Save desired direction */
command_dir = dir;
@@ -4912,19 +4912,19 @@ bool_ get_rep_dir(int *dp)
repeat_push(dir);
/* Success */
- return (TRUE);
+ return true;
}
/*
* old -- from PsiAngband.
*/
-bool_ tgt_pt(int *x, int *y)
+bool tgt_pt(int *x, int *y)
{
char ch = 0;
int d;
int screen_wid, screen_hgt;
- bool_ success = FALSE;
+ bool success = false;
*x = p_ptr->px;
*y = p_ptr->py;
@@ -4948,7 +4948,7 @@ bool_ tgt_pt(int *x, int *y)
case 27:
break;
case ' ':
- success = TRUE;
+ success = true;
break;
default:
/* Look up the direction */
@@ -4991,7 +4991,7 @@ void set_grace(s32b v)
handle_stuff();
}
-static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge, const char *what)
+static bool test_object_wish(char *name, object_type *o_ptr, object_type *forge, const char *what)
{
auto &k_info = game->edit_data.k_info;
auto const &e_info = game->edit_data.e_info;
@@ -5012,12 +5012,12 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
object_prep(o_ptr, k_entry.first);
o_ptr->name1 = 0;
o_ptr->name2 = 0;
- apply_magic(o_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(o_ptr, dun_level, false, false, false);
/* Hack : aware status must be restored after describing the item name */
save_aware = k_ptr->aware;
object_aware(o_ptr);
object_known(o_ptr);
- object_desc(buf, o_ptr, FALSE, 0);
+ object_desc(buf, o_ptr, false, 0);
strlower(buf);
k_ptr->aware = save_aware;
@@ -5029,7 +5029,7 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
for (std::size_t j = 0; j < e_info.size(); j++)
{
auto e_ptr = &e_info[j];
- bool_ ok = FALSE;
+ bool ok = false;
if (j && e_ptr->name.empty())
{
@@ -5046,7 +5046,7 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
if (e_ptr->tval[z] == k_ptr->tval)
{
if ((e_ptr->min_sval[z] <= k_ptr->sval) &&
- (e_ptr->max_sval[z] >= k_ptr->sval)) ok = TRUE;
+ (e_ptr->max_sval[z] >= k_ptr->sval)) ok = true;
}
if (ok) break;
}
@@ -5060,7 +5060,7 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
for (std::size_t jb = 0; jb < e_info.size(); jb++)
{
auto eb_ptr = &e_info[jb];
- bool_ ok = FALSE;
+ bool ok = false;
if (jb && eb_ptr->name.empty())
{
@@ -5079,7 +5079,7 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
if (eb_ptr->tval[z] == k_ptr->tval)
{
if ((eb_ptr->min_sval[z] <= k_ptr->sval) &&
- (eb_ptr->max_sval[z] >= k_ptr->sval)) ok = TRUE;
+ (eb_ptr->max_sval[z] >= k_ptr->sval)) ok = true;
}
if (ok) break;
}
@@ -5093,16 +5093,16 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
o_ptr->name1 = 0;
o_ptr->name2 = j;
o_ptr->name2b = jb;
- apply_magic(o_ptr, dun_level, FALSE, FALSE, FALSE);
+ apply_magic(o_ptr, dun_level, false, false, false);
object_aware(o_ptr);
object_known(o_ptr);
- object_desc(buf, o_ptr, FALSE, 0);
+ object_desc(buf, o_ptr, false, 0);
strlower(buf);
if (iequals(buf, name))
{
/* Don't search any more */
- return TRUE;
+ return true;
}
else
{
@@ -5113,7 +5113,7 @@ static bool_ test_object_wish(char *name, object_type *o_ptr, object_type *forge
}
}
}
- return FALSE;
+ return false;
}
static void clean_wish_name(char *buf, char *name)
@@ -5274,7 +5274,7 @@ void make_wish()
while (!(in_bounds(wy, wx) && cave_floor_bold(wy, wx)) && --attempts);
/* Create the monster */
- if (place_monster_one(wy, wx, i, j, FALSE, mstatus))
+ if (place_monster_one(wy, wx, i, j, false, mstatus))
{
msg_print("Your wish becomes truth!");
}
@@ -5310,7 +5310,7 @@ static void corrupt_corrupted()
/*
* Change to an other subrace
*/
-void switch_subrace(std::size_t racem, bool_ copy_old)
+void switch_subrace(std::size_t racem, bool copy_old)
{
auto &race_mod_info = game->edit_data.race_mod_info;
diff --git a/src/xtra2.hpp b/src/xtra2.hpp
index 5fadfa56..da2d8585 100644
--- a/src/xtra2.hpp
+++ b/src/xtra2.hpp
@@ -8,58 +8,58 @@
#include <memory>
void do_rebirth();
-void switch_subrace(std::size_t racem, bool_ copy_old);
+void switch_subrace(std::size_t racem, bool copy_old);
void drop_from_wild();
-bool_ set_roots(int v, s16b ac, s16b dam);
-bool_ set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag);
-bool_ set_parasite(int v, int r);
-bool_ set_disrupt_shield(int v);
-bool_ set_prob_travel(int v);
-bool_ set_absorb_soul(int v);
-bool_ set_tim_breath(int v, bool_ magical);
-bool_ set_tim_precognition(int v);
-bool_ set_tim_deadly(int v);
-bool_ set_tim_reflect(int v);
-bool_ set_tim_thunder(int v, int p1, int p2);
-bool_ set_strike(int v);
-bool_ set_tim_regen(int v, int p);
-bool_ set_tim_ffall(int v);
-bool_ set_tim_fly(int v);
-bool_ set_poison(int v);
-bool_ set_holy(int v);
+bool set_roots(int v, s16b ac, s16b dam);
+bool set_project(int v, s16b gf, s16b dam, s16b rad, s16b flag);
+bool set_parasite(int v, int r);
+bool set_disrupt_shield(int v);
+bool set_prob_travel(int v);
+bool set_absorb_soul(int v);
+bool set_tim_breath(int v, bool magical);
+bool set_tim_precognition(int v);
+bool set_tim_deadly(int v);
+bool set_tim_reflect(int v);
+bool set_tim_thunder(int v, int p1, int p2);
+bool set_strike(int v);
+bool set_tim_regen(int v, int p);
+bool set_tim_ffall(int v);
+bool set_tim_fly(int v);
+bool set_poison(int v);
+bool set_holy(int v);
void set_grace(s32b v);
-bool_ set_mimic(int v, int p, int level);
-bool_ set_no_breeders(int v);
-bool_ set_invis(int v,int p);
-bool_ set_lite(int v);
-bool_ set_blind(int v);
-bool_ set_confused(int v);
-bool_ set_poisoned(int v);
-bool_ set_afraid(int v);
-bool_ set_paralyzed(int v);
+bool set_mimic(int v, int p, int level);
+bool set_no_breeders(int v);
+bool set_invis(int v,int p);
+bool set_lite(int v);
+bool set_blind(int v);
+bool set_confused(int v);
+bool set_poisoned(int v);
+bool set_afraid(int v);
+bool set_paralyzed(int v);
void dec_paralyzed();
-bool_ set_image(int v);
-bool_ set_fast(int v, int p);
-bool_ set_light_speed(int v);
-bool_ set_slow(int v);
-bool_ set_shield(int v, int p, s16b o, s16b d1, s16b d2);
-bool_ set_blessed(int v);
-bool_ set_hero(int v);
-bool_ set_shero(int v);
-bool_ set_protevil(int v);
-bool_ set_invuln(int v);
-bool_ set_tim_invis(int v);
-bool_ set_tim_infra(int v);
-bool_ set_mental_barrier(int v);
-bool_ set_oppose_acid(int v);
-bool_ set_oppose_elec(int v);
-bool_ set_oppose_fire(int v);
-bool_ set_oppose_cold(int v);
-bool_ set_oppose_pois(int v);
-bool_ set_oppose_cc(int v);
-bool_ set_stun(int v);
-bool_ set_cut(int v);
-bool_ set_food(int v);
+bool set_image(int v);
+bool set_fast(int v, int p);
+bool set_light_speed(int v);
+bool set_slow(int v);
+bool set_shield(int v, int p, s16b o, s16b d1, s16b d2);
+bool set_blessed(int v);
+bool set_hero(int v);
+bool set_shero(int v);
+bool set_protevil(int v);
+bool set_invuln(int v);
+bool set_tim_invis(int v);
+bool set_tim_infra(int v);
+bool set_mental_barrier(int v);
+bool set_oppose_acid(int v);
+bool set_oppose_elec(int v);
+bool set_oppose_fire(int v);
+bool set_oppose_cold(int v);
+bool set_oppose_pois(int v);
+bool set_oppose_cc(int v);
+bool set_stun(int v);
+bool set_cut(int v);
+bool set_food(int v);
void check_experience();
void check_experience_obj(object_type *o_ptr);
void gain_exp(s32b amount);
@@ -67,16 +67,16 @@ void lose_exp(s32b amount);
int get_coin_type(std::shared_ptr<monster_race const> r_ptr);
void monster_death(int m_idx);
bool mon_take_hit(int m_idx, int dam, bool *fear, const char *note);
-bool_ change_panel(int dy, int dx);
+bool change_panel(int dy, int dx);
void verify_panel();
-bool_ target_okay();
-bool_ target_set(int mode);
-bool_ get_aim_dir(int *dp);
-bool_ get_rep_dir(int *dp);
-bool_ set_shadow(int v);
-bool_ set_tim_esp(int v);
-bool_ tgp_pt(int *x, int * y);
-bool_ tgt_pt (int *x, int *y);
+bool target_okay();
+bool target_set(int mode);
+bool get_aim_dir(int *dp);
+bool get_rep_dir(int *dp);
+bool set_shadow(int v);
+bool set_tim_esp(int v);
+bool tgp_pt(int *x, int * y);
+bool tgt_pt (int *x, int *y);
void do_poly_self();
void make_wish();
void create_between_gate(int dist, int y, int x);
diff --git a/src/z-form.cc b/src/z-form.cc
index 3cbb7308..159dab96 100644
--- a/src/z-form.cc
+++ b/src/z-form.cc
@@ -180,10 +180,10 @@ unsigned int vstrnfmt(char *buf, unsigned int max, const char *fmt, va_list vp)
const char *s;
/* The argument is "long" */
- bool_ do_long;
+ bool do_long;
/* The argument needs "processing" */
- bool_ do_xtra;
+ bool do_xtra;
/* Bytes used in buffer */
unsigned int n;
@@ -212,7 +212,7 @@ unsigned int vstrnfmt(char *buf, unsigned int max, const char *fmt, va_list vp)
s = fmt;
/* Scan the format string */
- while (TRUE)
+ while (true)
{
/* All done */
if (!*s) break;
@@ -275,13 +275,13 @@ unsigned int vstrnfmt(char *buf, unsigned int max, const char *fmt, va_list vp)
aux[q++] = '%';
/* Assume no "long" argument */
- do_long = FALSE;
+ do_long = false;
/* Assume no "xtra" processing */
- do_xtra = FALSE;
+ do_xtra = false;
/* Build the "aux" string */
- while (TRUE)
+ while (true)
{
/* Error -- format sequence is not terminated */
if (!*s)
@@ -313,7 +313,7 @@ unsigned int vstrnfmt(char *buf, unsigned int max, const char *fmt, va_list vp)
aux[q++] = *s++;
/* Note the "long" flag */
- do_long = TRUE;
+ do_long = true;
}
/* Mega-Hack -- handle "extra-long" request */
@@ -362,7 +362,7 @@ unsigned int vstrnfmt(char *buf, unsigned int max, const char *fmt, va_list vp)
else if (*s == '^')
{
/* Note the "xtra" flag */
- do_xtra = TRUE;
+ do_xtra = true;
/* Skip the "^" */
s++;
diff --git a/src/z-term.cc b/src/z-term.cc
index aa0e47d5..f672e36e 100644
--- a/src/z-term.cc
+++ b/src/z-term.cc
@@ -1626,7 +1626,7 @@ errr Term_inkey(char *ch, bool wait, bool take)
while (key_queue.empty())
{
/* Process events (wait for one) */
- Term_xtra(TERM_XTRA_EVENT, TRUE);
+ Term_xtra(TERM_XTRA_EVENT, true);
}
}
@@ -1637,7 +1637,7 @@ errr Term_inkey(char *ch, bool wait, bool take)
if (key_queue.empty())
{
/* Process events (do not wait) */
- Term_xtra(TERM_XTRA_EVENT, FALSE);
+ Term_xtra(TERM_XTRA_EVENT, false);
}
}