helapordo 1.4.12
Loading...
Searching...
No Matches
game_curses.h
Go to the documentation of this file.
1// jgabaut @ github.com/jgabaut
2// SPDX-License-Identifier: GPL-3.0-only
3/*
4 Copyright (C) 2022-2024 jgabaut
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, version 3 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19#ifndef GAMECURSES_H
20#define GAMECURSES_H
21
22#ifdef _WIN32
23#include <ncursesw/panel.h>
24#include <ncursesw/menu.h>
25#else
26#include <panel.h>
27#include <menu.h>
28#endif
29
30#define HLPD_DEFAULT_SCREEN_ROWS 24
31#define HLPD_DEFAULT_SCREEN_COLS 80
32#define HLPD_MIN_SCREEN_ROWS (HLPD_DEFAULT_SCREEN_ROWS+8)
33#define HLPD_MIN_SCREEN_COLS (HLPD_DEFAULT_SCREEN_COLS)
35#include <locale.h>
36
37#include "../utils/turn_op.h"
39
40void plot_line_in_ncurses(int x1, int y1, int x2, int y2);
41void print_encoded_char(WINDOW * w, int y, int x, char c);
42//int get_saveslot_index(void);
43void displayLore(char **lore_strings, int lore_counter);
44
45void printBattleStats(WINDOW * wins[3], Fighter * f, Enemy * e);
46
47void init_wins(WINDOW ** wins, Enemy * e, Fighter * f);
48void win_show(WINDOW * win, Enemy * e, Fighter * f, int isEnemy, int border);
49void print_in_panel(WINDOW * win, int starty, int startx, int width, Enemy * e,
50 Fighter * f, int isEnemy);
51
52void printBossBattleStats(WINDOW * wins[3], Fighter * f, Boss * b);
53
54void init_boss_wins(WINDOW ** wins, Boss * b, Fighter * f);
55void boss_win_show(WINDOW * win, Boss * b, Fighter * f, int isBoss, int border);
56void boss_print_in_panel(WINDOW * win, int starty, int startx, int width,
57 Boss * b, Fighter * f, int isBoss);
58
60void setEnemySprite(Enemy * e);
61void setBossSprite(Boss * b);
63void setChestSprite(Chest * c);
64
65void updateSelectedConsumableW(WINDOW * w, MENU * my_menu, Fighter * f);
66
67void updateSelectedArtifactW(WINDOW * w, MENU * my_menu, Fighter * f);
68
69void updateSelectedEquipW(WINDOW * w, MENU * my_menu, Equip * selected,
70 Fighter * f);
71
72void updateEquipslotsWin(WINDOW * w, Fighter * f);
73
74void updateSelectedSpecialW(WINDOW * w, MENU * my_menu, Fighter * f);
75
76void updateShopDisplayW_Equip(WINDOW * w, Equip * e);
77
78void updateShopDisplayW_Consumable(WINDOW * w, Consumable * c);
79
82void printLoadout(Fighter * f);
84
85void handleConsumables(Fighter * f, Enemy * e, Boss * b, int isBoss);
86void handleArtifacts(Fighter * f);
87void handleEquips(Fighter * f, Path * p);
88void fight_Special(specialMove move, WINDOW * w, Fighter * f, Enemy * e,
89 Boss * b, Path * p, int roomIndex, int enemyIndex,
90 int isBoss);
91void handleSpecials(Fighter * f, Enemy * e, Boss * b, Path * p, int roomIndex,
92 int enemyIndex, int isBoss);
93void handleStats(Fighter * f);
94void handleTutorial(void);
95int handleRogueMenu(Gamestate * gmst, Path * p, Fighter * player, Room * room,
96 loadInfo * load_info, Koliseo * kls, Koliseo_Temp * t_kls);
97int handleGameOptions(GameOptions * game_options);
98void draw_buildinfo(WINDOW* win);
99int hlpd_prep_saveslot_path(char save_path[300], Fighter* player, Path* path, loadInfo* load_info, GameOptions* game_options);
100void hlpd_draw_notifications(RingaBuf* rb_notifications, WINDOW* notifications_win);
101#endif
specialMove
The different kinds of special moves.
Definition game_core.h:790
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 Consu...
Definition game_curses.c:1760
void setEquipslotSprite(Equipslot *s)
Takes a Equipslot pointer and prepares its sprite field by copying it line by line from equipzones_sp...
Definition game_curses.c:1689
void setFighterSprite(Fighter *f)
Takes a Fighter pointer and prepares its sprite field by copying it line by line.
Definition game_curses.c:1662
void updateShopDisplayW_Equip(WINDOW *w, Equip *e)
Takes a WINDOW and Equip pointers and updates the window contents with the Equip stats.
Definition game_curses.c:2087
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...
Definition game_curses.c:3333
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.
Definition game_curses.c:3866
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...
Definition game_curses.c:2674
void plot_line_in_ncurses(int x1, int y1, int x2, int y2)
Definition game_curses.c:24
void updateShopDisplayW_Consumable(WINDOW *w, Consumable *c)
Takes a WINDOW and Consumable pointers and updates the window contents with the Consumable stats.
Definition game_curses.c:2146
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 isBo...
Definition game_curses.c:1157
void handleTutorial(void)
Shows tutorial info.
Definition game_curses.c:3790
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.
Definition game_curses.c:3041
void displayLore(char **lore_strings, int lore_counter)
Displays a certain lore string.
Definition game_curses.c:305
void printBattleStats(WINDOW *wins[3], Fighter *f, Enemy *e)
Takes a Fighter and a Enemy pointers and prints most of their values formatted.
Definition game_curses.c:363
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.
Definition game_curses.c:1854
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 isE...
Definition game_curses.c:511
void printBossBattleStats(WINDOW *wins[3], Fighter *f, Boss *b)
Takes a Fighter and a Boss pointers and prints most of their values formatted.
Definition game_curses.c:1002
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 isE...
Definition game_curses.c:473
void updateEquipslotsWin(WINDOW *w, Fighter *f)
Takes a WINDOW and Fighter pointers and updates the window contents with the current Equipzone inform...
Definition game_curses.c:1958
void handleStats(Fighter *f)
Takes a Fighter pointer and prints its stats field with all the values, formatted.
Definition game_curses.c:3530
void debug_printFoeParty(FoeParty *fp)
Takes a FoeParty pointer and prints its current values.
Definition game_curses.c:2422
void draw_buildinfo(WINDOW *win)
Definition game_curses.c:4270
void handleArtifacts(Fighter *f)
Takes a Fighter pointer and prints content of artifactsBag.
Definition game_curses.c:2854
int handleGameOptions(GameOptions *game_options)
Takes a GameOptions pointer and prompts the user with a form to change options.
Definition game_curses.c:4156
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 isBo...
Definition game_curses.c:1116
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.
Definition game_curses.c:4335
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 Artif...
Definition game_curses.c:1806
void printLoadout(Fighter *f)
Takes a Fighter pointer and prints its current loadout from the equipslots field.
Definition game_curses.c:2184
void setEnemySprite(Enemy *e)
Takes a Enemy pointer and prepares its sprite field by copying it line by line from enemies_sprites,...
Definition game_curses.c:1623
void displayEquipbagMenu(Fighter *f)
Takes a Fighter pointer and displays its equipsbag information.
Definition game_curses.c:2509
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 w...
Definition game_curses.c:1055
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 ...
Definition game_curses.c:414
void setChestSprite(Chest *c)
Takes a Chest pointer and prepares its sprite field by copying it line by line.
Definition game_curses.c:1708
void setBossSprite(Boss *b)
Takes a Boss pointer and prepares its sprite field by copying it line by line from bosses_sprites,...
Definition game_curses.c:1643
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.
Definition game_curses.c:4622
void print_encoded_char(WINDOW *w, int y, int x, char c)
Takes a WINDOW pointer, two integers for coordinates and a char.
Definition game_curses.c:60
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 pas...
Definition game_curses.c:2051
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 an...
Definition game_curses.c:3229
void display_printFoeParty(FoeParty *fp)
Takes a FoeParty pointer and prints its current layout into up to 3 new WINDOWS, deleted before retur...
Definition game_curses.c:2315
char * lore_strings[6]
Declares lore array for the game.
Definition game_lore.c:20
Represents the entity initialised from a bossClass.
Definition game_core.h:1190
Represents the entity initialised from a chestClass.
Definition game_core.h:1543
Holds a certain qty of a consumableClass.
Definition game_core.h:488
Represents the entity initialised from a enemyClass.
Definition game_core.h:1149
Represents the entity initialised from a equipClass.
Definition game_core.h:1402
Represents the entity containing an Equip instance.
Definition game_core.h:1457
Represents the entity initialised from a fighterClass.
Definition game_core.h:1079
Represents the entity initialised from a foePartyClass.
Definition game_core.h:1711
Holds options useful for user runtime preferences.
Definition game_core.h:191
Holds arguments for a game.
Definition game_core.h:1885
Holds the state of game progression.
Definition game_core.h:1343
Represents the entity initialised from a roomClass.
Definition game_core.h:1756
Contains loaded values to pass to initRoom().
Definition game_core.h:1864