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
 

Typedefs

typedef struct artifact artifact_t
 
typedef struct artifact_list artifact_list_t
 

Functions

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.

Parameters
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).

Parameters
nameName of the artifact to find.
typeType of the artifact to find.
Returns
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.

Parameters
opObject.
difficultyDifficulty.
affinityTreasure affinity.
Returns
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.

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

Definition at line 397 of file artifact.c.