helapordo 1.4.12
|
#include "game_utils.h"
Functions | |
void * | s4c_gui_malloc (size_t size) |
void * | s4c_gui_calloc (size_t count, size_t size) |
void | hlpd_sigint_handler (int signum) |
Function to handle Ctrl+C signal. | |
void | initWincon (Wincon *w, Path *p, winconClass class) |
Takes a Wincon and a Path pointers and a winconClass and initialises the passed Wincon. | |
void | printGlobVars (void) |
Prints global vars to stdout. | |
void | dbg_GameOptions (GameOptions *options) |
void | dbg_Fighter (Fighter *fighter) |
Debugs the passed (preallocated) Fighter with log_tag(). | |
void | dbg_Saveslot (Saveslot *saveslot) |
Debugs the passed (preallocated) Saveslot with log_tag(). | |
void | dbg_Path (Path *path) |
Debugs the passed (preallocated) Path with log_tag(). | |
void | dbg_Wincon (Wincon *wc) |
Debugs the passed (preallocated) Wincon with log_tag(). | |
void | dbg_countStats (countStats *stats) |
Debugs the passed (preallocated) countStats with log_tag(). | |
void | dbg_print_floor_layout (Floor *floor) |
Logs floor layout for passed Floor. | |
void | dbg_print_explored_layout (Floor *floor) |
Logs explored layout for passed Floor. | |
void | dbg_print_roomclass_layout (Floor *floor) |
Logs roomclass layout for passed Floor. | |
void | dbg_Gamestate (Gamestate *gmst) |
Debugs the passed (preallocated) Gamestate with log_tag(). | |
void | dbg_GameScreen (GameScreen *scr) |
Debugs the passed (preallocated) GameScreen with log_tag(). | |
void | update_Gamestate (Gamestate *gmst, int current_fighters, roomClass current_roomtype, int current_room_index, int current_enemy_index, Floor *current_floor, Room *current_room, GameOptions *game_options) |
Updates the passed (preallocated) Gamestate with the passed int values. | |
void | update_Equipslots (Fighter *f) |
Updates the passed Fighter's Equipslots item fields, by reading the equipsBag field and setting the equipped ones. | |
saveType | saveTypeFrom_string (char *s) |
Takes a string and returns the corresponding saveType. | |
void | log_OP (turnOption_OP op) |
Logs a turnOption_OP to "$STATICDIR/OPS_log.txt". | |
void | red (void) |
Prints an ASCII escape code that makes subsequent output a thick red color. | |
void | lightRed (void) |
Prints an ASCII escape code that makes subsequent output a light red color. | |
void | strongWhite (void) |
Prints an ASCII escape code that makes subsequent output a thick white color. | |
void | white (void) |
Prints an ASCII escape code that makes subsequent output a light white color. | |
void | green (void) |
Prints an ASCII escape code that makes subsequent output a thick green color. | |
void | lightGreen (void) |
Prints an ASCII escape code that makes subsequent output a light green color. | |
void | yellow (void) |
Prints an ASCII escape code that makes subsequent output a thick yellow color. | |
void | lightYellow (void) |
Prints an ASCII escape code that makes subsequent output a light yellow color. | |
void | blue (void) |
Prints an ASCII escape code that makes subsequent output a thick blue color. | |
void | lightBlue (void) |
Prints an ASCII escape code that makes subsequent output a light blue color. | |
void | purple (void) |
Prints an ASCII escape code that makes subsequent output a thick purple color. | |
void | lightPurple (void) |
Prints an ASCII escape code that makes subsequent output a light purple color. | |
void | cyan (void) |
Prints an ASCII escape code that makes subsequent output a thick cyan color. | |
void | lightCyan (void) |
Prints an ASCII escape code that makes subsequent output a light cyan color. | |
void | resolve_staticPath (char static_path[500]) |
Sets the passed char array to the expected path for /static/ folder. | |
void | loadLore (char **lore_strings, int loreKind) |
Loads the lore strings from the appropriate lore file. | |
void | setRoomType (Path *path, int *roadFork_value, roomClass *room_type, int roomsDone) |
Takes a path pointer, a roadFork value pointer, a room type pointer, and an integer. | |
void | freeRoom (Room *room) |
Frees the memory allocated for the passed room pointer. | |
void | printTitle (void) |
Prints an hardcoded title screen. | |
void | printVersion (void) |
Prints version string. | |
void | printFormattedVersion (const char *progname) |
Prints formatted version string. | |
void | hlpd_dbg_features (void) |
Prints configuration info. | |
void | usage (const char *progname) |
Prints correct argument syntax for command line invocation. | |
void | log_tag (char *filename, char *header, const char *format,...) |
Takes a filename string, a string headear and a format string. | |
char * | stringFrom_OP_res (OP_res r) |
Takes a OP_res and returns the corresponding string by the inner array position. | |
char * | stringFrom_saveType (saveType s) |
Takes a saveType and returns the corresponding string by the inner array position. | |
char * | stringFromTurnOP (turnOption_OP t) |
Takes a turnOption_OP and returns the corresponding string by the inner array position. | |
char * | stringFromFoeTurnOP (foeTurnOption_OP ft) |
Takes a foeTurnOption_OP and returns the corresponding string by the inner array position. | |
char * | stringFrom_fightResult (fightResult fr) |
Takes a fightResult fr and returns the corresponding string by the inner array position. | |
char * | stringFromStatus (fighterStatus s) |
Takes a fighterStatus and returns the corresponding string by the inner array position. | |
char * | stringFromWinconClass (winconClass w) |
Takes a winconClass and returns the corresponding string by the inner array position. | |
char * | stringFromClass (fighterClass f) |
Takes a fighterClass and returns the corresponding string by the inner array position. | |
char * | stringFromEClass (enemyClass e) |
Takes a enemyClass and returns the corresponding string by the inner array position. | |
char * | stringFromBossClass (bossClass b) |
Takes a bossClass and returns the corresponding string by the inner array position. | |
char * | stringFromConsumables (int c) |
Takes a integer and returns the corresponding consumable string by the inner array position. | |
char * | stringFromEquips (int e) |
Takes a integer and returns the corresponding equip string by the inner array position. | |
char * | stringFromEquipzones (int z) |
Takes a integer and returns the corresponding equipzone string by the inner array position. | |
char * | stringFromQuality (int q) |
Takes a integer and returns the corresponding quality string by the inner array position. | |
char * | stringFromArtifacts (int a) |
Takes a integer and returns the corresponding artifact string by the inner array position. | |
char * | nameStringFromSpecial (fighterClass class, specialMove move) |
Takes a fighterClass and a specialMove and returns the corresponding name string by the inner array position. | |
char * | descStringFromSpecial (fighterClass class, specialMove move) |
Takes a fighterClass and a specialMove and returns the corresponding desc string by the inner array position. | |
int | costFromSpecial (fighterClass class, specialMove move) |
Takes a fighterClass and a specialMove and returns the corresponding cost by the inner array position, as an integer. | |
char * | nameStringFromSkill (skillType class) |
Takes a skillType and returns the corresponding name string by the inner array position. | |
char * | descStringFromSkill (skillType class) |
Takes a fighterClass and a specialMove and returns the corresponding desc string by the inner array position. | |
int | costFromSkill (skillType class) |
Takes a skillType and returns the corresponding cost by the inner array position, as an integer. | |
char * | nameStringFromPerk (int p) |
Takes a integer and returns the corresponding perk name string by the inner array position. | |
char * | descStringFromPerk (int p) |
Takes a integer and returns the corresponding perk desc string by the inner array position. | |
char * | descStringFromTreasure (int t) |
Takes a integer and returns the corresponding treasure desc string by the inner array position. | |
char * | descStringFromChest (int c) |
Takes a integer and returns the corresponding chest desc string by the inner array position. | |
char * | stringFromFoePartyClass (foePartyClass fp) |
Takes a integer and returns the corresponding FoeParty desc string by the inner array position. | |
char * | stringFrom_HLP_Region_Type (HLP_Region_Type t) |
Takes a integer and returns the corresponding HLP_Region_Type string by the inner array position. | |
char * | stringFromRoom (roomClass r) |
Takes a integer and returns the corresponding room name string by the inner array position. | |
char * | stringFromGamemode (Gamemode g) |
Takes a integer and returns the corresponding gamemode string by the inner array position. | |
char * | stringFromFloorclass (floorClass fc) |
Takes a integer and returns the corresponding floorClass string by the inner array position. | |
char * | stringFrom_HLPD_KeyClass (HLPD_KeyClass k) |
Takes a integer and returns the corresponding HLPD_KeyClass string by the inner array position. | |
const char * | stringFrom_HLPD_DirectionalKeys_Schema (int dks) |
Takes a integer and returns the corresponding HLPD_DirectionalKeys_Schema string by the inner array position. | |
void | scanName (Fighter *player) |
Takes a Fighter pointer and sets its name value to the string provided on stdin. | |
void | printClasses (void) |
Prints all the fighterClass values as integers and as strings. | |
int | scanClass (void) |
Asks for an integer on stdin and returns it if it's a valid fighterClass index. | |
void | pickClass (Fighter *player) |
Takes a Fighter pointer and sets the class value after asking the user for input. | |
void | printWincons (void) |
Prints all the winconClass values as integers and as strings. | |
int | scanWincon (void) |
Asks for an integer on stdin and returns it if it's a valid winconClass index. | |
void | pickName (Fighter *player) |
Takes a Fighter pointer and sets the name value after asking the user for input. | |
void | pickWincon (Wincon *w) |
Takes a Wincon pointer and sets its class after asking the user for input. | |
void | copy_fighter (Fighter *source, Fighter *dest) |
Takes two Fighter pointers, with all their fields already allocated, and copies all valaues from source to dest. | |
effect_fun | getStatusCounterFun (fighterStatus status) |
Takes a fighterStatus and returns the corresponding effect_fun pointer for the function relating to the status. | |
effect_e_fun | getStatusCounterEnemyFun (fighterStatus status) |
Takes a fighterStatus and returns the corresponding effect_e_fun pointer for the function relating to the status. | |
effect_b_fun | getStatusCounterBossFun (fighterStatus status) |
Takes a fighterStatus and returns the corresponding effect_e_fun pointer for the function relating to the status. | |
boost_fun | getStatBoostCounterFun (Stat s) |
Takes a Stat and returns the corresponding boost_fun pointer for the function relating to the stat. | |
boost_e_fun | getStatBoostCounterEnemyFun (Stat s) |
Takes a Stat and returns the corresponding boost_e_fun pointer for the function relating to the stat. | |
boost_b_fun | getStatBoostCounterBossFun (Stat s) |
Takes a Stat and returns the corresponding boost_b_fun pointer for the function relating to the stat. | |
boost_fp_fun | get_StatBoostCounter_FoeParty_Fun (Stat s) |
Takes a Stat and returns the corresponding boost_fp_fun pointer for the function relating to the stat. | |
void | set_turnboost_atk (Fighter *f, int boost) |
Takes a Fighter pointer and an integer, used to set the turnboost_atk value at the pointer. | |
void | set_turnboost_def (Fighter *f, int boost) |
Takes a Fighter pointer and an integer, used to set the turnboost_def value at the pointer. | |
void | set_turnboost_vel (Fighter *f, int boost) |
Takes a Fighter pointer and an integer, used to set the turnboost_vel value at the pointer. | |
void | set_turnboost_enr (Fighter *f, int boost) |
Takes a Fighter pointer and an integer, used to set the turnboost_enr value at the pointer. | |
void | set_enemy_turnboost_atk (Enemy *e, int boost) |
Takes a Enemy pointer and an integer, used to set the turnboost_atk value at the pointer. | |
void | set_enemy_turnboost_def (Enemy *e, int boost) |
Takes a Enemy pointer and an integer, used to set the turnboost_def value at the pointer. | |
void | set_enemy_turnboost_vel (Enemy *e, int boost) |
Takes a Enemy pointer and an integer, used to set the turnboost_vel value at the pointer. | |
void | set_enemy_turnboost_enr (Enemy *e, int boost) |
Takes a Enemy pointer and an integer, used to set the turnboost_enr value at the pointer. | |
void | set_boss_turnboost_atk (Boss *b, int boost) |
Takes a Boss pointer and an integer, used to set the turnboost_atk value at the pointer. | |
void | set_boss_turnboost_def (Boss *b, int boost) |
Takes a Boss pointer and an integer, used to set the turnboost_def value at the pointer. | |
void | set_boss_turnboost_vel (Boss *b, int boost) |
Takes a Boss pointer and an integer, used to set the turnboost_vel value at the pointer. | |
void | set_boss_turnboost_enr (Boss *b, int boost) |
Takes a Boss pointer and an integer, used to set the turnboost_enr value at the pointer. | |
void | set_foeparty_turnboost_atk (FoeParty *fp, int boost) |
Takes a FoeParty pointer and an integer, used to set the turnboost_atk value at the pointer. | |
void | set_foeparty_turnboost_def (FoeParty *fp, int boost) |
Takes a FoeParty pointer and an integer, used to set the turnboost_def value at the pointer. | |
void | set_foeparty_turnboost_vel (FoeParty *fp, int boost) |
Takes a FoeParty pointer and an integer, used to set the turnboost_vel value at the pointer. | |
void | set_foeparty_turnboost_enr (FoeParty *fp, int boost) |
Takes a FoeParty pointer and an integer, used to set the turnboost_enr value at the pointer. | |
void | resetFighterStatus (Fighter *f) |
Takes a Fighter pointer and resets its status value to Normal. | |
void | resetEnemyStatus (Enemy *e) |
Takes a Enemy pointer and resets its status value to Normal. | |
void | resetBossStatus (Boss *b) |
Takes a Boss pointer and resets its status value to Normal. | |
void | setEquipPrices (int size, int *equipPrices, Equip *equips[]) |
Takes a size int and a pointer to integer array, initialises all the prices, depending on stats from the Equips array pointer. | |
void | setConsumablePrices (int size, int *consumablePrices, Consumable **consumables) |
Takes a size int and a pointer to integer array, initialises all the prices. | |
void | statReset (Fighter *player, int force) |
Takes a Fighter pointer and an integer used to force execution. | |
void | statResetBoss (Boss *b, int force) |
Takes a Boss pointer and an integer used to force execution. | |
void | statResetEnemy (Enemy *e, int force) |
Takes an Enemy pointer and an integer used to force execution. | |
int | getBossBoost (int lvl, bossClass bclass) |
Takes one integer and a bossClass and returns the boost relative to the level delta with base boss stats, as an integer. | |
int | getEnemyBoost (int lvl, enemyClass eclass) |
Takes one integer and an enemyClass and returns the boost relative to the level delta with base enemy stats, as an integer. | |
void | resetPermboosts (Fighter *f) |
Takes a Fighter pointer and resets all of its permboost_STAT values to 0, also correctly updating the current stat values. | |
void | applyPermboosts (Fighter *f) |
Takes a Fighter pointer and applies all of its permboost_STAT values by adding them to the current stat values. | |
void | resetArtifactsState (Fighter *f) |
Takes a Fighter pointer and Resets the active value for each Artifact in the fighter's artifactsBag array that doesn't have an always active trait. | |
void | printSpawnMessage (Enemy *e, int roomIndex, int enemyIndex) |
Takes a Enemy pointer and two integers for current room index and current enemy index, and prints the spawn message formatted. | |
int | dropConsumable (Fighter *player) |
Takes a Fighter pointer value and adds a random Consumable to consumablesBag. | |
int | dropArtifact (Fighter *player) |
Takes a Fighter pointer value and adds a random Artifact to artifactsBag. | |
int | getConsumableQty (Fighter *f, int n) |
Takes a Fighter pointer and an integer denoting the consumableClass and returns the respective qty value from player's consumablesBag at the provided index. | |
void | emptyConsumables (Fighter *f) |
Sets the qty value to 0 for all Consumable in f's consumablesBag with positive qty. | |
void | emptyArtifacts (Fighter *f) |
Takes a Fighter pointer and sets the qty value to 0 and the active flag to false for all Artifacts in the fighter's artifactsBag with positive qty. | |
void | emptyEquips (Fighter *player) |
Takes a Fighter pointer and, for all Equip in equipsBag field with positive qty, sets qty to 0 and frees the Equip pointer. | |
Path * | randomise_path (char *seed, Koliseo *kls, const char *path_to_savefile) |
Takes an integer seed and returns a Path pointer. | |
void | printStats (Fighter *f) |
Takes a Fighter pointer and prints most of its values formatted. | |
void | printEStats (Enemy *e) |
Takes a Enemy pointer and prints most of its values formatted. | |
void | printConsumablesStats (Consumable *c) |
Takes a Consumable pointer and prints most of its values formatted. | |
void | printArtifactStats (Artifact *a) |
Takes a Artifact pointer and prints most of its values formatted. | |
void | enqueue_notification (char *text, int time, int color, RingaBuf *rb_notifications) |
Takes a RingaBuf pointer and queues the passed text to it. | |
void | applyStatus (Fighter *f, RingaBuf *rb_notifications) |
Takes a RingaBuf pointer to queue notifications to, a Fighter pointer value and applies the effect pertaining to its status value. | |
void | applyEStatus (Enemy *e, RingaBuf *rb_notifications) |
Takes a RingaBuf pointer to queue notifications to, a Enemy pointer value and applies the effect pertaining to its status value. | |
void | applyBStatus (Boss *b, RingaBuf *rb_notifications) |
Takes a RingaBuf pointer to queue notifications to, a Boss pointer value and applies the effect pertaining to its status value. | |
void | printStatusText (fighterStatus status, char *subject, int color, RingaBuf *rb_notifications) |
Takes a RingaBuf pointer to queue notifications to, a fighterStatus value and a string of who's the entity to print the respective status message. | |
void | dropEquip (Fighter *player, int beast, Koliseo *kls, RingaBuf *rb_notifications) |
Takes a Fighter pointer value and an integer indicating if the drop was from a beast enemy, and adds a random Equip to the fighter's equipsBag. | |
void | death (Fighter *player, loadInfo *load_info) |
Takes a Fighter and loadInfo pointers and prints fighter stats and a game over message. | |
void | e_death (Enemy *e) |
Takes a Enemy pointer and frees its allocated memory. | |
void | b_death (Boss *b) |
Takes a Boss pointer and frees its allocated memory. | |
void | updateCounters (Turncounter *counters[], int isEnemy, Fighter *f, Enemy *e) |
Takes a Turncounter array, an integer, a Fighter pointer and an Enemy pointer. | |
void | updateCounters_Boss (Turncounter *counters[], int isBoss, Fighter *f, Boss *b) |
Takes a Turncounter array, an integer, a Fighter pointer and a Boss pointer. | |
void | checkremainder (Fighter *player, int xp) |
Takes a Fighter pointer and the amount of xp to add. | |
void | giveXp (Fighter *player, Enemy *e) |
Takes a Fighter and a Enemy pointers and handles xp gain by fighter. | |
void | giveXp_Boss (Fighter *player, Boss *b) |
Takes a Fighter and a Boss pointers and handles xp gain by fighter. | |
int | getEnemyXpGain (Enemy *e) |
Takes a Enemy pointer and returns its xp gain as sum of xp field value and level. | |
int | getBossXpGain (Boss *b) |
Takes a Boss pointer and returns its xp gain as sum of xp field value and level. | |
void | onLevelUp (Fighter *player) |
Takes a Fighter pointer and updated its stats. | |
int | getBoost (int lvl, int luck) |
Takes two integers for level to calc against and luck, and returns the boost relative to the level with luck variations, as an integer. | |
void | sell_all_equips (Fighter *f, Koliseo_Temp *t_kls) |
Takes a Fighter pointer and deleted all the equips not in use, granting a payment to the Fighter balance. | |
turnOption | getTurnChoice (char *ch) |
Returns the chosen option as a turnOption. | |
foeTurnOption | enemyTurnPick (Enemy *e, Fighter *f) |
Returns a randomised pick as foeTurnOption. | |
foeTurnOption | bossTurnPick (Boss *b, Fighter *f) |
Returns a randomised pick as foeTurnOption. | |
void | quit (Fighter *p, Room *room, loadInfo *load_info, Koliseo_Temp *t_kls) |
Takes a Fighter, a Room and a loadInfo pointers, and prints fighter stats and a quitting message, before quitting the program and freeing Room. | |
void | setCounter (Turncounter *c, int turns) |
Takes a Turncounter pointer and an integer. | |
void | useConsumable (Fighter *f, Enemy *e, Boss *b, char *string, int isBoss) |
Takes a Fighter, an Enemy and a Boss pointers, a string denoting the consumableClass and an int for use on enemy or boss. | |
int | hlpd_rand_docount (bool count) |
Wraps over rand() to update G_RNG_ADVANCEMENTS if passed flag is true. | |
int | hlpd_rand (void) |
Wraps over hlpd_rand_docount() to update G_RNG_ADVANCEMENTS. | |
unsigned long | hlpd_hash (unsigned char *str) |
djb2 by Dan Bernstein. | |
void | gen_random_seed (char buffer[PATH_SEED_BUFSIZE+1]) |
Sets the passed buffer up to be a random seed. | |
bool | check_seed (char buffer[PATH_SEED_BUFSIZE]) |
Checks the passed buffer as a seed. | |
void | hlpd_reset_logfile (void) |
void | hlpd_use_forced_flags (const char *whoami) |
int | display_colorpairs (void) |
Runs some shell commands to see all color pairs, then returns exitcode Prints the encoded value of the passed char to the window at the coordinates. | |
int | hlpd_getopt (size_t argc, char **argv, const char *whoami) |
Parse options from CLI arguments. | |
void applyBStatus | ( | Boss * | b, |
RingaBuf * | rb_notifications ) |
void applyEStatus | ( | Enemy * | e, |
RingaBuf * | rb_notifications ) |
Takes a RingaBuf pointer to queue notifications to, a Enemy pointer value and applies the effect pertaining to its status value.
e | The Enemy pointer at hand. |
rb_notifications | The RingaBuf used for notifications. |
void applyPermboosts | ( | Fighter * | f | ) |
void applyStatus | ( | Fighter * | f, |
RingaBuf * | rb_notifications ) |
Takes a RingaBuf pointer to queue notifications to, a Fighter pointer value and applies the effect pertaining to its status value.
f | The Fighter pointer at hand. |
rb_notifications | The RingaBuf pointer used for notifications. |
void b_death | ( | Boss * | b | ) |
void blue | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick blue color.
foeTurnOption bossTurnPick | ( | Boss * | b, |
Fighter * | f ) |
Returns a randomised pick as foeTurnOption.
b | Pointer to the boss to pick for. |
f | Pointer to the target fighter. |
bool check_seed | ( | char | buffer[PATH_SEED_BUFSIZE] | ) |
Checks the passed buffer as a seed.
Only chars >= 0, <= Z; not including the symbols between digits and letters. Notably, the passed buffer is checked by applying toupper() to each char.
buffer | The buffer to check. |
void checkremainder | ( | Fighter * | player, |
int | xp ) |
Takes a Fighter pointer and the amount of xp to add.
Current level xp is managed by this function, including how much xp is needed to level up again. The values are stored in the fighter struct. Thresholds for each level are checked and eventually onLevelUp() is called, with recursion on this function after.
player | The Fighter pointer that gets xp. |
xp | The amount of xp. |
int costFromSkill | ( | skillType | class | ) |
Takes a skillType and returns the corresponding cost by the inner array position, as an integer.
Correct result is only possible by having the enum values in a consistent order with the integer array.
class | The skillType. |
int costFromSpecial | ( | fighterClass | class, |
specialMove | move ) |
Takes a fighterClass and a specialMove and returns the corresponding cost by the inner array position, as an integer.
Correct result is only possible by having the enum values in a consistent order with the integer array.
class | The fighterClass. |
move | The specialMove. |
void cyan | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick cyan color.
void dbg_countStats | ( | countStats * | stats | ) |
Debugs the passed (preallocated) countStats with log_tag().
stats | The allocated countStats to debug. |
void dbg_Fighter | ( | Fighter * | fighter | ) |
void dbg_GameOptions | ( | GameOptions * | options | ) |
void dbg_GameScreen | ( | GameScreen * | scr | ) |
Debugs the passed (preallocated) GameScreen with log_tag().
scr | The allocated GameScreen to debug. |
void dbg_Gamestate | ( | Gamestate * | gmst | ) |
void dbg_Path | ( | Path * | path | ) |
void dbg_Saveslot | ( | Saveslot * | saveslot | ) |
void dbg_Wincon | ( | Wincon * | wc | ) |
Debugs the passed (preallocated) Wincon with log_tag().
wc | The allocated countStats to debug. |
char * descStringFromChest | ( | int | c | ) |
Takes a integer and returns the corresponding chest desc string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
c | The integer/chestClass. |
char * descStringFromPerk | ( | int | p | ) |
char * descStringFromSkill | ( | skillType | class | ) |
Takes a fighterClass and a specialMove and returns the corresponding desc string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
class | The skillType. |
char * descStringFromSpecial | ( | fighterClass | class, |
specialMove | move ) |
Takes a fighterClass and a specialMove and returns the corresponding desc string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
class | The fighterClass. |
move | The specialMove. |
char * descStringFromTreasure | ( | int | t | ) |
Takes a integer and returns the corresponding treasure desc string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
t | The integer/treasureClass. |
int display_colorpairs | ( | void | ) |
Runs some shell commands to see all color pairs, then returns exitcode Prints the encoded value of the passed char to the window at the coordinates.
int dropArtifact | ( | Fighter * | player | ) |
Takes a Fighter pointer value and adds a random Artifact to artifactsBag.
The Artifact is randomised according to ARTIFACTSMAX until one which was not found yet drops. Special Equip functions are also set up here.
player | The Fighter pointer at hand. |
int dropConsumable | ( | Fighter * | player | ) |
Takes a Fighter pointer value and adds a random Consumable to consumablesBag.
player | The Fighter pointer at hand. |
void dropEquip | ( | Fighter * | player, |
int | beast, | ||
Koliseo * | kls, | ||
RingaBuf * | rb_notifications ) |
Takes a Fighter pointer value and an integer indicating if the drop was from a beast enemy, and adds a random Equip to the fighter's equipsBag.
Prints notifications to the passed RingaBuf pointer. The Equip dropped is initalised here, including stat variations for quality and level boosts (stat increase from base level by adding player level over EQUIPLVLBOOSTRATIO. The values of earliestBagSlot and equipsBagOccupiedSlots are managed. If equipsBag is full (EQUIPSBAGSIZE), user has to choose one Equip not currently equipped to be deleted and replaced by the new one. Special Equip functions are also set up here.
player | The Fighter pointer at hand. |
beast | The integer for drops coming from a beast kill if true. |
kls | The Koliseo used for allocations. |
rb_notifications | The RingaBuf used for notifications. |
void e_death | ( | Enemy * | e | ) |
void emptyArtifacts | ( | Fighter * | f | ) |
Takes a Fighter pointer and sets the qty value to 0 and the active flag to false for all Artifacts in the fighter's artifactsBag with positive qty.
f | The Fighter pointer at hand. |
void emptyConsumables | ( | Fighter * | f | ) |
Sets the qty value to 0 for all Consumable in f's consumablesBag with positive qty.
f | The Fighter pointer at hand. |
void emptyEquips | ( | Fighter * | player | ) |
foeTurnOption enemyTurnPick | ( | Enemy * | e, |
Fighter * | f ) |
Returns a randomised pick as foeTurnOption.
e | Pointer to the enemy to pick for. |
f | Pointer to the target fighter. |
void enqueue_notification | ( | char * | text, |
int | time, | ||
int | color, | ||
RingaBuf * | rb_notifications ) |
Takes a RingaBuf pointer and queues the passed text to it.
text | The contents of the notification. |
time | The display time in milliseconds (unused, for now) |
color | The index of color to use for the notification drawing. |
rb_notifications | The Ringabuf to push the notification to. |
void freeRoom | ( | Room * | room | ) |
void gen_random_seed | ( | char | buffer[PATH_SEED_BUFSIZE+1] | ) |
Sets the passed buffer up to be a random seed.
Only chars >= 0, <= Z; not including the symbols between digits and letters.
buffer | The buffer to set. |
boost_fp_fun get_StatBoostCounter_FoeParty_Fun | ( | Stat | s | ) |
Takes a Stat and returns the corresponding boost_fp_fun pointer for the function relating to the stat.
s | The Stat that the caller needs to match to a boost_fp_fun pointer. |
int getBoost | ( | int | lvl, |
int | luck ) |
Takes two integers for level to calc against and luck, and returns the boost relative to the level with luck variations, as an integer.
At level 1, returns 0.
lvl | The level to check the boost against. |
luck | The luck value to influence calcs. |
int getBossBoost | ( | int | lvl, |
bossClass | bclass ) |
Takes one integer and a bossClass and returns the boost relative to the level delta with base boss stats, as an integer.
The EnemyBossStats pointer for the boss's bossClass is loaded. If the boost is negative, returns 0.
lvl | The level to check the boost against. |
bclass | The bossClass used to determine base level. |
int getBossXpGain | ( | Boss * | b | ) |
int getConsumableQty | ( | Fighter * | f, |
int | n ) |
Takes a Fighter pointer and an integer denoting the consumableClass and returns the respective qty value from player's consumablesBag at the provided index.
f | The Fighter pointer. |
n | The consumableClass value. |
int getEnemyBoost | ( | int | lvl, |
enemyClass | eclass ) |
Takes one integer and an enemyClass and returns the boost relative to the level delta with base enemy stats, as an integer.
The EnemyBaseStats pointer for the enemy's enemyClass is loaded. If the boost is negative, returns 0.
lvl | The level to check the boost against. |
eclass | The enemyClass used to determine base level. |
int getEnemyXpGain | ( | Enemy * | e | ) |
boost_b_fun getStatBoostCounterBossFun | ( | Stat | s | ) |
Takes a Stat and returns the corresponding boost_b_fun pointer for the function relating to the stat.
s | The Stat that the caller needs to match to a boost_b_fun pointer. |
boost_e_fun getStatBoostCounterEnemyFun | ( | Stat | s | ) |
Takes a Stat and returns the corresponding boost_e_fun pointer for the function relating to the stat.
s | The Stat that the caller needs to match to a boost_e_fun pointer. |
effect_b_fun getStatusCounterBossFun | ( | fighterStatus | status | ) |
Takes a fighterStatus and returns the corresponding effect_e_fun pointer for the function relating to the status.
status | The fighterStatus that the caller needs to match to a effect_e_fun pointer. |
effect_e_fun getStatusCounterEnemyFun | ( | fighterStatus | status | ) |
Takes a fighterStatus and returns the corresponding effect_e_fun pointer for the function relating to the status.
status | The fighterStatus that the caller needs to match to a effect_e_fun pointer. |
effect_fun getStatusCounterFun | ( | fighterStatus | status | ) |
Takes a fighterStatus and returns the corresponding effect_fun pointer for the function relating to the status.
status | The fighterStatus that the caller needs to match to a effect_fun pointer. |
turnOption getTurnChoice | ( | char * | ch | ) |
Returns the chosen option as a turnOption.
ch | A string representing the turn choice. |
Takes a Fighter and a Enemy pointers and handles xp gain by fighter.
Takes a Fighter and a Boss pointers and handles xp gain by fighter.
void green | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick green color.
void hlpd_dbg_features | ( | void | ) |
Prints configuration info.
int hlpd_getopt | ( | size_t | argc, |
char ** | argv, | ||
const char * | whoami ) |
Parse options from CLI arguments.
argc | argc from main |
argv | argv from main |
whoami | Name used by the program |
unsigned long hlpd_hash | ( | unsigned char * | str | ) |
djb2 by Dan Bernstein.
See: http://www.cse.yorku.ca/~oz/hash.html https://stackoverflow.com/questions/7666509/hash-function-for-string
str | The string to hash. |
int hlpd_rand | ( | void | ) |
Wraps over hlpd_rand_docount() to update G_RNG_ADVANCEMENTS.
int hlpd_rand_docount | ( | bool | count | ) |
Wraps over rand() to update G_RNG_ADVANCEMENTS if passed flag is true.
count | When true, advance G_RNG_ADVANCEMENTS. |
void hlpd_reset_logfile | ( | void | ) |
void hlpd_sigint_handler | ( | int | signum | ) |
Function to handle Ctrl+C signal.
signum | The signal number, expected to be SIGINT. |
void hlpd_use_forced_flags | ( | const char * | whoami | ) |
void initWincon | ( | Wincon * | w, |
Path * | p, | ||
winconClass | class ) |
Takes a Wincon and a Path pointers and a winconClass and initialises the passed Wincon.
void lightBlue | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light blue color.
void lightCyan | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light cyan color.
void lightGreen | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light green color.
void lightPurple | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light purple color.
void lightRed | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light red color.
void lightYellow | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light yellow color.
void loadLore | ( | char ** | lore_strings, |
int | loreKind ) |
Loads the lore strings from the appropriate lore file.
lore_strings | The string array to copy to. |
loreKind | The kind of lore, used to open the corresponding lore file. |
void log_OP | ( | turnOption_OP | op | ) |
Logs a turnOption_OP to "$STATICDIR/OPS_log.txt".
op | The turnOption_OP to log. |
void log_tag | ( | char * | filename, |
char * | header, | ||
const char * | format, | ||
... ) |
Takes a filename string, a string headear and a format string.
Tries logging the message to the passed file if global var G_DEBUG_ON is set.
filename | The filename to open. |
header | The string header for the message to log. |
format | The format string for message. |
char * nameStringFromPerk | ( | int | p | ) |
char * nameStringFromSkill | ( | skillType | class | ) |
Takes a skillType and returns the corresponding name string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
class | The skillType. |
char * nameStringFromSpecial | ( | fighterClass | class, |
specialMove | move ) |
Takes a fighterClass and a specialMove and returns the corresponding name string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
class | The fighterClass. |
move | The specialMove. |
void onLevelUp | ( | Fighter * | player | ) |
Takes a Fighter pointer and updated its stats.
getBoost() is called to get the stat boost for current level, which is then applyed to atk, def and vel; while hp gets first multiplied by 1.13 and then gets the boost added. The totalenergy value is increased by player level over 5. Hp and energy are replenished. If the level is multiple of SPECIALLVLRATIO and the player still has at least one SpecialSlot not enabled, unlockSpecial() is called.
player | The Fighter pointer that levels up. |
void pickClass | ( | Fighter * | player | ) |
Takes a Fighter pointer and sets the class value after asking the user for input.
player | The pointer whose class value will be set. |
void pickName | ( | Fighter * | player | ) |
Takes a Fighter pointer and sets the name value after asking the user for input.
player | The pointer whose name value will be set. |
void pickWincon | ( | Wincon * | w | ) |
Takes a Wincon pointer and sets its class after asking the user for input.
w | The wincon pointer whose class value will be set. |
void printArtifactStats | ( | Artifact * | a | ) |
void printClasses | ( | void | ) |
Prints all the fighterClass values as integers and as strings.
void printConsumablesStats | ( | Consumable * | c | ) |
Takes a Consumable pointer and prints most of its values formatted.
c | The Consumable pointer with stats to print. |
void printEStats | ( | Enemy * | e | ) |
void printFormattedVersion | ( | const char * | progname | ) |
Prints formatted version string.
progname | The program name string. |
void printGlobVars | ( | void | ) |
Prints global vars to stdout.
void printSpawnMessage | ( | Enemy * | e, |
int | roomIndex, | ||
int | enemyIndex ) |
Takes a Enemy pointer and two integers for current room index and current enemy index, and prints the spawn message formatted.
e | The Enemy pointer to print. |
roomIndex | The index of current room. |
enemyIndex | The index of current enemy. |
void printStats | ( | Fighter * | f | ) |
void printStatusText | ( | fighterStatus | status, |
char * | subject, | ||
int | color, | ||
RingaBuf * | rb_notifications ) |
Takes a RingaBuf pointer to queue notifications to, a fighterStatus value and a string of who's the entity to print the respective status message.
status | The fighterStatus at hand. |
subject | A string with name of entity owning the fighterStatus. |
color | The color to use for the notification. |
rb_notifications | The RingaBuf used for notifications. |
void printTitle | ( | void | ) |
Prints an hardcoded title screen.
void printVersion | ( | void | ) |
Prints version string.
void printWincons | ( | void | ) |
Prints all the winconClass values as integers and as strings.
void purple | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick purple color.
Path * randomise_path | ( | char * | seed, |
Koliseo * | kls, | ||
const char * | path_to_savefile ) |
void red | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick red color.
void resetArtifactsState | ( | Fighter * | f | ) |
Takes a Fighter pointer and Resets the active value for each Artifact in the fighter's artifactsBag array that doesn't have an always active trait.
At the moment, this only excludes CHAOSORB.
void resetBossStatus | ( | Boss * | b | ) |
Takes a Boss pointer and resets its status value to Normal.
b | The pointer whose status value will be reset. |
void resetEnemyStatus | ( | Enemy * | e | ) |
Takes a Enemy pointer and resets its status value to Normal.
e | The pointer whose status value will be reset. |
void resetFighterStatus | ( | Fighter * | f | ) |
Takes a Fighter pointer and resets its status value to Normal.
f | The pointer whose status value will be reset. |
void resetPermboosts | ( | Fighter * | f | ) |
void resolve_staticPath | ( | char | static_path[500] | ) |
Sets the passed char array to the expected path for /static/ folder.
static_path | The array that will hold path to static folder. |
void * s4c_gui_calloc | ( | size_t | count, |
size_t | size ) |
void * s4c_gui_malloc | ( | size_t | size | ) |
saveType saveTypeFrom_string | ( | char * | s | ) |
Takes a string and returns the corresponding saveType.
Will return -1 if no match is found.
s | The string to convert. |
int scanClass | ( | void | ) |
Asks for an integer on stdin and returns it if it's a valid fighterClass index.
void scanName | ( | Fighter * | player | ) |
Takes a Fighter pointer and sets its name value to the string provided on stdin.
player | The pointer whose name value will be set. |
int scanWincon | ( | void | ) |
Asks for an integer on stdin and returns it if it's a valid winconClass index.
void sell_all_equips | ( | Fighter * | f, |
Koliseo_Temp * | t_kls ) |
void set_boss_turnboost_atk | ( | Boss * | b, |
int | boost ) |
Takes a Boss pointer and an integer, used to set the turnboost_atk value at the pointer.
b | The Boss pointer whose turnboost_atk value will be set. |
boost | The value that will be set. |
void set_boss_turnboost_def | ( | Boss * | b, |
int | boost ) |
Takes a Boss pointer and an integer, used to set the turnboost_def value at the pointer.
b | The Boss pointer whose turnboost_def value will be set. |
boost | The value that will be set. |
void set_boss_turnboost_enr | ( | Boss * | b, |
int | boost ) |
Takes a Boss pointer and an integer, used to set the turnboost_enr value at the pointer.
b | The Boss pointer whose turnboost_enr value will be set. |
boost | The value that will be set. |
void set_boss_turnboost_vel | ( | Boss * | b, |
int | boost ) |
Takes a Boss pointer and an integer, used to set the turnboost_vel value at the pointer.
b | The Boss pointer whose turnboost_vel value will be set. |
boost | The value that will be set. |
void set_enemy_turnboost_atk | ( | Enemy * | e, |
int | boost ) |
Takes a Enemy pointer and an integer, used to set the turnboost_atk value at the pointer.
e | The Enemy pointer whose turnboost_atk value will be set. |
boost | The value that will be set. |
void set_enemy_turnboost_def | ( | Enemy * | e, |
int | boost ) |
Takes a Enemy pointer and an integer, used to set the turnboost_def value at the pointer.
e | The Enemy pointer whose turnboost_def value will be set. |
boost | The value that will be set. |
void set_enemy_turnboost_enr | ( | Enemy * | e, |
int | boost ) |
Takes a Enemy pointer and an integer, used to set the turnboost_enr value at the pointer.
e | The Enemy pointer whose turnboost_enr value will be set. |
boost | The value that will be set. |
void set_enemy_turnboost_vel | ( | Enemy * | e, |
int | boost ) |
Takes a Enemy pointer and an integer, used to set the turnboost_vel value at the pointer.
e | The Enemy pointer whose turnboost_vel value will be set. |
boost | The value that will be set. |
void set_foeparty_turnboost_atk | ( | FoeParty * | fp, |
int | boost ) |
Takes a FoeParty pointer and an integer, used to set the turnboost_atk value at the pointer.
fp | The FoeParty pointer whose turnboost_atk value will be set. |
boost | The value that will be set. |
void set_foeparty_turnboost_def | ( | FoeParty * | fp, |
int | boost ) |
Takes a FoeParty pointer and an integer, used to set the turnboost_def value at the pointer.
fp | The FoeParty pointer whose turnboost_def value will be set. |
boost | The value that will be set. |
void set_foeparty_turnboost_enr | ( | FoeParty * | fp, |
int | boost ) |
Takes a FoeParty pointer and an integer, used to set the turnboost_enr value at the pointer.
fp | The FoeParty pointer whose turnboost_enr value will be set. |
boost | The value that will be set. |
void set_foeparty_turnboost_vel | ( | FoeParty * | fp, |
int | boost ) |
Takes a FoeParty pointer and an integer, used to set the turnboost_vel value at the pointer.
fp | The FoeParty pointer whose turnboost_vel value will be set. |
boost | The value that will be set. |
void set_turnboost_atk | ( | Fighter * | f, |
int | boost ) |
Takes a Fighter pointer and an integer, used to set the turnboost_atk value at the pointer.
f | The Fighter pointer whose turnboost_atk value will be set. |
boost | The value that will be set. |
void set_turnboost_def | ( | Fighter * | f, |
int | boost ) |
Takes a Fighter pointer and an integer, used to set the turnboost_def value at the pointer.
f | The Fighter pointer whose turnboost_def value will be set. |
boost | The value that will be set. |
void set_turnboost_enr | ( | Fighter * | f, |
int | boost ) |
Takes a Fighter pointer and an integer, used to set the turnboost_enr value at the pointer.
f | The Fighter pointer whose turnboost_enr value will be set. |
boost | The value that will be set. |
void set_turnboost_vel | ( | Fighter * | f, |
int | boost ) |
Takes a Fighter pointer and an integer, used to set the turnboost_vel value at the pointer.
f | The Fighter pointer whose turnboost_vel value will be set. |
boost | The value that will be set. |
void setConsumablePrices | ( | int | size, |
int * | consumablePrices, | ||
Consumable ** | consumables ) |
Takes a size int and a pointer to integer array, initialises all the prices.
size | Size of both arrays. |
consumablePrices | Pointer to integer array for prices. |
consumables | Pointer to Consumable pointer to influence pricing. |
void setCounter | ( | Turncounter * | c, |
int | turns ) |
Takes a Turncounter pointer and an integer.
If the count value at the pointer is 0 (counter is inactive), the turns valueis assigned.
c | The Turncounter whose count value will be set. |
turns | The value to be assigned. |
void setEquipPrices | ( | int | size, |
int * | equipPrices, | ||
Equip * | equips[] ) |
Takes a size int and a pointer to integer array, initialises all the prices, depending on stats from the Equips array pointer.
size | Size of both arrays. |
equipPrices | Pointer to integer array for prices. |
equips | Pointer to Equip pointer to influence pricing. |
Takes a path pointer, a roadFork value pointer, a room type pointer, and an integer.
Depending on GAMEMODE (and eventually roadFork value), sets the room type pointer to a roomClass value.
path | Pointer to Path. |
roadFork_value | The pointer value of the roadfork that we must use as result. |
room_type | The pointer value of the room type to set. |
roomsDone | The total of rooms completed. |
void statReset | ( | Fighter * | player, |
int | force ) |
Takes a Fighter pointer and an integer used to force execution.
If the force parameter is true, all checks are ignored. If enemy's hp value is at least 50% of total, and none of atk, def or vel is 0 or less, nothing happens with an early return. Otherwise, getBoost() is called to calc the level stat boost for each stat. The BaseStats pointer for the fighter's fighterClass is loaded and each one of atk, def and vel is checked accounting for level boost. If none of them is below the respective treshold of 35, 18 and 30 % of total, nothing happens. Otherwise, all of them are reset to full amount accounting for permboosts and level boost.
player | The Fighter pointer to check the stats for. |
force | The integer to bypass all checks if true. |
void statResetBoss | ( | Boss * | b, |
int | force ) |
Takes a Boss pointer and an integer used to force execution.
If the force parameter is true, all checks are ignored. If boss's hp value is at least 40% of total, and none of atk, def or vel is 0 or less, nothing happens with an early return. Otherwise, getBossBoost() is called to calc the level stat boost for each stat. The BossBaseStats pointer for the boss's bossClass is loaded and each one of atk, def and vel is checked accounting for level boost. If none of them is below the respective treshold of 30, 30 and 20 % of total, nothing happens. Otherwise, all of them are reset to full amount accounting for beast boost and level boost.
b | The Boss pointer to check the stats for. |
force | The integer to bypass all checks if true. |
void statResetEnemy | ( | Enemy * | e, |
int | force ) |
Takes an Enemy pointer and an integer used to force execution.
If the force parameter is true, all checks are ignored. If enemy's hp value is at least 40% of total, and none of atk, def or vel is 0 or less, nothing happens with an early return. Otherwise, getEnemyBoost() is called to calc the level stat boost for each stat. The EnemyBaseStats pointer for the enemy's enemyClass is loaded and each one of atk, def and vel is checked accounting for level boost. If none of them is below the respective treshold of 30, 30 and 20 % of total, nothing happens. Otherwise, all of them are reset to full amount accounting for beast boost and level boost.
e | The Enemy pointer to check the stats for. |
force | The integer to bypass all checks if true. |
char * stringFrom_fightResult | ( | fightResult | fr | ) |
Takes a fightResult fr and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
fr | The fight result value. |
char * stringFrom_HLP_Region_Type | ( | HLP_Region_Type | t | ) |
Takes a integer and returns the corresponding HLP_Region_Type string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
t | The HLP type. |
const char * stringFrom_HLPD_DirectionalKeys_Schema | ( | int | dks | ) |
Takes a integer and returns the corresponding HLPD_DirectionalKeys_Schema string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
dks | The integer/HLPD_DirectionalKeys_Schema. |
char * stringFrom_HLPD_KeyClass | ( | HLPD_KeyClass | k | ) |
Takes a integer and returns the corresponding HLPD_KeyClass string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
k | The integer/HLPD_KeyClass. |
char * stringFrom_OP_res | ( | OP_res | r | ) |
Takes a OP_res and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
r | The OP_res. |
char * stringFrom_saveType | ( | saveType | s | ) |
Takes a saveType and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
s | The saveType value. |
char * stringFromArtifacts | ( | int | a | ) |
Takes a integer and returns the corresponding artifact string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
a | The integer/artifactClass. |
char * stringFromBossClass | ( | bossClass | b | ) |
Takes a bossClass and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
b | The class. |
char * stringFromClass | ( | fighterClass | f | ) |
Takes a fighterClass and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
f | The class. |
char * stringFromConsumables | ( | int | c | ) |
Takes a integer and returns the corresponding consumable string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
c | The integer/consumableClass. |
char * stringFromEClass | ( | enemyClass | e | ) |
Takes a enemyClass and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
e | The class. |
char * stringFromEquips | ( | int | e | ) |
Takes a integer and returns the corresponding equip string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
e | The integer/equipClass. |
char * stringFromEquipzones | ( | int | z | ) |
Takes a integer and returns the corresponding equipzone string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
z | The integer/Equipzone. |
char * stringFromFloorclass | ( | floorClass | fc | ) |
Takes a integer and returns the corresponding floorClass string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
fc | The integer/floorClass. |
char * stringFromFoePartyClass | ( | foePartyClass | fp | ) |
Takes a integer and returns the corresponding FoeParty desc string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
fp | The integer/foePartyClass. |
char * stringFromFoeTurnOP | ( | foeTurnOption_OP | ft | ) |
Takes a foeTurnOption_OP and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
ft | The turn choice. |
char * stringFromGamemode | ( | Gamemode | g | ) |
Takes a integer and returns the corresponding gamemode string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
g | The integer/Gamemode. |
char * stringFromQuality | ( | int | q | ) |
Takes a integer and returns the corresponding quality string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
q | The integer/quality |
char * stringFromRoom | ( | roomClass | r | ) |
Takes a integer and returns the corresponding room name string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
r | The integer/roomClass. |
char * stringFromStatus | ( | fighterStatus | s | ) |
Takes a fighterStatus and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
s | The status. |
char * stringFromTurnOP | ( | turnOption_OP | t | ) |
Takes a turnOption_OP and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
t | The turn choice. |
char * stringFromWinconClass | ( | winconClass | w | ) |
Takes a winconClass and returns the corresponding string by the inner array position.
Correct result is only possible by having the enum values in a consistent order with the string array.
w | The class. |
void strongWhite | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick white color.
void update_Equipslots | ( | Fighter * | f | ) |
void update_Gamestate | ( | Gamestate * | gmst, |
int | current_fighters, | ||
roomClass | current_roomtype, | ||
int | current_room_index, | ||
int | current_enemy_index, | ||
Floor * | current_floor, | ||
Room * | current_room, | ||
GameOptions * | game_options ) |
Updates the passed (preallocated) Gamestate with the passed int values.
gmst | The allocated Gamestate to update. |
current_fighters | Number of current Fighters. |
current_roomtype | roomClass for current Room. |
current_room_index | Index for current Room. |
current_enemy_index | Index for current Enemy. |
current_floor | Pointer to current Floor, initialised if gmst->gamemode == Rogue. |
current_room | Pointer to current Room. |
game_options | Pointer to current game options. |
void updateCounters | ( | Turncounter * | counters[], |
int | isEnemy, | ||
Fighter * | f, | ||
Enemy * | e ) |
Takes a Turncounter array, an integer, a Fighter pointer and an Enemy pointer.
For every Turncounter in the array count value is checked, and when it's equal to 1, the function pointer relevant to the type value of the Counter is called. Depending on the isEnemy input value, the function call will be for the Fighter or Enemy version (and the according pointer from the input will be passed to the called function). When the count value is 0, counters are considered inactive, so when the count value is not 1, it is lowered by 1 if it's positive.
counters | The Turncounter array to be updated. |
isEnemy | Dictates if the check is done for an Enemy or a Fighter. |
f | The Fighter pointer whose counters field will be updated if isEnemy is false. |
e | The Enemy pointer whose counters field will be updated if isEnemy is true. |
void updateCounters_Boss | ( | Turncounter * | counters[], |
int | isBoss, | ||
Fighter * | f, | ||
Boss * | b ) |
Takes a Turncounter array, an integer, a Fighter pointer and a Boss pointer.
For every Turncounter in the array count value is checked, and when it's equal to 1, the function pointer relevant to the type value of the Counter is called. Depending on the isBoss input value, the function call will be for the Fighter or Boss version (and the according pointer from the input will be passed to the called function). When the count value is 0 Counters are considered inactive, so when the count value is not 1, it is lowered by 1 if it's positive.
counters | The Turncounter array to be updated. |
isBoss | Dictates if the check is done for a Boss or a Fighter. |
f | The Fighter pointer whose counters field will be updated if isBoss is false. |
b | The Boss pointer whose counters field will be updated if isBoss is true. |
void usage | ( | const char * | progname | ) |
Prints correct argument syntax for command line invocation.
Takes a Fighter, an Enemy and a Boss pointers, a string denoting the consumableClass and an int for use on enemy or boss.
If qty value for the Consumable is 0, we have an early return. Otherise effect is applied and qty is decreased.
void white | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a light white color.
void yellow | ( | void | ) |
Prints an ASCII escape code that makes subsequent output a thick yellow color.