helapordo 1.4.12
|
#include <panel.h>
#include <menu.h>
#include <locale.h>
#include "../utils/turn_op.h"
#include "../core/game_animations.h"
Go to the source code of this file.
Macros | |
#define | HLPD_DEFAULT_SCREEN_ROWS 24 |
#define | HLPD_DEFAULT_SCREEN_COLS 80 |
#define | HLPD_MIN_SCREEN_ROWS (HLPD_DEFAULT_SCREEN_ROWS+8) |
Defines minimum y size for game screen. | |
#define | HLPD_MIN_SCREEN_COLS (HLPD_DEFAULT_SCREEN_COLS) |
Defines minimum x size for game screen. | |
Functions | |
void | plot_line_in_ncurses (int x1, int y1, int x2, int y2) |
void | print_encoded_char (WINDOW *w, int y, int x, char c) |
Takes a WINDOW pointer, two integers for coordinates and a char. | |
void | displayLore (char **lore_strings, int lore_counter) |
Displays a certain lore string. | |
void | printBattleStats (WINDOW *wins[3], Fighter *f, Enemy *e) |
Takes a Fighter and a Enemy pointers and prints most of their values formatted. | |
void | init_wins (WINDOW **wins, Enemy *e, Fighter *f) |
Takes an array pointer of WINDOW pointers, a Fighter and a Enemy pointers and initialises the passed windows. | |
void | win_show (WINDOW *win, Enemy *e, Fighter *f, int isEnemy, int border) |
Takes a WINDOW , a Fighter and a Enemy pointers and prints the appropriate content to it based on isEnemy integer passed. | |
void | print_in_panel (WINDOW *win, int starty, int startx, int width, Enemy *e, Fighter *f, int isEnemy) |
Takes a WINDOW , a Fighter and a Enemy pointers and prints the appropriate content to it based on isEnemy integer passed. | |
void | printBossBattleStats (WINDOW *wins[3], Fighter *f, Boss *b) |
Takes a Fighter and a Boss pointers and prints most of their values formatted. | |
void | init_boss_wins (WINDOW **wins, Boss *b, Fighter *f) |
Takes an array pointer of WINDOW pointers, a Fighter and a Boss pointers and initialises the passed windows. | |
void | boss_win_show (WINDOW *win, Boss *b, Fighter *f, int isBoss, int border) |
Takes a WINDOW , a Fighter and a Boss pointers and prints the appropriate content to it based on isBoss integer passed. | |
void | boss_print_in_panel (WINDOW *win, int starty, int startx, int width, Boss *b, Fighter *f, int isBoss) |
Takes a WINDOW , a Fighter and a Boss pointers and prints the appropriate content to it based on isBoss integer passed. | |
void | setEquipslotSprite (Equipslot *s) |
Takes a Equipslot pointer and prepares its sprite field by copying it line by line from equipzones_sprites, defined in sprites.h header. | |
void | setEnemySprite (Enemy *e) |
Takes a Enemy pointer and prepares its sprite field by copying it line by line from enemies_sprites, defined in sprites.h header. | |
void | setBossSprite (Boss *b) |
Takes a Boss pointer and prepares its sprite field by copying it line by line from bosses_sprites, defined in sprites.h header. | |
void | setFighterSprite (Fighter *f) |
Takes a Fighter pointer and prepares its sprite field by copying it line by line. | |
void | setChestSprite (Chest *c) |
Takes a Chest pointer and prepares its sprite field by copying it line by line. | |
void | updateSelectedConsumableW (WINDOW *w, MENU *my_menu, Fighter *f) |
Takes a WINDOW, a MENU and a Fighter pointers and updates the window contents with the selected Consumable from the fighter's bag, in the passed MENU pointer. | |
void | updateSelectedArtifactW (WINDOW *w, MENU *my_menu, Fighter *f) |
Takes a WINDOW, a MENU and a Fighter pointers and updates the window contents with the selected Artifact from the Fighter's artifactsBag, in the passed MENU pointer. | |
void | updateSelectedEquipW (WINDOW *w, MENU *my_menu, Equip *selected, Fighter *f) |
Takes a WINDOW and MENU pointers and updates the window contents with the passed Equip. | |
void | updateEquipslotsWin (WINDOW *w, Fighter *f) |
Takes a WINDOW and Fighter pointers and updates the window contents with the current Equipzone information. | |
void | updateSelectedSpecialW (WINDOW *w, MENU *my_menu, Fighter *f) |
Takes a WINDOW and MENU pointers and updates the window contents with the selected Special in the passed MENU pointer. | |
void | updateShopDisplayW_Equip (WINDOW *w, Equip *e) |
Takes a WINDOW and Equip pointers and updates the window contents with the Equip stats. | |
void | updateShopDisplayW_Consumable (WINDOW *w, Consumable *c) |
Takes a WINDOW and Consumable pointers and updates the window contents with the Consumable stats. | |
void | debug_printFoeParty (FoeParty *fp) |
Takes a FoeParty pointer and prints its current values. | |
void | display_printFoeParty (FoeParty *fp) |
Takes a FoeParty pointer and prints its current layout into up to 3 new WINDOWS, deleted before returning. | |
void | printLoadout (Fighter *f) |
Takes a Fighter pointer and prints its current loadout from the equipslots field. | |
void | displayEquipbagMenu (Fighter *f) |
Takes a Fighter pointer and displays its equipsbag information. | |
void | handleConsumables (Fighter *f, Enemy *e, Boss *b, int isBoss) |
Takes a Fighter, an Enemy and a Boss pointers and prints content of consumablesBag before asking user input to use a Consumable. | |
void | handleArtifacts (Fighter *f) |
Takes a Fighter pointer and prints content of artifactsBag. | |
void | handleEquips (Fighter *f, Path *p) |
Takes a Fighter and a Path pointers and asks user input to manage the Equips in fighter's equipsBag. | |
void | fight_Special (specialMove move, WINDOW *w, Fighter *f, Enemy *e, Boss *b, Path *p, int roomIndex, int enemyIndex, int isBoss) |
Takes a specialMove, a Fighter, a Enemy, a Boss and a Path pointers (and integers for current room and enemy indexes) and uses the requested special move. | |
void | handleSpecials (Fighter *f, Enemy *e, Boss *b, Path *p, int roomIndex, int enemyIndex, int isBoss) |
Takes a Fighter, a Enemy, a Boss and a Path pointers (and integers for current room and enemy indexes) and asks user input to use an unlocked special attack. | |
void | handleStats (Fighter *f) |
Takes a Fighter pointer and prints its stats field with all the values, formatted. | |
void | handleTutorial (void) |
Shows tutorial info. | |
int | handleRogueMenu (Gamestate *gmst, Path *p, Fighter *player, Room *room, loadInfo *load_info, Koliseo *kls, Koliseo_Temp *t_kls) |
Takes a Fighter, a Path, and a Room pointers and handles menu for Rogue mode. | |
int | handleGameOptions (GameOptions *game_options) |
Takes a GameOptions pointer and prompts the user with a form to change options. | |
void | draw_buildinfo (WINDOW *win) |
int | hlpd_prep_saveslot_path (char save_path[300], Fighter *player, Path *path, loadInfo *load_info, GameOptions *game_options) |
Prompts the user to pick a saveslot and stores the corresponding path into the passed buffer. | |
void | hlpd_draw_notifications (RingaBuf *rb_notifications, WINDOW *notifications_win) |
Takes a RingaBuf to take the Notification from, and a WINDOW to draw them to. | |
#define HLPD_DEFAULT_SCREEN_COLS 80 |
#define HLPD_DEFAULT_SCREEN_ROWS 24 |
#define HLPD_MIN_SCREEN_COLS (HLPD_DEFAULT_SCREEN_COLS) |
Defines minimum x size for game screen.
#define HLPD_MIN_SCREEN_ROWS (HLPD_DEFAULT_SCREEN_ROWS+8) |
Defines minimum y size for game screen.
void boss_print_in_panel | ( | WINDOW * | win, |
int | starty, | ||
int | startx, | ||
int | width, | ||
Boss * | b, | ||
Fighter * | f, | ||
int | isBoss ) |
Takes a WINDOW , a Fighter and a Boss pointers and prints the appropriate content to it based on isBoss integer passed.
Additional parameters set coordinates for the output.
win | The WINDOW pointer to print to. |
f | The Fighter pointer with stats to print. |
b | The Boss pointer with stats to print. |
isBoss | The integer indicating if the current window is for the boss stats, the fighter stats or the legend panel. |
starty | The integer indicating starting y coordinate. |
startx | The integer indicating starting x coordinate. |
width | The integer indicating panel width. |
Takes a WINDOW , a Fighter and a Boss pointers and prints the appropriate content to it based on isBoss integer passed.
win | The WINDOW pointer to print to. |
f | The Fighter pointer with stats to print. |
b | The Boss pointer with stats to print. |
isBoss | The integer indicating if the current window is for the boss stats, the fighter stats or the legend panel. |
border | The integer indicating if the current window should have a horizontal line bordering the label text. |
void debug_printFoeParty | ( | FoeParty * | fp | ) |
Takes a FoeParty pointer and prints its current values.
fp | The FoeParty pointer with to print. |
void display_printFoeParty | ( | FoeParty * | fp | ) |
Takes a FoeParty pointer and prints its current layout into up to 3 new WINDOWS, deleted before returning.
fp | The FoeParty pointer whose layout will be displayed. |
void displayEquipbagMenu | ( | Fighter * | f | ) |
Takes a Fighter pointer and displays its equipsbag information.
f | The fighter pointer whose equipsbag will be displayed. |
void displayLore | ( | char ** | lore_strings, |
int | lore_counter ) |
Displays a certain lore string.
lore_strings | The array of strings to display from. |
lore_counter | The index of current string. |
void draw_buildinfo | ( | WINDOW * | win | ) |
void fight_Special | ( | specialMove | move, |
WINDOW * | w, | ||
Fighter * | f, | ||
Enemy * | e, | ||
Boss * | b, | ||
Path * | p, | ||
int | roomIndex, | ||
int | enemyIndex, | ||
int | isBoss ) |
Takes a specialMove, a Fighter, a Enemy, a Boss and a Path pointers (and integers for current room and enemy indexes) and uses the requested special move.
Prints the result to the passed WINDOW. The isBoss integer determines if the receiver is the Enemy or the Boss.
move | The specialMove to execute. |
w | The WINDOW pointer to print results to. |
f | The Fighter pointer with a equipsBag. |
e | The Enemy pointer for current enemy. |
b | The Boss pointer. |
p | The Path pointer of the current game. |
roomIndex | The index of current room. |
enemyIndex | The index of current enemy. |
isBoss | Is equal to 1 when receiver is a Boss. |
void handleArtifacts | ( | Fighter * | f | ) |
Takes a Fighter, an Enemy and a Boss pointers and prints content of consumablesBag before asking user input to use a Consumable.
isBoss is passed to useConsumable().
f | The Fighter pointer using the Consumable. |
e | The Enemy pointer for current enemy. |
b | The Boss pointer for current boss. |
isBoss | The integer defining if effect applies enemy or boss (==1). |
int handleGameOptions | ( | GameOptions * | game_options | ) |
Takes a GameOptions pointer and prompts the user with a form to change options.
game_options | Pointer to GameOptions. return 0 on success, non-zero on errors. |
int handleRogueMenu | ( | Gamestate * | gmst, |
Path * | p, | ||
Fighter * | player, | ||
Room * | room, | ||
loadInfo * | load_info, | ||
Koliseo * | kls, | ||
Koliseo_Temp * | t_kls ) |
void handleSpecials | ( | Fighter * | f, |
Enemy * | e, | ||
Boss * | b, | ||
Path * | p, | ||
int | roomIndex, | ||
int | enemyIndex, | ||
int | isBoss ) |
Takes a Fighter, a Enemy, a Boss and a Path pointers (and integers for current room and enemy indexes) and asks user input to use an unlocked special attack.
The isBoss integer determines if the receiver is the Enemy or the Boss. If the selected slot is enabled and fighter has enough energy, GET_CALLBACK() is called to have the special attack execute.
void handleStats | ( | Fighter * | f | ) |
Takes a Fighter pointer and prints its stats field with all the values, formatted.
f | The Fighter pointer with stats to print. |
< Main window, used for fighter stats.
< Second window, used for lifetime stats.
void handleTutorial | ( | void | ) |
Shows tutorial info.
void hlpd_draw_notifications | ( | RingaBuf * | rb_notifications, |
WINDOW * | notifications_win ) |
Takes a RingaBuf to take the Notification from, and a WINDOW to draw them to.
rb_notifications | The RingaBuf holding the Notification |
notifications_win | The WINDOW used to draw the notifications |
int hlpd_prep_saveslot_path | ( | char | save_path[300], |
Fighter * | player, | ||
Path * | path, | ||
loadInfo * | load_info, | ||
GameOptions * | game_options ) |
Prompts the user to pick a saveslot and stores the corresponding path into the passed buffer.
save_path | The buffer to print picked saveslot path to |
player | Pointer to the Fighter for player |
path | Pointer to current game Path |
load_info | Pointer to current game load_info |
game_options | Pointer to current game_options |
Takes an array pointer of WINDOW pointers, a Fighter and a Boss pointers and initialises the passed windows.
wins | The WINDOW array pointer to initialise. |
f | The Fighter pointer with stats to print. |
b | The Boss pointer with stats to print. |
Takes an array pointer of WINDOW pointers, a Fighter and a Enemy pointers and initialises the passed windows.
wins | The WINDOW array pointer to initialise. |
f | The Fighter pointer with stats to print. |
e | The Enemy pointer with stats to print. |
void plot_line_in_ncurses | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
void print_encoded_char | ( | WINDOW * | w, |
int | y, | ||
int | x, | ||
char | c ) |
Takes a WINDOW pointer, two integers for coordinates and a char.
Prints the encoded value of the passed char to the window at the coordinates.
w | A pointer to the window to print to. |
y | Coordinate to print at. |
x | Coordinate to print at. |
c | The encoded char to print. |
void print_in_panel | ( | WINDOW * | win, |
int | starty, | ||
int | startx, | ||
int | width, | ||
Enemy * | e, | ||
Fighter * | f, | ||
int | isEnemy ) |
Takes a WINDOW , a Fighter and a Enemy pointers and prints the appropriate content to it based on isEnemy integer passed.
Additional parameters set coordinates for the output.
win | The WINDOW pointer to print to. |
f | The Fighter pointer with stats to print. |
e | The Enemy pointer with stats to print. |
isEnemy | The integer indicating if the current window is for the enemy stats, the fighter stats or the legend panel. |
starty | The integer indicating starting y coordinate. |
startx | The integer indicating starting x coordinate. |
width | The integer indicating panel width. |
void printLoadout | ( | Fighter * | f | ) |
Takes a Fighter pointer and prints its current loadout from the equipslots field.
f | The Fighter pointer with a loadout to print. |
void setBossSprite | ( | Boss * | b | ) |
Takes a Boss pointer and prepares its sprite field by copying it line by line from bosses_sprites, defined in sprites.h header.
b | The Boss pointer whose sprite field will be initialised. |
void setChestSprite | ( | Chest * | c | ) |
void setEnemySprite | ( | Enemy * | e | ) |
Takes a Enemy pointer and prepares its sprite field by copying it line by line from enemies_sprites, defined in sprites.h header.
e | The Enemy pointer whose sprite field will be initialised. |
void setEquipslotSprite | ( | Equipslot * | s | ) |
void setFighterSprite | ( | Fighter * | f | ) |
Takes a Fighter pointer and prepares its sprite field by copying it line by line.
f | The Fighter pointer whose sprite field will be initialised. |
void updateEquipslotsWin | ( | WINDOW * | w, |
Fighter * | f ) |
Takes a WINDOW and Fighter pointers and updates the window contents with the current Equipzone information.
w | The window pointer to print to. |
f | The fighter pointer to get the equipslots from. |
void updateSelectedArtifactW | ( | WINDOW * | w, |
MENU * | my_menu, | ||
Fighter * | f ) |
Takes a WINDOW, a MENU and a Fighter pointers and updates the window contents with the selected Artifact from the Fighter's artifactsBag, in the passed MENU pointer.
w | The window pointer to print into. |
my_menu | The menu pointer to get the selection from. |
f | The fighter pointer holding the artifactsBag. |
void updateSelectedConsumableW | ( | WINDOW * | w, |
MENU * | my_menu, | ||
Fighter * | f ) |
Takes a WINDOW, a MENU and a Fighter pointers and updates the window contents with the selected Consumable from the fighter's bag, in the passed MENU pointer.
w | The window pointer to print into. |
my_menu | The menu to get the selection from. |
f | The fighter pointer to get the bag from. |
Takes a WINDOW and MENU pointers and updates the window contents with the passed Equip.
w | The window pointer to point into. |
my_menu | The menu pointer to get the selection from. |
f | The fighter pointer to get the equipslots from. |
selected | The equip pointer to print. |
void updateSelectedSpecialW | ( | WINDOW * | w, |
MENU * | my_menu, | ||
Fighter * | f ) |
Takes a WINDOW and MENU pointers and updates the window contents with the selected Special in the passed MENU pointer.
w | The window pointer to print into. |
my_menu | The menu pointer to get the selection from. |
f | The Fighter pointer regarding the specials. |
void updateShopDisplayW_Consumable | ( | WINDOW * | w, |
Consumable * | c ) |
Takes a WINDOW and Consumable pointers and updates the window contents with the Consumable stats.
w | The window pointer to print into. |
c | The Consumable to be printed. |
void updateShopDisplayW_Equip | ( | WINDOW * | w, |
Equip * | e ) |
Takes a WINDOW , a Fighter and a Enemy pointers and prints the appropriate content to it based on isEnemy integer passed.
win | The WINDOW pointer to print to. |
f | The Fighter pointer with stats to print. |
e | The Enemy pointer with stats to print. |
isEnemy | The integer indicating if the current window is for the enemy stats, the fighter stats or the legend panel. |
border | The integer indicating if the current window should have a horizontal line bordering the label text. |