/** * Convert all ARTIFACT_UNKNOWN history items to HIST_ARTIFACT_KNOWN. * Use only after player retirement/death for the final character dump. */ void history_unmask_unknown(void) { size_t i = history_ctr; while (i--) { if (hist_has(history_list[i].type, HIST_ARTIFACT_UNKNOWN)) { hist_off(history_list[i].type, HIST_ARTIFACT_UNKNOWN); hist_on(history_list[i].type, HIST_ARTIFACT_KNOWN); } } }
/** * Convert all ARTIFACT_UNKNOWN history items to HIST_ARTIFACT_KNOWN. * Use only after player retirement/death for the final character dump. */ void history_unmask_unknown(struct player *p) { struct player_history *h = &p->hist; size_t i = h->next; while (i--) { if (hist_has(h->entries[i].type, HIST_ARTIFACT_UNKNOWN)) { hist_off(h->entries[i].type, HIST_ARTIFACT_UNKNOWN); hist_on(h->entries[i].type, HIST_ARTIFACT_KNOWN); } } }
/** * Mark artifact as known. */ static bool history_mark_artifact_known(struct player_history *h, const struct artifact *artifact) { assert(artifact); size_t i = h->next; while (i--) { if (h->entries[i].a_idx == artifact->aidx) { hist_off(h->entries[i].type, HIST_ARTIFACT_UNKNOWN); hist_on(h->entries[i].type, HIST_ARTIFACT_KNOWN); return true; } } return false; }