Go to the source code of this file.
|
| struct | item |
| | Item structure represents an item in the game. More...
|
| |
|
| Item ** | generateItems (int n) |
| | Generate n random items. More...
|
| |
| void | drawAllItems (Item **items, int n) |
| | Draw all items in the Map. More...
|
| |
| void | drawVisibleItems (Map *map, Item **items, int n) |
| | Draw all visible items in the Map. More...
|
| |
| 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. More...
|
| |
| int | insertItem (Item **items, int nr_items, Item *item) |
| | insert item into the items array (inventory) More...
|
| |
| void | freeItem (void *i) |
| | Free an item. More...
|
| |
◆ ARMOR
◆ CHAINMAIL_ARMOR_COLOR
| #define CHAINMAIL_ARMOR_COLOR COLOR_GREEN |
◆ CHAINMAIL_ARMOR_DEFENSE
| #define CHAINMAIL_ARMOR_DEFENSE 40 |
◆ CHAINMAIL_ARMOR_SYMBOL
| #define CHAINMAIL_ARMOR_SYMBOL 'T' |
◆ CHAINMAIL_ARMOR_TYPE
| #define CHAINMAIL_ARMOR_TYPE ARMOR |
◆ CHAINMAIL_ARMOR_VALUE
| #define CHAINMAIL_ARMOR_VALUE 40 |
◆ DIAMOND_SWORD_COLOR
| #define DIAMOND_SWORD_COLOR COLOR_CYAN |
◆ DIAMOND_SWORD_DAMAGE_MAX
| #define DIAMOND_SWORD_DAMAGE_MAX 40 |
◆ DIAMOND_SWORD_DAMAGE_MIN
| #define DIAMOND_SWORD_DAMAGE_MIN 30 |
◆ DIAMOND_SWORD_SYMBOL
| #define DIAMOND_SWORD_SYMBOL 'l' |
◆ DIAMOND_SWORD_TYPE
| #define DIAMOND_SWORD_TYPE WEAPON |
◆ DIAMOND_SWORD_VALUE
| #define DIAMOND_SWORD_VALUE 60 |
◆ FIRE_BOMB_COLOR
| #define FIRE_BOMB_COLOR COLOR_RED |
◆ FIRE_BOMB_DAMAGE_MAX
| #define FIRE_BOMB_DAMAGE_MAX 25 |
◆ FIRE_BOMB_DAMAGE_MIN
| #define FIRE_BOMB_DAMAGE_MIN 15 |
◆ FIRE_BOMB_DURATION
| #define FIRE_BOMB_DURATION 5 |
◆ FIRE_BOMB_EFFECT
| #define FIRE_BOMB_EFFECT 2 |
◆ FIRE_BOMB_EFFECT_DAMAGE
| #define FIRE_BOMB_EFFECT_DAMAGE 7 |
◆ FIRE_BOMB_RANGE
| #define FIRE_BOMB_RANGE 6 |
◆ FIRE_BOMB_SYMBOL
| #define FIRE_BOMB_SYMBOL '*' |
◆ FIRE_BOMB_TYPE
◆ FIRE_BOMB_VALUE
| #define FIRE_BOMB_VALUE 50 |
◆ GOLD
◆ GOLD_SWORD_COLOR
| #define GOLD_SWORD_COLOR COLOR_YELLOW |
◆ GOLD_SWORD_DAMAGE_MAX
| #define GOLD_SWORD_DAMAGE_MAX 30 |
◆ GOLD_SWORD_DAMAGE_MIN
| #define GOLD_SWORD_DAMAGE_MIN 20 |
◆ GOLD_SWORD_SYMBOL
| #define GOLD_SWORD_SYMBOL 'l' |
◆ GOLD_SWORD_TYPE
| #define GOLD_SWORD_TYPE WEAPON |
◆ GOLD_SWORD_VALUE
| #define GOLD_SWORD_VALUE 40 |
◆ ICE_BOMB_COLOR
| #define ICE_BOMB_COLOR COLOR_CYAN |
◆ ICE_BOMB_DAMAGE_MAX
| #define ICE_BOMB_DAMAGE_MAX 30 |
◆ ICE_BOMB_DAMAGE_MIN
| #define ICE_BOMB_DAMAGE_MIN 20 |
◆ ICE_BOMB_DURATION
| #define ICE_BOMB_DURATION 7 |
◆ ICE_BOMB_EFFECT
| #define ICE_BOMB_EFFECT 3 |
◆ ICE_BOMB_RANGE
◆ ICE_BOMB_SYMBOL
| #define ICE_BOMB_SYMBOL '*' |
◆ ICE_BOMB_TYPE
◆ ICE_BOMB_VALUE
| #define ICE_BOMB_VALUE 70 |
◆ IRON_SWORD_COLOR
| #define IRON_SWORD_COLOR COLOR_WHITE |
◆ IRON_SWORD_DAMAGE_MAX
| #define IRON_SWORD_DAMAGE_MAX 20 |
◆ IRON_SWORD_DAMAGE_MIN
| #define IRON_SWORD_DAMAGE_MIN 10 |
◆ IRON_SWORD_SYMBOL
| #define IRON_SWORD_SYMBOL 'l' |
◆ IRON_SWORD_TYPE
| #define IRON_SWORD_TYPE WEAPON |
◆ IRON_SWORD_VALUE
| #define IRON_SWORD_VALUE 20 |
◆ LEATHER_ARMOR_COLOR
| #define LEATHER_ARMOR_COLOR COLOR_WHITE |
◆ LEATHER_ARMOR_DEFENSE
| #define LEATHER_ARMOR_DEFENSE 20 |
◆ LEATHER_ARMOR_SYMBOL
| #define LEATHER_ARMOR_SYMBOL 'T' |
◆ LEATHER_ARMOR_TYPE
| #define LEATHER_ARMOR_TYPE ARMOR |
◆ LEATHER_ARMOR_VALUE
| #define LEATHER_ARMOR_VALUE 20 |
◆ MAX_ITEM_NAME
◆ MAX_ITEMS
◆ PLATE_ARMOR_COLOR
| #define PLATE_ARMOR_COLOR COLOR_MAGENTA |
◆ PLATE_ARMOR_DEFENSE
| #define PLATE_ARMOR_DEFENSE 60 |
◆ PLATE_ARMOR_SYMBOL
| #define PLATE_ARMOR_SYMBOL 'T' |
◆ PLATE_ARMOR_TYPE
| #define PLATE_ARMOR_TYPE ARMOR |
◆ PLATE_ARMOR_VALUE
| #define PLATE_ARMOR_VALUE 60 |
◆ POT_OF_GOLD_COLOR
| #define POT_OF_GOLD_COLOR COLOR_YELLOW |
◆ POT_OF_GOLD_SYMBOL
| #define POT_OF_GOLD_SYMBOL 'O' |
◆ POT_OF_GOLD_TYPE
| #define POT_OF_GOLD_TYPE GOLD |
◆ POT_OF_GOLD_VALUE_MAX
| #define POT_OF_GOLD_VALUE_MAX 10 |
◆ POT_OF_GOLD_VALUE_MIN
| #define POT_OF_GOLD_VALUE_MIN 1 |
◆ POTION
◆ POTION_OF_HEALING_COLOR
| #define POTION_OF_HEALING_COLOR COLOR_MAGENTA |
◆ POTION_OF_HEALING_HP
| #define POTION_OF_HEALING_HP 50 |
◆ POTION_OF_HEALING_SYMBOL
| #define POTION_OF_HEALING_SYMBOL '!' |
◆ POTION_OF_HEALING_TYPE
| #define POTION_OF_HEALING_TYPE POTION |
◆ POTION_OF_HEALING_VALUE
| #define POTION_OF_HEALING_VALUE 20 |
◆ POTION_OF_INVINCIBILITY_COLOR
| #define POTION_OF_INVINCIBILITY_COLOR COLOR_GREEN |
◆ POTION_OF_INVINCIBILITY_DEFENSE
| #define POTION_OF_INVINCIBILITY_DEFENSE 100 |
◆ POTION_OF_INVINCIBILITY_SYMBOL
| #define POTION_OF_INVINCIBILITY_SYMBOL '!' |
◆ POTION_OF_INVINCIBILITY_TURNS
| #define POTION_OF_INVINCIBILITY_TURNS 40 |
◆ POTION_OF_INVINCIBILITY_TYPE
| #define POTION_OF_INVINCIBILITY_TYPE POTION |
◆ POTION_OF_INVINCIBILITY_VALUE
| #define POTION_OF_INVINCIBILITY_VALUE 100 |
◆ PROJECTILE
◆ ROCK_COLOR
| #define ROCK_COLOR COLOR_CYAN |
◆ ROCK_DAMAGE_MAX
| #define ROCK_DAMAGE_MAX 7 |
◆ ROCK_DAMAGE_MIN
| #define ROCK_DAMAGE_MIN 5 |
◆ ROCK_RANGE
◆ ROCK_SYMBOL
◆ ROCK_TYPE
◆ ROCK_VALUE
◆ SENSORY_POTION_COLOR
| #define SENSORY_POTION_COLOR COLOR_BLUE |
◆ SENSORY_POTION_EARING_PROB
| #define SENSORY_POTION_EARING_PROB 60 |
◆ SENSORY_POTION_EARING_RANGE
| #define SENSORY_POTION_EARING_RANGE 20 |
◆ SENSORY_POTION_RANGE
| #define SENSORY_POTION_RANGE 10 |
◆ SENSORY_POTION_SYMBOL
| #define SENSORY_POTION_SYMBOL '!' |
◆ SENSORY_POTION_TURNS
| #define SENSORY_POTION_TURNS 60 |
◆ SENSORY_POTION_TYPE
| #define SENSORY_POTION_TYPE POTION |
◆ SENSORY_POTION_VALUE
| #define SENSORY_POTION_VALUE 50 |
◆ SENSORY_POTION_VISION_RANGE
| #define SENSORY_POTION_VISION_RANGE 10 |
◆ SENSORY_POTION_VISION_WIDTH
| #define SENSORY_POTION_VISION_WIDTH 2 |
◆ SMOKE_BOMB_COLOR
| #define SMOKE_BOMB_COLOR COLOR_WHITE |
◆ SMOKE_BOMB_DAMAGE_MAX
| #define SMOKE_BOMB_DAMAGE_MAX 20 |
◆ SMOKE_BOMB_DAMAGE_MIN
| #define SMOKE_BOMB_DAMAGE_MIN 10 |
◆ SMOKE_BOMB_DURATION
| #define SMOKE_BOMB_DURATION 5 |
◆ SMOKE_BOMB_EFFECT
| #define SMOKE_BOMB_EFFECT 1 |
◆ SMOKE_BOMB_RANGE
| #define SMOKE_BOMB_RANGE 5 |
◆ SMOKE_BOMB_SYMBOL
| #define SMOKE_BOMB_SYMBOL '*' |
◆ SMOKE_BOMB_TYPE
◆ SMOKE_BOMB_VALUE
| #define SMOKE_BOMB_VALUE 30 |
◆ WEAPON
◆ Item
Item structure represents an item in the game.
This struct represents an item in the game. It can be a weapon, armor, potion or gold. Items are drawn in the map if the cell is visible. They are picked up by the player when he steps on them. And they are added to the player inventory.
- Parameters
-
| name | the name of the item |
| symbol | the symbol that represents the item |
| type | the type of item |
| value | the value of the item in gold |
| x | the x coordinate of the item |
| y | the y coordinate of the item |
| damage | the damage of the item if it is a weapon |
| defense | the defense of the item if it is armor |
| hp | the hp of the item if it is a healing potion |
| count | the number of the same items |
| range | the range of the item if it is a projectile |
| color | the color of the item |
◆ Map
◆ drawAllItems()
| void drawAllItems |
( |
Item ** |
items, |
|
|
int |
n |
|
) |
| |
Draw all items in the Map.
- Parameters
-
| items | Array of items to draw |
| n | Number of items in the array |
- Returns
- void
◆ drawVisibleItems()
| void drawVisibleItems |
( |
Map * |
map, |
|
|
Item ** |
items, |
|
|
int |
n |
|
) |
| |
Draw all visible items in the Map.
- Parameters
-
| map | Map |
| items | Array of items to draw |
| n | Number of items in the array |
- Returns
- void
◆ freeItem()
| void freeItem |
( |
void * |
i | ) |
|
Free an item.
- Parameters
-
- Returns
- void
◆ generateItems()
| Item** generateItems |
( |
int |
n | ) |
|
Generate n random items.
Used to generate items to distribute on the map.
random items are generated based on each item probability.
- Parameters
-
| n | Number of items to generate |
- Returns
- Item** Array of items
◆ getItem()
| 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.
TODO: use cell->item_index instead of x, y
◆ insertItem()
| int insertItem |
( |
Item ** |
items, |
|
|
int |
nr_items, |
|
|
Item * |
item |
|
) |
| |
insert item into the items array (inventory)
- Returns
- int the number of items in the array