helapordo 1.4.20
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-2026 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)
34
35#include <locale.h>
36
37#include "../utils/turn_op.h"
38#include "../animations/game_animations.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
59void updateSelectedConsumableW(WINDOW * w, MENU * my_menu, Fighter * f);
60
61void updateSelectedArtifactW(WINDOW * w, MENU * my_menu, Fighter * f);
62
63void updateSelectedEquipW(WINDOW * w, MENU * my_menu, Equip * selected,
64 Fighter * f);
65
66void updateEquipslotsWin(WINDOW * w, Fighter * f);
67
68void updateSelectedSpecialW(WINDOW * w, MENU * my_menu, Fighter * f);
69
70void updateShopDisplayW_Equip(WINDOW * w, Equip * e);
71
72void updateShopDisplayW_Consumable(WINDOW * w, Consumable * c);
73
76void printLoadout(Fighter * f);
78
79void handleConsumables(Fighter * f, Enemy * e, Boss * b, int isBoss);
80void handleArtifacts(Fighter * f);
81void handleEquips(Fighter * f, Path * p);
82void fight_Special(specialMove move, WINDOW * w, Fighter * f, Enemy * e,
83 Boss * b, Path * p, int roomIndex, int enemyIndex,
84 int isBoss);
85void handleSpecials(Fighter * f, Enemy * e, Boss * b, Path * p, int roomIndex,
86 int enemyIndex, int isBoss);
87void handleStats(Fighter * f);
88void handleTutorial(void);
89int handleRogueMenu(Gamestate * gmst, Path * p, Fighter * player, Room * room,
90 loadInfo * load_info, Koliseo * kls, Koliseo_Temp * t_kls);
91int handleGameOptions(GameOptions * game_options);
92void draw_buildinfo(WINDOW* win);
93int hlpd_prep_saveslot_path(char save_path[300], Fighter* player, Path* path, loadInfo* load_info, GameOptions* game_options);
94void hlpd_draw_notifications(RingaBuf* rb_notifications, WINDOW* notifications_win);
95#endif
specialMove
The different kinds of special moves.
Definition game_core.h:804
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:1626
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:1953
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:3199
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:3732
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:2540
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:2012
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:3656
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:2907
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:1720
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:1824
void handleStats(Fighter *f)
Takes a Fighter pointer and prints its stats field with all the values, formatted.
Definition game_curses.c:3396
void debug_printFoeParty(FoeParty *fp)
Takes a FoeParty pointer and prints its current values.
Definition game_curses.c:2288
void draw_buildinfo(WINDOW *win)
Definition game_curses.c:4136
void handleArtifacts(Fighter *f)
Takes a Fighter pointer and prints content of artifactsBag.
Definition game_curses.c:2720
int handleGameOptions(GameOptions *game_options)
Takes a GameOptions pointer and prompts the user with a form to change options.
Definition game_curses.c:4022
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:4201
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:1672
void printLoadout(Fighter *f)
Takes a Fighter pointer and prints its current loadout from the equipslots field.
Definition game_curses.c:2050
void displayEquipbagMenu(Fighter *f)
Takes a Fighter pointer and displays its equipsbag information.
Definition game_curses.c:2375
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 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:4488
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:1917
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:3095
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:2181
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:1204
Holds a certain qty of a consumableClass.
Definition game_core.h:502
Represents the entity initialised from a enemyClass.
Definition game_core.h:1163
Represents the entity initialised from a equipClass.
Definition game_core.h:1416
Represents the entity initialised from a fighterClass.
Definition game_core.h:1093
Represents the entity initialised from a foePartyClass.
Definition game_core.h:1725
Holds options useful for user runtime preferences.
Definition game_core.h:201
Holds arguments for a game.
Definition game_core.h:1899
Holds the state of game progression.
Definition game_core.h:1357
Represents the entity initialised from a roomClass.
Definition game_core.h:1770
Contains loaded values to pass to initRoom().
Definition game_core.h:1878