|
LI2 Roguelite
|
#include <stdlib.h>#include <ncurses.h>#include "item.h"#include "map.h"#include "cell.h"#include "inventory.h"
Functions | |
| Item * | initItem (char *name, char symbol, int type, int value, int x, int y, int damage, int defense, int hp, int color) |
| Initialize a new item. More... | |
| Item * | initRock () |
| Initialize a new item: rock (weapon projectile) More... | |
| Item * | initSmokeBomb () |
| Initialize a new item: Smoke bomb (weapon projectile) More... | |
| Item * | initFireBomb () |
| Initialize a new item: Fire bomb (weapon projectile) More... | |
| Item * | initIceBomb () |
| Initialize a new item: Ice bomb (weapon projectile) More... | |
| Item * | initIronSword () |
| Initialize a new item: Iron Sword (weapon body) More... | |
| Item * | initGoldSword () |
| Initialize a new item: Gold Sword (weapon body) More... | |
| Item * | initDiamondSword () |
| Initialize a new item: Diamond Sword (weapon body) More... | |
| Item * | initLeatherArmor () |
| Initialize a new item: Leather armor (armor) More... | |
| Item * | initChainmailArmor () |
| Initialize a new item: Chainmail armor (armor) More... | |
| Item * | initPlateArmor () |
| Initialize a new item: Plate armor (armor) More... | |
| Item * | initPotionOfHealing () |
| Initialize a new item: Potion of healing. More... | |
| Item * | initSensoryPotion () |
| Initialize a new item: Sensory Potion. More... | |
| Item * | initPotionOfInvincibility () |
| Initialize a new item: Potion of invincibility. More... | |
| Item * | initPotOfGold () |
| Initialize a new item: Pot of gold. More... | |
| Item * | generateItem () |
| Generate a item randomly based on the probability of each item. More... | |
| Item ** | generateItems (int n) |
| Generate n random items. More... | |
| void | drawItem (Item *i) |
| Draw an item. 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... | |
| void drawAllItems | ( | Item ** | items, |
| int | n | ||
| ) |
Draw all items in the Map.
| items | Array of items to draw |
| n | Number of items in the array |
| void drawItem | ( | Item * | i | ) |
Draw an item.
| i | Item to draw |
Draw all visible items in the Map.
| map | Map |
| items | Array of items to draw |
| n | Number of items in the array |
| void freeItem | ( | void * | i | ) |
Free an item.
| i | Item to free |
| Item* generateItem | ( | ) |
Generate a item randomly based on the probability of each item.
TODO: Global variables for the probability of each item maybe
| 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.
| n | Number of items to generate |
Get item at (x, y) in the map, also removes it from the array.
TODO: use cell->item_index instead of x, y
| Item* initChainmailArmor | ( | ) |
Initialize a new item: Chainmail armor (armor)
| Item* initDiamondSword | ( | ) |
Initialize a new item: Diamond Sword (weapon body)
| Item* initFireBomb | ( | ) |
Initialize a new item: Fire bomb (weapon projectile)
| Item* initGoldSword | ( | ) |
Initialize a new item: Gold Sword (weapon body)
| Item* initIceBomb | ( | ) |
Initialize a new item: Ice bomb (weapon projectile)
| Item* initIronSword | ( | ) |
Initialize a new item: Iron Sword (weapon body)
| Item* initItem | ( | char * | name, |
| char | symbol, | ||
| int | type, | ||
| int | value, | ||
| int | x, | ||
| int | y, | ||
| int | damage, | ||
| int | defense, | ||
| int | hp, | ||
| int | color | ||
| ) |
Initialize a new item.
| x | Item x coordinate on the map if any |
| y | Item y coordinate on the map if any |
| name | Item name |
| symbol | Item symbol |
| type | Item type |
| value | Item value |
| damage | Item damage |
| defense | Item defense |
| hp | Item hp (Healing potion) |
| color | Item color |
| Item* initLeatherArmor | ( | ) |
Initialize a new item: Leather armor (armor)
| Item* initPlateArmor | ( | ) |
Initialize a new item: Plate armor (armor)
| Item* initPotionOfHealing | ( | ) |
Initialize a new item: Potion of healing.
| Item* initPotionOfInvincibility | ( | ) |
Initialize a new item: Potion of invincibility.
| Item* initPotOfGold | ( | ) |
Initialize a new item: Pot of gold.
Pot of gold is a special item that can be used to bribe the gate keeper.
It's value is between 10 and 100 gold.
It's added as gold to the player's inventory.
| Item* initRock | ( | ) |
Initialize a new item: rock (weapon projectile)
| Item* initSensoryPotion | ( | ) |
Initialize a new item: Sensory Potion.
TODO: Implement sensory potion width effect
| Item* initSmokeBomb | ( | ) |
Initialize a new item: Smoke bomb (weapon projectile)
TODO: Implement smoke bomb effect in pathfinding functions to cut the line of sight