Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 0.1.1 include Koliseo #1

Merged
merged 9 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/Build-CI-make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build CI with make
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/make-anviltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Run anvil tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "sprites4curses"]
path = sprites4curses
url = git@github.com:jgabaut/sprites4curses.git
[submodule "koliseo"]
path = koliseo
url = git@github.com:jgabaut/koliseo.git
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

It uses ncurses to provide text interface.

Here's a gif of the game "Enemy" screen.

![Gif of turn screen](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExamM4YWk2ZmdnNWtjY2EzMDV6MHhvcWQxNzVvaTVhbHg3Zjdhb3Y0MiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/n4yI1b7bChwaqe6b6u/giphy.gif)


## Dependencies

`autoconf` and `automake` are needed to generate the Makefile used to compile the game.
Expand Down Expand Up @@ -60,5 +65,5 @@
make
```

📦 Latest Release v1.0.0 05/07/2023
📦 Latest Release v1.0.1 08/07/2023
https://github.com/jgabaut/helapordo/releases
1 change: 1 addition & 0 deletions bin/stego.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ kazoj# tests folder name
?0.4.7#
?0.5.3#
1.0.0# First release
1.0.1# First patch release
5 changes: 5 additions & 0 deletions bin/v1.0.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#amboso compliant version folder, will ignore everything inside BUT the gitignore, to keep the clean dir
#we also keep specific dependencies...
*
!.gitignore
!static
1 change: 1 addition & 0 deletions bin/v1.0.1/static
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the package name and version
AC_INIT([helapordo], [1.0.0], [jgabaut@github.com])
AC_INIT([helapordo], [1.0.1], [jgabaut@github.com])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand All @@ -24,7 +24,7 @@ fi
# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="1.0.0"
VERSION="1.0.1"
fi

# Output variables to the config.h header
Expand Down
2 changes: 1 addition & 1 deletion docs/helapordo.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "helapordo"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "1.0.0"
PROJECT_NUMBER = "1.0.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
1 change: 1 addition & 0 deletions koliseo
Submodule koliseo added at 5ae095
19 changes: 17 additions & 2 deletions src/game_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,24 @@ extern int G_DEBUG_ENEMYTYPE_ON;
extern int GS_AUTOSAVE_ON;

/**
* Current version identifier.
* Current major release.
*/
#define VERSION "1.0.0"
#define HELAPORDO_MAJOR_VERSION 1

/**
* Current minor release.
*/
#define HELAPORDO_MINOR_VERSION 0

/**
* Current patch release.
*/
#define HELAPORDO_PATCH_VERSION 1

/**
* Current version string identifier, with MAJOR.MINOR.PATCH format.
*/
#define VERSION "1.0.1"

/**
* Ceiling for Fighter luck.
Expand Down
7 changes: 4 additions & 3 deletions src/game_curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,16 +3344,13 @@ void handleStats(Fighter* f){
WINDOW *history_win; /**< Second window, used for lifetime stats.*/

/* Initialize curses */
//setlocale(LC_CTYPE, "it_IT.UTF-8");
//initscr();
clear();
refresh();
start_color();
cbreak();
noecho();
keypad(stdscr, TRUE);


/* Initialize all the colors */
init_pair(1, COLOR_RED, COLOR_BLACK);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
Expand Down Expand Up @@ -3587,6 +3584,10 @@ void handleStats(Fighter* f){
break;
}
}
clear();
refresh();
delwin(win);
delwin(history_win);
endwin();
log_tag("debug_log.txt","[DEBUG]","Ended window mode for handleStats()");
}
Expand Down
42 changes: 20 additions & 22 deletions src/helapordo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#include "helapordo.h"

/**
* Takes a turnOption_OP and a pointer to a turnOP_args struct.
* Logs a warning for any NULL field in the struct.
* Performs the defined turn operation, before returning an OP_res.
* @param op The kind of operation to do.
* @param args Struct containing needed args for current operation. Can have some fields uninitialised, if not relevant to requested turnOP.
* @return An OP_res representing result of turn option operation.
* @see turnOP_args
* @see turnOption_OP
* @see OP_res
*/
OP_res turnOP(turnOption_OP op, turnOP_args* args) {

char msg[500];
Expand Down Expand Up @@ -3328,7 +3339,8 @@ int getBoost(int lvl, int luck) {
*/
void unlockSpecial(Fighter* f) {

ITEM **my_items;
//Thanks to u/skeeto for the suggestions.
ITEM *my_items[SPECIALSMAX+2] = {0};
MENU *my_menu;
WINDOW *my_menu_win;
WINDOW *display_win;
Expand All @@ -3351,26 +3363,15 @@ void unlockSpecial(Fighter* f) {

init_game_color_pairs();

for (int i = 0; i < SPECIALSMAX + 1; i++) {
if (! (f->specials[i]->enabled) ) {
n_choices++;
}
}


/* Create menu items */
int tot = 0;
my_items = (ITEM **)calloc(n_choices,sizeof(ITEM *));
for (int i = 0; i < SPECIALSMAX +1; i++) {
for (int i = 0; i < SPECIALSMAX + 1; i++) {
if (! (f->specials[i]->enabled) ) {
my_items[tot] = new_item(nameStringFromSpecial(f->class,i), " ");
tot++;
my_items[n_choices++] = new_item(nameStringFromSpecial(f->class,i), " ");
}
}
my_items[tot] = (ITEM*) NULL;

/* Create menu */
my_menu = new_menu((ITEM **)my_items);
my_menu = new_menu(my_items);

/* Set description off */
menu_opts_off(my_menu,O_SHOWDESC);
Expand Down Expand Up @@ -3505,10 +3506,10 @@ void unlockSpecial(Fighter* f) {
}
/* Unpost and free all the memory taken up */
unpost_menu(my_menu);
for(int k = 0; k <= n_choices; k++) {
free_item(my_items[k]);
}
free_menu(my_menu);
for(int k = 0; k <= n_choices; k++) {
free_item(my_items[k]);
}
delwin(my_menu_win);
delwin(display_win);
endwin();
Expand Down Expand Up @@ -7867,9 +7868,7 @@ OP_res handleLoadgame_Enemies(FILE* file, Fighter* f, Path* p, Enemy* e, int* en
*/
void death(Fighter* player, loadInfo* load_info) {

lightRed();
handleStats(player);
white();

char msg[500];

Expand Down Expand Up @@ -8029,7 +8028,7 @@ void b_death(Boss* b) {
*/
int retry(void) {
lightGreen();
printf("\n\nWant to try again?\n\n\t\t0 - No\t\t\t1 - Yes\n\n");
printf("\n\nYou died. Want to try again?\n\n\t\t0 - No\t\t\t1 - Yes\n\n");
white();

char c[25];
Expand Down Expand Up @@ -10756,7 +10755,6 @@ void gameloop(int argc, char** argv){
int clrres = system("clear");
sprintf(msg,"gameloop() 3 system(\"clear\") res was (%i)",clrres);
log_tag("debug_log.txt","[DEBUG]",msg);
handleStats(player);
printf("\n\n\tYOU DIED.\n\n");
log_tag("debug_log.txt","[DEBUG]","Game lost.\n");
}
Expand Down
12 changes: 7 additions & 5 deletions src/rooms.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,15 +930,17 @@ int handleRoom_Enemies(Room* room, int index, Path* p, Fighter* player, loadInfo
}

e_death(e);
int player_luck = player->luck;
sprintf(msg,"Player luck was [%i]",player_luck);
log_tag("debug_log.txt","[DEBUG]",msg);
death(player, load_info);
free(room->foes);
endwin();


printf("\t\tLuck: %i Path luck: %i\n",player->luck,p->luck);
red();
printf("\n\n\tYOU DIED.\n");
white();
//printf("\t\tLuck: %i Path luck: %i\n",player_luck,p->luck);
//red();
//printf("\n\n\tYOU DIED.\n");
//white();
free(args);
log_tag("debug_log.txt","[FREE]","Freed turnOP_args");

Expand Down