artifact tracking again

Redo the recent artifact creation stuff by replacing several nearly
identical routines with one more general one.  Also adds a tracking
bit for one or two more creation methods.  That changed artiexist[]
from an array of structs holding 8 or less bits to one holding 9, so
bump EDITLEVEL in case the total size changed.
This commit is contained in:
PatR
2022-03-12 17:25:54 -08:00
parent 294365f707
commit 77dc522a62
14 changed files with 128 additions and 177 deletions

View File

@@ -69,15 +69,11 @@ extern const char *artiname(int);
extern struct obj *mk_artifact(struct obj *, aligntyp);
extern const char *artifact_name(const char *, short *);
extern boolean exist_artifact(int, const char *);
extern void artifact_exists(struct obj *, const char *, boolean, boolean);
extern void artifact_exists(struct obj *, const char *, boolean, unsigned);
extern void found_artifact(int);
extern void find_artifact(struct obj *);
extern int nartifact_exist(void);
extern int artifact_gift(struct obj *, boolean);
extern int artifact_wish(struct obj *, boolean);
extern int artifact_named(struct obj *, boolean);
extern int artifact_viadip(struct obj *, boolean);
extern int artifact_bones(struct obj *, boolean);
extern void artifact_origin(struct obj *, unsigned);
extern boolean arti_immune(struct obj *, int);
extern boolean spec_ability(struct obj *, unsigned long);
extern boolean confers_luck(struct obj *);

View File

@@ -371,10 +371,25 @@ typedef struct sortloot_item Loot;
#define BUCX_TYPES (BUC_ALLBKNOWN | BUC_UNKNOWN)
#define ALL_TYPES_SELECTED -2
/* Flags for oname() */
#define ONAME_NO_FLAGS 0U /* none of the below */
#define ONAME_VIA_NAMING 1U /* oname() is being called by do_oname() */
#define ONAME_FOUND_ARTI 2U /* if an artifact, hero becomes aware of it */
/* Flags for oname(), artifact_exists(), artifact_origin() */
#define ONAME_NO_FLAGS 0U /* none of the below; they apply to artifacts */
/* 0x0001U is reserved for 'exists' */
/* flags indicating where an artifact came from */
#define ONAME_VIA_NAMING 0x0002U /* oname() is being called by do_oname();
* only matters if creating Sting|Orcrist */
#define ONAME_WISH 0x0004U /* created via wish */
#define ONAME_GIFT 0x0008U /* created as a divine reward after #offer or
* special #pray result of being crowned */
#define ONAME_VIA_DIP 0x0010U /* created Excalibur in a fountain */
#define ONAME_LEVEL_DEF 0x0020U /* placed by a special level's definition */
#define ONAME_BONES 0x0040U /* object came from bones; in its original
* game it had one of the other bits but we
* don't care which one */
#define ONAME_RANDOM 0x0080U /* something created an artifact randomly
* with mk_artifact() (mksboj or mk_player)
* or m_initweap() (lawful Angel) */
/* flag congrolling potential livelog event of finding an artifact */
#define ONAME_KNOW_ARTI 0x0100U /* hero is already aware of this artifact */
/* Flags to control find_mid() */
#define FM_FMON 0x01 /* search the fmon chain */

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 52
#define EDITLEVEL 53
/*
* Development status possibilities.