Atrinik Server  4.0
Data Structures | Typedefs | Functions
artifact.h File Reference

Go to the source code of this file.

Data Structures

struct  artifact
struct  artifact_list


typedef struct artifact artifact_t
typedef struct artifact_list artifact_list_t


void artifact_init (void)
void artifact_deinit (void)
artifact_list_tartifact_list_find (uint8_t type)
artifact_tartifact_find_type (const char *name, uint8_t type)
void artifact_change_object (artifact_t *art, object *op)
bool artifact_generate (object *op, int difficulty, treasure_affinity_t *affinity)

Detailed Description

Artifact related structures.

Definition in file artifact.h.

Typedef Documentation

Artifact list structure.

typedef struct artifact artifact_t

The artifact structure.

Function Documentation

void artifact_change_object ( artifact_t art,
object op 

Fixes the given object, giving it the abilities and titles it should have due to the artifact template.

artThe artifact.
opThe object to change.

Definition at line 446 of file artifact.c.

void artifact_deinit ( void  )

Deinitializes artifacts code.

Definition at line 60 of file artifact.c.

artifact_t* artifact_find_type ( const char *  name,
uint8_t  type 

Find an artifact by its name and type (as there are several lists of artifacts, depending on their types).

nameName of the artifact to find.
typeType of the artifact to find.
The artifact if found, NULL otherwise.

Definition at line 419 of file artifact.c.

bool artifact_generate ( object op,
int  difficulty,
treasure_affinity_t *  affinity 

Decides randomly which artifact the object should be turned into. Makes sure that the item can become that artifact (means magic, difficulty, and Allowed fields properly). Then calls artifact_change_object() in order to actually create the artifact.

affinityTreasure affinity.
Whether the object was turned into an artifact.

Definition at line 541 of file artifact.c.

void artifact_init ( void  )

Initializes artifacts code.

Definition at line 51 of file artifact.c.

artifact_list_t* artifact_list_find ( uint8_t  type)

Searches the artifact lists and returns one that has the same type of objects on it.

typeType to search for.
NULL if no suitable list found.

Definition at line 397 of file artifact.c.