continue;
}
- if (a_ref.cur_num) {
+ if (a_ref.is_generated) {
continue;
}
}
/*! @note 既に生成回数がカウントされたアーティファクト、QUESTITEMと非INSTA_ARTは除外 / Cannot make an artifact twice */
- if (a_ref.cur_num) {
+ if (a_ref.is_generated) {
continue;
}
if (a_ref.gen_flags.has(ItemGenerationTraitType::QUESTITEM)) {
}
for (auto &a_ref : a_info) {
- a_ref.cur_num = 0;
+ a_ref.is_generated = false;
}
k_info_reset();
if (!o_idx) {
msg_format(_("%sはどこかへ行った。", "The %s went somewhere."), o_name);
if (q_ptr->is_fixed_artifact()) {
- a_info[j_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[j_ptr->fixed_artifact_idx].is_generated = false;
}
return;
}
return;
}
- if ((a_info[artifact_index].cur_num == 0) && create_named_art(player_ptr, artifact_index, *qtwg_ptr->y, *qtwg_ptr->x)) {
- a_info[artifact_index].cur_num = 1;
+ if (!a_info[artifact_index].is_generated && create_named_art(player_ptr, artifact_index, *qtwg_ptr->y, *qtwg_ptr->x)) {
+ a_info[artifact_index].is_generated = true;
return;
}
if (a_idx < 1) {
continue;
}
- if (a_info[a_idx].cur_num > 0) {
+ if (a_info[a_idx].is_generated) {
continue;
}
count++;
}
if (a_info[o_ptr->fixed_artifact_idx].floor_id == new_floor_id) {
- a_info[o_ptr->fixed_artifact_idx].cur_num = 1;
+ a_info[o_ptr->fixed_artifact_idx].is_generated = true;
} else {
delete_object_idx(player_ptr, i);
}
if (preserve_mode) {
if (j_ptr->is_fixed_artifact() && !j_ptr->is_known()) {
- a_info[j_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[j_ptr->fixed_artifact_idx].is_generated = false;
}
}
}
if (j_ptr->is_fixed_artifact()) {
- a_info[j_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[j_ptr->fixed_artifact_idx].is_generated = false;
}
return 0;
/* Hack -- Preserve unknown artifacts */
if (o_ptr->is_fixed_artifact()) {
- /* Mega-Hack -- Preserve the artifact */
- a_info[o_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[o_ptr->fixed_artifact_idx].is_generated = false;
if (cheat_peek) {
GAME_TEXT o_name[MAX_NLEN];
if (!w_ptr->character_dungeon || preserve_mode) {
if (o_ptr->is_fixed_artifact() && !o_ptr->is_known()) {
- a_info[o_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[o_ptr->fixed_artifact_idx].is_generated = false;
}
}
OBJECT_IDX o_idx = o_pop(floor_ptr);
if (o_idx == 0) {
if (q_ptr->is_fixed_artifact()) {
- a_info[q_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[q_ptr->fixed_artifact_idx].is_generated = false;
}
return;
if (a_ref.name.empty()) {
continue;
}
- if (!a_ref.cur_num) {
+ if (!a_ref.is_generated) {
continue;
}
artifact_type dummy;
for (auto i = 0U; i < loading_max_a_idx; i++) {
auto *a_ptr = i < a_info.size() ? &a_info[i] : &dummy;
- a_ptr->cur_num = rd_byte();
+ a_ptr->is_generated = rd_bool();
if (h_older_than(1, 5, 0, 0)) {
a_ptr->floor_id = 0;
strip_bytes(3);
bool drop_single_artifact(PlayerType *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx)
{
auto *a_ptr = &a_info[a_idx];
- if (a_ptr->cur_num == 1) {
+ if (a_ptr->is_generated) {
return false;
}
if (create_named_art(player_ptr, a_idx, md_ptr->md_y, md_ptr->md_x)) {
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
if (w_ptr->character_dungeon) {
a_ptr->floor_id = player_ptr->floor_id;
}
if (!preserve_mode) {
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
}
return true;
a_idx = d_info[player_ptr->dungeon_idx].final_artifact;
auto *a_ptr = &a_info[a_idx];
- if (a_ptr->cur_num == 1) {
+ if (a_ptr->is_generated) {
return k_idx;
}
if (create_named_art(player_ptr, a_idx, md_ptr->md_y, md_ptr->md_x)) {
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
if (w_ptr->character_dungeon) {
a_ptr->floor_id = player_ptr->floor_id;
}
} else if (!preserve_mode) {
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
}
return d_info[player_ptr->dungeon_idx].final_object ? k_idx : 0;
}
a_ptr = &a_info[a_idx];
- } while (a_ptr->cur_num == 1);
+ } while (a_ptr->is_generated);
if (create_named_art(player_ptr, a_idx, md_ptr->md_y, md_ptr->md_x)) {
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
if (w_ptr->character_dungeon) {
a_ptr->floor_id = player_ptr->floor_id;
}
}
if (!preserve_mode) {
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
}
}
}
auto *a_ptr = apply_artifact(this->player_ptr, this->o_ptr);
- a_ptr->cur_num = 1;
+ a_ptr->is_generated = true;
if (w_ptr->character_dungeon) {
a_ptr->floor_id = this->player_ptr->floor_id;
}
wr_u16b(tmp16u);
for (int i = 0; i < tmp16u; i++) {
auto *a_ptr = &a_info[i];
- wr_byte(a_ptr->cur_num);
+ wr_bool(a_ptr->is_generated);
wr_s16b(a_ptr->floor_id);
}
/* Hack -- Preserve unknown artifacts */
if (o_ptr->is_fixed_artifact() && (!o_ptr->is_known() || in_generate)) {
- /* Mega-Hack -- Preserve the artifact */
- a_info[o_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[o_ptr->fixed_artifact_idx].is_generated = false;
if (in_generate && cheat_peek) {
GAME_TEXT o_name[MAX_NLEN];
continue;
}
- if (a_ref.cur_num > 0) {
+ if (a_ref.is_generated) {
continue;
}
* @brief 固定アーティファクト情報の構造体 / Artifact structure.
* @details
* @note
- * the save-file only writes "cur_num" to the savefile.
+ * the save-file only writes "is_generated" to the savefile.
* "max_num" is always "1" (if that artifact "exists")
*/
enum class RandomArtActType : short;
EnumClassFlagGroup<ItemGenerationTraitType> gen_flags; /*! アイテム生成フラグ / flags for generate */
DEPTH level{}; /*! 基本生成階 / Artifact level */
RARITY rarity{}; /*! レアリティ / Artifact rarity */
- byte cur_num{}; /*! 現在の生成数 / Number created (0 or 1) */
+ bool is_generated{}; /*! 生成済か否か (生成済でも、「保存モードON」かつ「帰還等で鑑定前に消滅」したら未生成状態に戻る) */
FLOOR_IDX floor_id{}; /*! アイテムを落としたフロアのID / Leaved on this location last time */
RandomArtActType act_idx{}; /*! 発動能力ID / Activative ability index */
};
}
auto *a_ptr = &a_info[a_idx];
- a_ptr->cur_num = aware ? 1 : 0;
+ a_ptr->is_generated = aware;
msg_print(aware ? "Modified." : "Restored.");
}
char tmp_val[80];
if (o_ptr->is_fixed_artifact()) {
- a_info[o_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[o_ptr->fixed_artifact_idx].is_generated = false;
}
uint32_t i, matches, better, worse, other, correct;
q_ptr->wipe();
make_object(player_ptr, q_ptr, mode);
if (q_ptr->is_fixed_artifact()) {
- a_info[q_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[q_ptr->fixed_artifact_idx].is_generated = false;
}
if ((o_ptr->tval != q_ptr->tval) || (o_ptr->sval != q_ptr->sval)) {
}
if (o_ptr->is_fixed_artifact()) {
- a_info[o_ptr->fixed_artifact_idx].cur_num = 1;
+ a_info[o_ptr->fixed_artifact_idx].is_generated = true;
}
}
wiz_display_item(player_ptr, q_ptr);
if (!get_com("[a]ccept, [w]orthless, [c]ursed, [n]ormal, [g]ood, [e]xcellent, [s]pecial? ", &ch, false)) {
if (q_ptr->is_fixed_artifact()) {
- a_info[q_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[q_ptr->fixed_artifact_idx].is_generated = false;
q_ptr->fixed_artifact_idx = 0;
}
}
if (q_ptr->is_fixed_artifact()) {
- a_info[q_ptr->fixed_artifact_idx].cur_num = 0;
+ a_info[q_ptr->fixed_artifact_idx].is_generated = false;
q_ptr->fixed_artifact_idx = 0;
}
if (a_ids.size() == 1) {
ARTIFACT_IDX a_idx = a_ids.back();
- if (must || (ok_art && !a_info[a_idx].cur_num)) {
+ if (must || (ok_art && !a_info[a_idx].is_generated)) {
create_named_art(player_ptr, a_idx, player_ptr->y, player_ptr->x);
if (!w_ptr->wizard) {
- a_info[a_idx].cur_num = 1;
+ a_info[a_idx].is_generated = true;
}
} else {
wishing_puff_of_smoke();
if (a_idx > 0) {
a_ptr = &a_info[a_idx];
- if (must || (ok_art && !a_ptr->cur_num)) {
+ if (must || (ok_art && !a_ptr->is_generated)) {
create_named_art(player_ptr, a_idx, player_ptr->y, player_ptr->x);
if (!w_ptr->wizard) {
- a_info[a_idx].cur_num = 1;
+ a_info[a_idx].is_generated = true;
}
} else {
wishing_puff_of_smoke();