helapordo 1.4.20
Loading...
Searching...
No Matches
game_init.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 GAME_INIT_H_
20#define GAME_INIT_H_
21
22#include "sprites.h"
23#include "specials.h"
24#include "game_rng.h"
25#include "game_fight.h"
26
27void initPerks(Fighter * f, Koliseo * kls);
28void initConsumableBag(Fighter * f, Koliseo * kls);
29
30void initCounters(Fighter * f, Koliseo * kls);
31void initECounters(Enemy * e, Koliseo_Temp * t_kls);
32void initBCounters(Boss * b, Koliseo_Temp * t_kls);
33void initFoePartyCounters(FoeParty * fp, Koliseo_Temp * t_kls);
34
35void initBossStats(Boss * b, Koliseo_Temp * t_kls);
36void prepareBoss(Boss * b, Koliseo_Temp * t_kls);
37
38void initFoePartyStats(FoeParty * fp, Koliseo_Temp * t_kls);
39void prepareFoeParty(FoeParty * fp, int total_foes, int roomindex,
40 Koliseo_Temp * t_kls);
41
42void initEquipSlots(Fighter * f, Koliseo * kls);
43
44void initArtifactsBag(Fighter * f, Koliseo * kls);
45
46void initEquipsBag(Fighter * f, Koliseo * kls);
47
48void initPlayerStats(Fighter * player, Path * path, Koliseo * kls);
49
50void initEnemyStats(Enemy * e, Koliseo_Temp * t_kls);
51void setEquipPrices(int size, int *equipPrices, Equip * equips[]);
52void setConsumablePrices(int size, int *consumablePrices, Consumable ** consumables);
53void setSkills(Fighter *f, Koliseo *kls);
54void initChest(Chest * c, Fighter * f, Koliseo_Temp * t_kls);
55void initShop(Shop * s, int indexWeight, Fighter * player,
56 Koliseo_Temp * t_kls);
57void initTreasure(Treasure * t, Fighter * f, Koliseo_Temp * t_kls);
58void prepareChest(Chest * c, Fighter * f, Koliseo_Temp * t_kls);
59void prepareRoomEnemy(Enemy * e, int roomindex, int enemiesInRoom,
60 int enemyindex, Koliseo_Temp * t_kls);
61
62void prepareTreasure(Treasure * t, Fighter * f, Koliseo_Temp * t_kls);
63
65void setEnemySkills(Enemy *e, Koliseo_Temp *t_kls);
66void setBossSkills(Boss *b, Koliseo_Temp *t_kls);
67
69
71
73
75
80
81void set_turnboost_atk(Fighter * f, int boost);
82void set_turnboost_def(Fighter * f, int boost);
83void set_turnboost_vel(Fighter * f, int boost);
84void set_turnboost_enr(Fighter * f, int boost);
85
86void set_enemy_turnboost_atk(Enemy * e, int boost);
87void set_enemy_turnboost_def(Enemy * e, int boost);
88void set_enemy_turnboost_vel(Enemy * e, int boost);
89void set_enemy_turnboost_enr(Enemy * e, int boost);
90
91void set_boss_turnboost_atk(Boss * b, int boost);
92void set_boss_turnboost_def(Boss * b, int boost);
93void set_boss_turnboost_vel(Boss * b, int boost);
94void set_boss_turnboost_enr(Boss * b, int boost);
95
96void set_foeparty_turnboost_atk(FoeParty * fp, int boost);
97void set_foeparty_turnboost_def(FoeParty * fp, int boost);
98void set_foeparty_turnboost_vel(FoeParty * fp, int boost);
99void set_foeparty_turnboost_enr(FoeParty * fp, int boost);
100
102void resetEnemyStatus(Enemy * e);
103void resetBossStatus(Boss * b);
104
106int costFromSkill(skillType class);
107
108#endif // GAME_INIT_H_
Equip equips[EQUIPSMAX+1]
Array containing all Equip instances.
Definition game_core.c:559
void(* effect_fp_fun)(struct FoeParty *)
Defines a function pointer returning void and taking a FoeParty pointer.
Definition game_core.h:1258
void(* boost_fp_fun)(struct FoeParty *, int boost)
Defines a function pointer returning void and taking a FoeParty pointer and an integer.
Definition game_core.h:1283
Stat
The different kinds of Stat.
Definition game_core.h:619
void(* boost_b_fun)(Boss *, int boost)
Defines a function pointer returning void and taking a Boss pointer and an integer.
Definition game_core.h:1277
void(* effect_e_fun)(Enemy *)
Defines a function pointer returning void and taking a Enemy pointer.
Definition game_core.h:1246
fighterClass
The different kinds of Fighter.
Definition game_core.h:598
void(* effect_b_fun)(Boss *)
Defines a function pointer returning void and taking a Boss pointer.
Definition game_core.h:1252
specialMove
The different kinds of special moves.
Definition game_core.h:804
fighterStatus
The different kinds of fighterStatus.
Definition game_core.h:578
void(* boost_e_fun)(Enemy *, int boost)
Defines a function pointer returning void and taking a Enemy pointer and an integer.
Definition game_core.h:1271
skillType
Definition game_core.h:859
void(* effect_fun)(Fighter *)
Defines a function pointer returning void and taking a Fighter pointer.
Definition game_core.h:1240
void(* boost_fun)(Fighter *, int boost)
Defines a function pointer returning void and taking a Fighter pointer and an integer.
Definition game_core.h:1265
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.
Definition game_init.c:2288
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.
Definition game_init.c:2249
void initEquipsBag(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its equipsBag field by allocating an Equip for each array slot.
Definition game_init.c:744
void setBossSkills(Boss *b, Koliseo_Temp *t_kls)
Takes a Boss pointer and prepares its skillSlot fields by allocating BOSS_SKILL_SLOTS slots.
Definition game_init.c:1876
effect_fun getStatusCounterFun(fighterStatus status)
Takes a fighterStatus and returns the corresponding effect_fun pointer for the function relating to t...
Definition game_init.c:1904
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.
Definition game_init.c:2301
void prepareBoss(Boss *b, Koliseo_Temp *t_kls)
Takes a Boss pointer and initialises all the fields making it ready for use in battle.
Definition game_init.c:1679
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...
Definition game_init.c:2068
void initEquipSlots(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its equipslots field by allocating an Equipslot for each Equipzo...
Definition game_init.c:691
effect_e_fun getStatusCounterEnemyFun(fighterStatus status)
Takes a fighterStatus and returns the corresponding effect_e_fun pointer for the function relating to...
Definition game_init.c:1922
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 ...
Definition game_init.c:1084
void prepareChest(Chest *c, Fighter *f, Koliseo_Temp *t_kls)
Takes a Chest and Fighter pointers and initialises all the fields in chest making it ready for use in...
Definition game_init.c:1653
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.
Definition game_init.c:2171
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.
Definition game_init.c:2184
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.
Definition game_init.c:2197
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.
Definition game_init.c:2275
void setEnemySkills(Enemy *e, Koliseo_Temp *t_kls)
Takes a Enemy pointer and prepares its skillSlot fields by allocating ENEMY_SKILL_SLOTS slots.
Definition game_init.c:1843
void prepareFoeParty(FoeParty *fp, int total_foes, int roomindex, Koliseo_Temp *t_kls)
Takes a FoeParty pointer, a size for complete party, and an integer for the current room index,...
Definition game_init.c:1053
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.
Definition game_init.c:2158
void initPlayerStats(Fighter *player, Path *path, Koliseo *kls)
Takes one Fighter and one Path pointers and initialises the fighter fields.
Definition game_init.c:785
void initChest(Chest *c, Fighter *f, Koliseo_Temp *t_kls)
Takes a Chest and Fighter pointers and initialises all the fields in chest based on chest class and f...
Definition game_init.c:1162
void initEnemyStats(Enemy *e, Koliseo_Temp *t_kls)
Takes one Enemy pointer and initialises the enemy fields.
Definition game_init.c:879
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.
Definition game_init.c:2132
void resetEnemyStatus(Enemy *e)
Takes a Enemy pointer and resets its status value to Normal.
Definition game_init.c:2326
void initArtifactsBag(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its artifactsBag field by allocating a Artifact for each artifac...
Definition game_init.c:714
void initConsumableBag(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its consumablesBag field by allocating a Consumable for each con...
Definition game_init.c:64
void prepareRoadfork(Roadfork *r)
Takes a Roadfork pointer and initialises all the fields making it ready for use in battle.
Definition game_init.c:1813
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.
Definition game_init.c:2145
void setSkills(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its skillSlot fields by allocating FIGHTER_SKILL_SLOTS slots.
Definition game_init.c:1134
void initBossStats(Boss *b, Koliseo_Temp *t_kls)
Takes one Boss pointer and initialises the boss fields.
Definition game_init.c:935
void initTreasure(Treasure *t, Fighter *f, Koliseo_Temp *t_kls)
Takes a Treasure and Fighter pointers and initialises all the treasure fields based on its class and ...
Definition game_init.c:1566
void initFoePartyStats(FoeParty *fp, Koliseo_Temp *t_kls)
Takes one FoeParty pointer and initialises the party fields.
Definition game_init.c:986
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.
Definition game_init.c:2262
void initFoePartyCounters(FoeParty *fp, Koliseo_Temp *t_kls)
Takes a FoeParty pointer and prepares its counters field by allocating all the Turncounter accounted ...
Definition game_init.c:547
void initECounters(Enemy *e, Koliseo_Temp *t_kls)
Takes a Enemy pointer and prepares its counters field by allocating all the Turncounter accounted in ...
Definition game_init.c:250
boost_fun getStatBoostCounterFun(Stat s)
Takes a Stat and returns the corresponding boost_fun pointer for the function relating to the stat.
Definition game_init.c:1960
void initPerks(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its perks field by allocating all the Perk accounted in perkClas...
Definition game_init.c:30
boost_e_fun getStatBoostCounterEnemyFun(Stat s)
Takes a Stat and returns the corresponding boost_e_fun pointer for the function relating to the stat.
Definition game_init.c:1996
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.
Definition game_init.c:2119
void initShop(Shop *s, int indexWeight, Fighter *player, Koliseo_Temp *t_kls)
Takes one Shop pointer and initialises all the fields, depeding on stats from the Fighter pointer pas...
Definition game_init.c:1367
void prepareRoomEnemy(Enemy *e, int roomindex, int enemiesInRoom, int enemyindex, Koliseo_Temp *t_kls)
Takes a Enemy and three integers denoting current room index, how many enemies are in the room and cu...
Definition game_init.c:1725
void resetFighterStatus(Fighter *f)
Takes a Fighter pointer and resets its status value to Normal.
Definition game_init.c:2315
int costFromSkill(skillType class)
Takes a skillType and returns the corresponding cost by the inner array position, as an integer.
Definition game_init.c:2364
void initCounters(Fighter *f, Koliseo *kls)
Takes a Fighter pointer and prepares its counters field by allocating all the Turncounter accounted i...
Definition game_init.c:102
void resetBossStatus(Boss *b)
Takes a Boss pointer and resets its status value to Normal.
Definition game_init.c:2337
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.
Definition game_init.c:2210
boost_b_fun getStatBoostCounterBossFun(Stat s)
Takes a Stat and returns the corresponding boost_b_fun pointer for the function relating to the stat.
Definition game_init.c:2032
int costFromSpecial(fighterClass class, specialMove move)
Takes a fighterClass and a specialMove and returns the corresponding cost by the inner array position...
Definition game_init.c:2351
void setConsumablePrices(int size, int *consumablePrices, Consumable **consumables)
Takes a size int and a pointer to integer array, initialises all the prices.
Definition game_init.c:1106
effect_b_fun getStatusCounterBossFun(fighterStatus status)
Takes a fighterStatus and returns the corresponding effect_e_fun pointer for the function relating to...
Definition game_init.c:1940
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.
Definition game_init.c:2106
void initBCounters(Boss *b, Koliseo_Temp *t_kls)
Takes a Boss pointer and prepares its counters field by allocating all the Turncounter accounted in c...
Definition game_init.c:399
void prepareTreasure(Treasure *t, Fighter *f, Koliseo_Temp *t_kls)
Takes a Treasure and Fighter pointer and initialises all the treasure fields making it ready for use ...
Definition game_init.c:1786
effect_fp_fun get_StatusCounter_FoeParty_Fun(fighterStatus status)
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.
Definition game_init.c:2236
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.
Definition game_init.c:2223
Represents the entity initialised from a bossClass.
Definition game_core.h:1204
Represents the entity initialised from a chestClass.
Definition game_core.h:1557
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 the state of game progression.
Definition game_core.h:1357
Represents the entity initialised from a roadforkClass.
Definition game_core.h:1647
Represents a shop instance.
Definition game_core.h:1503
Represents the entity initialised from a treasureClass.
Definition game_core.h:1603