File: artifact.h

package info (click to toggle)
crossfire 1.75.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,168 kB
  • sloc: ansic: 83,169; sh: 4,659; perl: 1,736; lex: 1,443; makefile: 1,199; python: 43
file content (33 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * @file
 * Artifact-related structures.
 *
 * See the @ref page_artifact "page on artifacts" for more information.
 */

#ifndef ARTIFACT_H
#define ARTIFACT_H

/**
 * This is one artifact, ie one special item.
 */
typedef struct artifactstruct {
    object *item;                   /**< Special values of the artifact. Note that this object is malloc() ed. */
    uint16_t chance;                  /**< Chance of the artifact to happen. */
    uint8_t difficulty;               /**< Minimum map difficulty for the artifact to happen. */
    struct artifactstruct *next;    /**< Next artifact in the list. */
    linked_char *allowed;           /**< List of archetypes the artifact can affect. */
    int allowed_size;               /**< Length of allowed, for faster computation. */
} artifact;

/**
 * This represents all archetypes for one particular object type.
 */
typedef struct artifactliststruct {
    uint8_t type;                         /**< Object type that this list represents. */
    uint16_t total_chance;                /**< Sum of chance for are artifacts on this list. */
    struct artifactliststruct *next;    /**< Next list of artifacts. */
    struct artifactstruct *items;       /**< Artifacts for this type. Will never be NULL. */
} artifactlist;

#endif /* ARTIFACT_H */