diff options
author | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:25 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:25 +0100 |
commit | 00518e2030b0ddf66777ee71301017b78220d006 (patch) | |
tree | 726fced33c63a0d694d0672a931f10cefdda3d41 /src/randart.cc | |
parent | 98236a1479abfbd28d10313e376721608e2f5643 (diff) |
Replace uses of bool_ with bool
"Only" 988 mentions of bool_ left!
Diffstat (limited to 'src/randart.cc')
-rw-r--r-- | src/randart.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/randart.cc b/src/randart.cc index 675b5f4b..66d3ea69 100644 --- a/src/randart.cc +++ b/src/randart.cc @@ -242,7 +242,7 @@ void get_random_name(char * return_name) } -bool_ create_artifact(object_type *o_ptr, bool_ a_scroll, bool_ get_name) +bool create_artifact(object_type *o_ptr, bool a_scroll, bool get_name) { auto const &ra_gen = game->edit_data.ra_gen; auto const &ra_info = game->edit_data.ra_info; @@ -250,13 +250,16 @@ 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; strcpy(new_name, ""); - if ((!a_scroll) && (randint(A_CURSED) == 1)) a_cursed = TRUE; + if ((!a_scroll) && (randint(A_CURSED) == 1)) + { + a_cursed = true; + } for (auto const &g: ra_gen) { @@ -383,10 +386,8 @@ bool_ create_artifact(object_type *o_ptr, bool_ a_scroll, bool_ get_name) } -bool_ artifact_scroll() +bool artifact_scroll() { - bool_ okay = FALSE; - /* Get an item */ int item; if (!get_item(&item, @@ -395,7 +396,7 @@ bool_ artifact_scroll() (USE_EQUIP | USE_INVEN | USE_FLOOR), item_tester_hook_artifactable())) { - return (FALSE); + return false; } /* Get the item */ @@ -410,22 +411,20 @@ bool_ artifact_scroll() ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s")); + bool okay = false; + if (artifact_p(o_ptr)) { msg_format("The %s %s already %s!", o_name, ((o_ptr->number > 1) ? "are" : "is"), ((o_ptr->number > 1) ? "artifacts" : "an artifact")); - okay = FALSE; } - else if (o_ptr->name2) { msg_format("The %s %s already %s!", o_name, ((o_ptr->number > 1) ? "are" : "is"), ((o_ptr->number > 1) ? "ego items" : "an ego item")); - okay = FALSE; } - else { if (o_ptr->number > 1) @@ -434,7 +433,8 @@ bool_ artifact_scroll() msg_format("%d of your %s %s destroyed!", (o_ptr->number) - 1, o_name, (o_ptr->number > 2 ? "were" : "was")); o_ptr->number = 1; } - okay = create_artifact(o_ptr, TRUE, TRUE); + + okay = create_artifact(o_ptr, true, true); } /* Failure */ @@ -447,10 +447,12 @@ bool_ artifact_scroll() msg_print("The enchantment failed."); } else + { o_ptr->found = OBJ_FOUND_SELFMADE; + } /* Something happened */ - return (TRUE); + return true; } |