| 1 | /** |
| 2 | * @file |
| 3 | * Artifact-related structures. |
| 4 | * |
| 5 | * See the @ref page_artifact "page on artifacts" for more information. |
| 6 | */ |
| 7 | |
| 8 | #ifndef ARTIFACT_H |
| 9 | #define ARTIFACT_H |
| 10 | |
| 11 | /** |
| 12 | * This is one artifact, ie one special item. |
| 13 | */ |
| 14 | typedef struct artifactstruct { |
| 15 | object *item; /**< Special values of the artifact. Note that this object is malloc() ed. */ |
| 16 | uint16_t chance; /**< Chance of the artifact to happen. */ |
| 17 | uint8_t difficulty; /**< Minimum map difficulty for the artifact to happen. */ |
| 18 | struct artifactstruct *next; /**< Next artifact in the list. */ |
| 19 | linked_char *allowed; /**< List of archetypes the artifact can affect. */ |
| 20 | int allowed_size; /**< Length of allowed, for faster computation. */ |
| 21 | } artifact; |
| 22 | |
| 23 | /** |
| 24 | * This represents all archetypes for one particular object type. |
| 25 | */ |
| 26 | typedef struct artifactliststruct { |
| 27 | uint8_t type; /**< Object type that this list represents. */ |
| 28 | uint16_t total_chance; /**< Sum of chance for are artifacts on this list. */ |
| 29 | struct artifactliststruct *next; /**< Next list of artifacts. */ |
| 30 | struct artifactstruct *items; /**< Artifacts for this type. Will never be NULL. */ |
| 31 | } artifactlist; |
| 32 | |
| 33 | #endif /* ARTIFACT_H */ |