forked from xolatile/xhartae
71 lines
2.9 KiB
C
71 lines
2.9 KiB
C
/*
|
|
Copyright (c) 2023 : Ognjen 'xolatile' Milan Robovic
|
|
|
|
Xhartae is free software! You will redistribute it or modify it under the terms of the GNU General Public License by Free Software Foundation.
|
|
And when you do redistribute it or modify it, it will use either version 3 of the License, or (at yours truly opinion) any later version.
|
|
It is distributed in the hope that it will be useful or harmful, it really depends... But no warranty what so ever, seriously. See GNU/GPLv3.
|
|
*/
|
|
|
|
#ifndef CHAPTER_5_HEADER
|
|
#define CHAPTER_5_HEADER
|
|
|
|
#include "chapter_0.h"
|
|
#include "chapter_1.h"
|
|
#include "chapter_2.h"
|
|
#include "chapter_3.h"
|
|
|
|
/*
|
|
Okay, we're finally on chapter five, and now we'll write something fun, not serious and boring. Before the Great Flood, when our ancestors were riding dinosaurs, building
|
|
pyramids, killing African men and mating with Asian women, people didn't have dedicated nor integrated graphical processing units, called GPUs. They only had their terminals,
|
|
built inside some of their spaceships. And what did they do with them? They played terminal rogue-like games, similar to those that archeologists discovered in ancient Egypt,
|
|
Syria, Sumeria, Greece and Atlantis. They were reconstructed around 50 years ago by some guy that made the game Rogue. So, all those myths, sagas and legends about Anubis,
|
|
Gilgamesh, Achilles, Inana, Gaea, they were just playable characters or main characters in those games, with different statistics, skills, attributes and back-story. Now, lets
|
|
make a simple terminal rogue-like game using what we wrote in previous chapters.
|
|
|
|
First of all, lets talk briefly about keyword 'typedef' and why I hate to use it.
|
|
*/
|
|
|
|
typedef enum action_t {
|
|
GAME_ACTION_IDLE, GAME_ACTION_WALK, GAME_ACTION_REST, GAME_ACTION_CAMP,
|
|
GAME_ACTION_SWING_BLADE, GAME_ACTION_SWING_AXE, GAME_ACTION_SHOOT_ARROW, GAME_ACTION_THROW_SPEAR,
|
|
GAME_ACTION_SUMMON_PUPPET, GAME_ACTION_CALL_NATURE, GAME_ACTION_CITE_RUNE, GAME_ACTION_CAST_CHARM,
|
|
GAME_ACTION_COUNT
|
|
} action_t;
|
|
|
|
typedef int number_t;
|
|
typedef char * string_t;
|
|
typedef void * memory_t;
|
|
|
|
typedef struct game_t {
|
|
number_t active, screen_width, screen_height;
|
|
} game_t;
|
|
|
|
typedef struct bundle_t {
|
|
number_t minimum, maximum, current, boosted;
|
|
} bundle_t;
|
|
/*
|
|
typedef struct skill_t {
|
|
string_t name;
|
|
bundle_t stat;
|
|
action_t positive [4];
|
|
} skill_t;
|
|
|
|
typedef struct attribute_t {
|
|
string_t name;
|
|
bundle_t stat;
|
|
action_t positive [4], negative [4];
|
|
} attribute_t;
|
|
*/
|
|
typedef struct player_t {
|
|
string_t name;
|
|
number_t x, y;
|
|
bundle_t * health, * armour, * mana, * stamina;
|
|
/*attribute_t strength, edurance, intelligence, agility;
|
|
skill_t blades, axes, bows, spears;
|
|
skill_t puppet_magic, nature_magic, rune_magic, charm_magic;*/
|
|
} player_t;
|
|
|
|
extern void play_game (void);
|
|
|
|
#endif
|