44 #define MAX_ITEM_NAME 20
56 #define ROCK_DAMAGE_MIN 5
57 #define ROCK_DAMAGE_MAX 7
58 #define ROCK_SYMBOL ':'
59 #define ROCK_TYPE PROJECTILE
61 #define ROCK_COLOR COLOR_CYAN
64 #define SMOKE_BOMB_VALUE 30
65 #define SMOKE_BOMB_DAMAGE_MIN 10
66 #define SMOKE_BOMB_DAMAGE_MAX 20
67 #define SMOKE_BOMB_SYMBOL '*'
68 #define SMOKE_BOMB_TYPE PROJECTILE
69 #define SMOKE_BOMB_RANGE 5
70 #define SMOKE_BOMB_COLOR COLOR_WHITE
71 #define SMOKE_BOMB_EFFECT 1
72 #define SMOKE_BOMB_DURATION 5
75 #define FIRE_BOMB_VALUE 50
76 #define FIRE_BOMB_DAMAGE_MIN 15
77 #define FIRE_BOMB_DAMAGE_MAX 25
78 #define FIRE_BOMB_SYMBOL '*'
79 #define FIRE_BOMB_TYPE PROJECTILE
80 #define FIRE_BOMB_RANGE 6
81 #define FIRE_BOMB_COLOR COLOR_RED
82 #define FIRE_BOMB_EFFECT 2
83 #define FIRE_BOMB_EFFECT_DAMAGE 7
84 #define FIRE_BOMB_DURATION 5
87 #define ICE_BOMB_VALUE 70
88 #define ICE_BOMB_DAMAGE_MIN 20
89 #define ICE_BOMB_DAMAGE_MAX 30
90 #define ICE_BOMB_SYMBOL '*'
91 #define ICE_BOMB_TYPE PROJECTILE
92 #define ICE_BOMB_RANGE 7
93 #define ICE_BOMB_COLOR COLOR_CYAN
94 #define ICE_BOMB_EFFECT 3
95 #define ICE_BOMB_DURATION 7
98 #define IRON_SWORD_VALUE 20
99 #define IRON_SWORD_DAMAGE_MIN 10
100 #define IRON_SWORD_DAMAGE_MAX 20
101 #define IRON_SWORD_SYMBOL 'l'
102 #define IRON_SWORD_TYPE WEAPON
103 #define IRON_SWORD_COLOR COLOR_WHITE
106 #define GOLD_SWORD_VALUE 40
107 #define GOLD_SWORD_DAMAGE_MIN 20
108 #define GOLD_SWORD_DAMAGE_MAX 30
109 #define GOLD_SWORD_SYMBOL 'l'
110 #define GOLD_SWORD_TYPE WEAPON
111 #define GOLD_SWORD_COLOR COLOR_YELLOW
114 #define DIAMOND_SWORD_VALUE 60
115 #define DIAMOND_SWORD_DAMAGE_MIN 30
116 #define DIAMOND_SWORD_DAMAGE_MAX 40
117 #define DIAMOND_SWORD_SYMBOL 'l'
118 #define DIAMOND_SWORD_TYPE WEAPON
119 #define DIAMOND_SWORD_COLOR COLOR_CYAN
122 #define LEATHER_ARMOR_VALUE 20
123 #define LEATHER_ARMOR_DEFENSE 20
124 #define LEATHER_ARMOR_SYMBOL 'T'
125 #define LEATHER_ARMOR_TYPE ARMOR
126 #define LEATHER_ARMOR_COLOR COLOR_WHITE
129 #define CHAINMAIL_ARMOR_VALUE 40
130 #define CHAINMAIL_ARMOR_DEFENSE 40
131 #define CHAINMAIL_ARMOR_SYMBOL 'T'
132 #define CHAINMAIL_ARMOR_TYPE ARMOR
133 #define CHAINMAIL_ARMOR_COLOR COLOR_GREEN
136 #define PLATE_ARMOR_VALUE 60
137 #define PLATE_ARMOR_DEFENSE 60
138 #define PLATE_ARMOR_SYMBOL 'T'
139 #define PLATE_ARMOR_TYPE ARMOR
140 #define PLATE_ARMOR_COLOR COLOR_MAGENTA
143 #define POTION_OF_HEALING_SYMBOL '!'
144 #define POTION_OF_HEALING_TYPE POTION
145 #define POTION_OF_HEALING_VALUE 20
146 #define POTION_OF_HEALING_HP 50
147 #define POTION_OF_HEALING_COLOR COLOR_MAGENTA
150 #define SENSORY_POTION_SYMBOL '!'
151 #define SENSORY_POTION_TYPE POTION
152 #define SENSORY_POTION_VALUE 50
153 #define SENSORY_POTION_VISION_RANGE 10
154 #define SENSORY_POTION_VISION_WIDTH 2
155 #define SENSORY_POTION_EARING_RANGE 20
156 #define SENSORY_POTION_EARING_PROB 60
157 #define SENSORY_POTION_TURNS 60
158 #define SENSORY_POTION_RANGE 10
159 #define SENSORY_POTION_COLOR COLOR_BLUE
162 #define POTION_OF_INVINCIBILITY_SYMBOL '!'
163 #define POTION_OF_INVINCIBILITY_TYPE POTION
164 #define POTION_OF_INVINCIBILITY_VALUE 100
165 #define POTION_OF_INVINCIBILITY_TURNS 40
166 #define POTION_OF_INVINCIBILITY_DEFENSE 100
167 #define POTION_OF_INVINCIBILITY_COLOR COLOR_GREEN
170 #define POT_OF_GOLD_SYMBOL 'O'
171 #define POT_OF_GOLD_TYPE GOLD
172 #define POT_OF_GOLD_VALUE_MIN 1
173 #define POT_OF_GOLD_VALUE_MAX 10
174 #define POT_OF_GOLD_COLOR COLOR_YELLOW
179 Item*
getItem(
Item **items,
int nr_items,
unsigned int x,
unsigned int y);
Item * getItem(Item **items, int nr_items, unsigned int x, unsigned int y)
Get item at (x, y) in the map, also removes it from the array.
Definition: item.c:323
Item ** generateItems(int n)
Generate n random items.
Definition: item.c:265
struct item Item
Item structure represents an item in the game.
void drawAllItems(Item **items, int n)
Draw all items in the Map.
Definition: item.c:293
void freeItem(void *i)
Free an item.
Definition: item.c:368
void drawVisibleItems(Map *map, Item **items, int n)
Draw all visible items in the Map.
Definition: item.c:307
int insertItem(Item **items, int nr_items, Item *item)
insert item into the items array (inventory)
Definition: item.c:343
Item structure represents an item in the game.
Definition: item.h:28
int damage
Definition: item.h:35
int range
Definition: item.h:39
int hp
Definition: item.h:37
int defense
Definition: item.h:36
int value
Definition: item.h:32
int count
Definition: item.h:38
int type
Definition: item.h:31
int color
Definition: item.h:40
unsigned int y
Definition: item.h:34
char symbol
Definition: item.h:30
char * name
Definition: item.h:29
unsigned int x
Definition: item.h:33
Structure that represents a map in the game.
Definition: map.h:26