|
Ludum Dare 29
HackSoc's entry for the Ludum Dare Jam 29
|
#include <stdbool.h>#include <curses.h>#include <string.h>#include "mob.h"#include "level.h"#include "utils.h"#include "player.h"#include "effect.h"
Functions | |
| static void | randomise_player (Mob *player) |
| static void | design_player (Mob *player) |
| Mob * | create_player () |
| bool | attackmove (Mob *player, unsigned int x, unsigned int y) |
| bool | attackmove_relative (Mob *player, int xdiff, int ydiff) |
| void | player_turn (Mob *player) |
| void | player_death (Mob *player) |
Variables | |
| const char * | names [] |
| const char * | races [] |
| const char * | professions [] |
| bool | quit |
| bool attackmove | ( | Mob * | player, |
| unsigned int | x, | ||
| unsigned int | y | ||
| ) |
Move and attack at the same time - if a mob is in the target cell, damage it, but don't move.
| player | Entity representing the player. |
| x | x-coordinate to move to. |
| y | y-coordinate to move to. |


| bool attackmove_relative | ( | Mob * | player, |
| int | xdiff, | ||
| int | ydiff | ||
| ) |
Like attackmove, but relative position.
| player | Entity representing the player. |
| xdiff | Difference in the x-axis to move. |
| ydiff | Difference in the y-axis to move. |


| Mob* create_player | ( | void | ) |
Create and return a new player. This prompts the user for stuff, and clears the screen when it is done.


|
static |
Have the human player enter the character player's name, race, and profession (the opposite of randomise_player).
| player | The player |


| void player_death | ( | Mob * | player | ) |
Say that the player is dead, and do stuff.
| player | Player that died. |


| void player_turn | ( | Mob * | player | ) |
Wait for user input, and then act accordingly.
| player | Player entity. |


|
static |
Randomise a player's name, race, and profession.
| player | The player |


| const char* names[] |
| const char* professions[] |
| bool quit |
Whether to quit the game or not.
| const char* races[] |
1.8.7