#include <libintl.h>
#include <locale.h>
#include "player.h"
#include "level.h"
#include "monster.h"
#include "functions.h"
#include "quest.h"
#include "genmacro.h"
#include <stdlib.h>
#include <math.h>
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. |
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