#include "cell.h"
#include "skill.h"
#include "item.h"
#include "main.h"
#include "genmacro.h"
Data Structures | |
struct | player |
Structure for storing character info. More... | |
Defines | |
#define | MAX_ATTRIB 100 |
#define | MAX_ITEMS 150 |
#define | PLAYER 2 |
#define | DIVINE_ASSASSIN 'a' |
#define | KNIGHT 'b' |
#define | ARCHER 'c' |
#define | HUMAN 'a' |
#define | FLOAT_RAND (float)(rand())/(float)(RAND_MAX) |
Returns random float from 0 to 1. | |
#define | WITH_PLAYER_INFO_POINTER(ip,...) struct player *foopl_mac = ip; __VA_ARGS__ |
Generates random int from <from> to <to> | |
#define | ADD_ITEM_TO_INV_MACRO(...) {struct item it; __VA_ARGS__ add_item_toinv (foopl_mac, it);} |
#define | ADD_SKILL_TO_BOX_MACRO(...) |
#define | SET_STAT(stat, num) foopl_mac->stat = num; |
Functions | |
void | createplayer (struct cell *level, int size, int race, int profession) |
Creates player and puts it into world. | |
int | getplayer (struct cell *level, int size) |
Finds a player in the world. | |
struct player * | getplayer_pointer (struct cell *level, int size) |
Wrapper around getplayer (). | |
int | moveplayer (struct cell *level, int columns, int rows, int dir) |
Moves player on one square in specified direction. | |
int | opendoor (struct leveldata ld, int columns, int rows, int dir) |
Opens a door. | |
int | closedoor (struct cell *level, int columns, int rows, int dir) |
Closes a door. | |
struct item * | get_item_by_key (struct player pl, char key) |
Gets item by its key (you can see it in inventory window). | |
void | addexp (struct player *pl, int dif) |
Adds expirience points to player. | |
int | checklevel (struct player *pl) |
Checks if player is able to get new level. | |
struct exit_code | dodmg_topl (struct player *pl, int dmg) |
Does damage to player. | |
void | add_item_toinv (struct player *pl, struct item itm) |
Adds item to inventory. | |
void | remove_item_frominv (struct player *pl, struct item itm) |
Removes item from inventory. |
#define ADD_ITEM_TO_INV_MACRO | ( | ... | ) | {struct item it; __VA_ARGS__ add_item_toinv (foopl_mac, it);} |
#define ADD_SKILL_TO_BOX_MACRO | ( | ... | ) |
#define ARCHER 'c' |
#define DIVINE_ASSASSIN 'a' |
#define FLOAT_RAND (float)(rand())/(float)(RAND_MAX) |
Returns random float from 0 to 1.
#define HUMAN 'a' |
#define KNIGHT 'b' |
#define MAX_ATTRIB 100 |
#define MAX_ITEMS 150 |
#define PLAYER 2 |
#define SET_STAT | ( | stat, | |||
num | ) | foopl_mac->stat = num; |
#define WITH_PLAYER_INFO_POINTER | ( | ip, | |||
... | ) | struct player *foopl_mac = ip; __VA_ARGS__ |
Generates random int from <from> to <to>
Adds item to inventory.
pl | - Player | |
itm | - item |
void addexp | ( | struct player * | pl, | |
int | dif | |||
) |
Adds expirience points to player.
dif | - difficulty of killed monster |
Warning: use this function instead of accessing player::xp directly
int checklevel | ( | struct player * | pl | ) |
Checks if player is able to get new level.
int closedoor | ( | struct cell * | level, | |
int | columns, | |||
int | rows, | |||
int | dir | |||
) |
Closes a door.
See opendoor ()
void createplayer | ( | struct cell * | level, | |
int | size, | |||
int | race, | |||
int | profession | |||
) |
Creates player and puts it into world.
level | - Level | |
size | - Size of level | |
race | - Race of new player |
- profession of new player
Does damage to player.
Hits player when monster has turn
pl | - Player | |
dmg | - Damage without respect to player's AC |
Gets item by its key (you can see it in inventory window).
player | - Owner of inventory | |
key | - symbolic key |
int getplayer | ( | struct cell * | level, | |
int | size | |||
) |
Finds a player in the world.
level | - Level where player can be found | |
size | - Size of level |
Wrapper around getplayer ().
int moveplayer | ( | struct cell * | level, | |
int | columns, | |||
int | rows, | |||
int | dir | |||
) |
Moves player on one square in specified direction.
level | - See above | |
columns | - Columns in the field of the game | |
rows | - Rows in the field of the game | |
dir | - Direction (e.g. K, L, U or something else) |
int opendoor | ( | struct leveldata | ld, | |
int | columns, | |||
int | rows, | |||
int | dir | |||
) |
Opens a door.
Arguments like in function above