Atrinik Server  4.0
artifact.h
Go to the documentation of this file.
1 /*************************************************************************
2  * Atrinik, a Multiplayer Online Role Playing Game *
3  * *
4  * Copyright (C) 2009-2014 Alex Tokar and Atrinik Development Team *
5  * *
6  * Fork from Crossfire (Multiplayer game for X-windows). *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
21  * *
22  * The author can be reached at admin@atrinik.org *
23  ************************************************************************/
24 
30 #ifndef ARTIFACT_H
31 #define ARTIFACT_H
32 
33 /* Forward declarations */
34 struct archetype;
35 
39 typedef struct artifact {
40  struct artifact *next;
41  shstr_list_t *allowed;
42 
46  char *parse_text;
47 
51  struct archetype *def_at;
52 
56  shstr *def_at_name;
57 
61  treasure_affinity_t *affinity;
62 
63  uint16_t chance;
64  uint8_t difficulty;
65 
70  bool copy_artifact:1;
71 
75  bool disallowed:1;
76 } artifact_t;
77 
81 typedef struct artifact_list {
82  struct artifact_list *next;
83 
84  struct artifact *items;
85  uint16_t total_chance;
86 
91  uint8_t type;
93 
94 /* Prototypes */
95 
96 void
97 artifact_init(void);
98 void
99 artifact_deinit(void);
101 artifact_list_find(uint8_t type);
102 artifact_t *
103 artifact_find_type(const char *name, uint8_t type);
104 void
105 artifact_change_object(artifact_t *art, object *op);
106 bool
107 artifact_generate(object *op,
108  int difficulty,
109  treasure_affinity_t *affinity);
110 
111 #endif
struct artifact * items
Artifacts in this artifact list.
Definition: artifact.h:84
uint8_t type
One of operation types.
Definition: sound_ambient.c:45
shstr_list_t * allowed
List of allowed archetypes.
Definition: artifact.h:41
char * parse_text
Definition: artifact.h:46
Definition: arch.h:40
uint8_t type
Definition: artifact.h:91
artifact_list_t * artifact_list_find(uint8_t type)
Definition: artifact.c:397
uint8_t difficulty
Difficulty.
Definition: artifact.h:64
artifact_t * artifact_find_type(const char *name, uint8_t type)
Definition: artifact.c:419
void artifact_deinit(void)
Definition: artifact.c:60
bool copy_artifact
Definition: artifact.h:70
struct artifact_list * next
Next list.
Definition: artifact.h:82
shstr * def_at_name
Definition: artifact.h:56
struct artifact_list artifact_list_t
void artifact_init(void)
Definition: artifact.c:51
bool disallowed
Definition: artifact.h:75
struct artifact artifact_t
bool artifact_generate(object *op, int difficulty, treasure_affinity_t *affinity)
Definition: artifact.c:541
treasure_affinity_t * affinity
Definition: artifact.h:61
struct archetype * def_at
Definition: artifact.h:51
void artifact_change_object(artifact_t *art, object *op)
Definition: artifact.c:446
uint16_t total_chance
Sum of chance for all artifacts on this list.
Definition: artifact.h:85
struct artifact * next
Next artifact in the list.
Definition: artifact.h:40
uint16_t chance
Chance.
Definition: artifact.h:63