helapordo 1.4.12
Loading...
Searching...
No Matches
game_init.c File Reference
#include "game_init.h"
Include dependency graph for game_init.c:

Functions

void initPerks (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its perks field by allocating all the Perk accounted in perkClass.
 
void initConsumableBag (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its consumablesBag field by allocating a Consumable for each consumableClass.
 
void initCounters (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.
 
void initECounters (Enemy *e, Koliseo_Temp *t_kls)
 Takes a Enemy pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.
 
void initBCounters (Boss *b, Koliseo_Temp *t_kls)
 Takes a Boss pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.
 
void initFoePartyCounters (FoeParty *fp, Koliseo_Temp *t_kls)
 Takes a FoeParty pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.
 
void initEquipSlots (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its equipslots field by allocating an Equipslot for each Equipzone.
 
void initArtifactsBag (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its artifactsBag field by allocating a Artifact for each artifactClass.
 
void initEquipsBag (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its equipsBag field by allocating an Equip for each array slot.
 
void initPlayerStats (Fighter *player, Path *path, Koliseo *kls)
 Takes one Fighter and one Path pointers and initialises the fighter fields.
 
void initEnemyStats (Enemy *e, Koliseo_Temp *t_kls)
 Takes one Enemy pointer and initialises the enemy fields.
 
void initBossStats (Boss *b, Koliseo_Temp *t_kls)
 Takes one Boss pointer and initialises the boss fields.
 
void initFoePartyStats (FoeParty *fp, Koliseo_Temp *t_kls)
 Takes one FoeParty pointer and initialises the party fields.
 
void prepareFoeParty (FoeParty *fp, int partysize, int roomindex, Koliseo_Temp *t_kls)
 Takes a FoeParty pointer, a size for complete party, and an integer for the current room index, and initialises all the fields making the FoeParty ready for use in battle.
 
void setSkills (Fighter *f, Koliseo *kls)
 Takes a Fighter pointer and prepares its skillSlot fields by allocating FIGHTER_SKILL_SLOTS slots.
 
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 fighter stats.
 
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 passed.
 
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 fighter's stats.
 
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 battle, using fighter stats to influence init.
 
void prepareBoss (Boss *b, Koliseo_Temp *t_kls)
 Takes a Boss pointer and initialises all the fields making it ready for use in battle.
 
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 current enemy index.
 
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 in battle, based on the fighter stats.
 
void prepareRoadfork (Roadfork *r)
 Takes a Roadfork pointer and initialises all the fields making it ready for use in battle.
 
void setEnemySkills (Enemy *e, Koliseo_Temp *t_kls)
 Takes a Enemy pointer and prepares its skillSlot fields by allocating ENEMY_SKILL_SLOTS slots.
 
void setBossSkills (Boss *b, Koliseo_Temp *t_kls)
 Takes a Boss pointer and prepares its skillSlot fields by allocating BOSS_SKILL_SLOTS slots.
 

Function Documentation

◆ initArtifactsBag()

void initArtifactsBag ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its artifactsBag field by allocating a Artifact for each artifactClass.

See also
Fighter
Artifact
artifactClass
ARTIFACTSMAX
Parameters
klsThe Koliseo used for allocations.
fThe Fighter pointer whose artifactsBag field will be initialised.

◆ initBCounters()

void initBCounters ( Boss * b,
Koliseo_Temp * t_kls )

Takes a Boss pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.

Counters are initialised using the ordering of counterIndexes, primarily for distinguinsing what kind of function pointer will be registered in the counter. For a given Counter, only the correct pointer field is assigned and the others are left untouched.

See also
Boss
Turncounter
Countertype
COUNTERSMAX
counterIndexes
getStatBoostCounterBossFun()
getStatusCounterBossFun()
Parameters
bThe Boss pointer whose counters field will be initialised.
t_klsThe Koliseo_Temp used for allocations.

◆ initBossStats()

void initBossStats ( Boss * b,
Koliseo_Temp * t_kls )

Takes one Boss pointer and initialises the boss fields.

The BossBaseStats pointer for the boss's bossClass is loaded. If the beast field at the pointer is already set before this call, atk def vel and hp of the enemy will receive a multiplicative boost equal to BSTFACTOR . Xp value will also be multiplie by 3. Notably, the level field is not set at all by this function and needs to be set by the caller. All the fields common to BossBaseStats are initialised with the base value and eventual beast boost. initBCounters() is called to init the counters field. The status field is set to Normal.

See also
Boss
bossClass
BossBaseStats
initBCounters()
fighterStatus
Parameters
bThe Boss whose fields will be initialised.
t_klsThe Koliseo_Temp used for allocations.

◆ initChest()

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 fighter stats.

See also
Chest
Parameters
cThe allocated Chest pointer with already set class to initialise.
fThe Fighter pointer with stats.
t_klsThe Koliseo_Temp used for allocations.

◆ initConsumableBag()

void initConsumableBag ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its consumablesBag field by allocating a Consumable for each consumableClass.

See also
Fighter
Consumable
consumableClass
CONSUMABLESMAX
Parameters
fThe Fighter pointer whose consumablesBag field will be initialised.
klsThe Koliseo to do allocations.

◆ initCounters()

void initCounters ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.

Counters are initialised using the ordering of counterIndexes, primarily for distinguinsing what kind of function pointer will be registered in the counter. For a given Counter, only the correct pointer field is assigned and the others are left untouched.

See also
Fighter
Turncounter
Countertype
COUNTERSMAX
counterIndexes
getStatBoostCounterFun()
getStatusCounterFun()
Parameters
fThe Fighter pointer whose counters field will be initialised.
klsThe Koliseo used for allocation.

◆ initECounters()

void initECounters ( Enemy * e,
Koliseo_Temp * t_kls )

Takes a Enemy pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.

Counters are initialised using the ordering of counterIndexes, primarily for distinguinsing what kind of function pointer will be registered in the counter. For a given Counter, only the correct pointer field is assigned and the others are left untouched.

See also
Enemy
Turncounter
Countertype
COUNTERSMAX
counterIndexes
getStatBoostCounterEnemyFun()
getStatusCounterEnemyFun()
Parameters
eThe Enemy pointer whose counters field will be initialised.
t_klsThe Koliseo_Temp used for allocations.

◆ initEnemyStats()

void initEnemyStats ( Enemy * e,
Koliseo_Temp * t_kls )

Takes one Enemy pointer and initialises the enemy fields.

The EnemyBaseStats pointer for the enemy's enemyClass is loaded. If the beast field at the pointer is already set before this call, atk def vel and hp of the enemy will receive a multiplicative boost equal to BSTFACTOR . Also, Xp value will be multiplied by 3. Notably, the level field is not set at all by this function and needs to be set by the caller. All the fields common to EnemyBaseStats are initialised with the base value and eventual beast boost. initECounters() is called to init the counters field. The status field is set to Normal.

See also
Enemy
enemyClass
EnemyBaseStats
initECounters()
fighterStatus
Parameters
eThe Enemy whose fields will be initialised.
t_klsThe Koliseo_Temp used for allocations.

◆ initEquipsBag()

void initEquipsBag ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its equipsBag field by allocating an Equip for each array slot.

See also
Fighter
Equip
ARTIFACTSMAX
Parameters
klsThe Koliseo used for allocations.
fThe Fighter pointer whose equipsBag field will be initialised.

◆ initEquipSlots()

void initEquipSlots ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its equipslots field by allocating an Equipslot for each Equipzone.

See also
Fighter
Equipslot
Equipzone
counterIndexes
EQUIPZONES
Parameters
fThe Fighter pointer whose equipslots field will be initialised.
klsThe Koliseo used for allocations.

◆ initFoePartyCounters()

void initFoePartyCounters ( FoeParty * fp,
Koliseo_Temp * t_kls )

Takes a FoeParty pointer and prepares its counters field by allocating all the Turncounter accounted in counterIndexes.

Counters are initialised using the ordering of counterIndexes, primarily for distinguinsing what kind of function pointer will be registered in the counter. For a given Counter, only the correct pointer field is assigned and the others are left untouched.

See also
FoeParty
Turncounter
Countertype
COUNTERSMAX
counterIndexes
get_StatBoostCounter_FoeParty_Fun()
get_StatusCounter_FoeParty_Fun()
Parameters
fpThe FoeParty pointer whose counters field will be initialised.
t_klsThe Koliseo_Temp used for allocations.

◆ initFoePartyStats()

void initFoePartyStats ( FoeParty * fp,
Koliseo_Temp * t_kls )

Takes one FoeParty pointer and initialises the party fields.

The FoePartyBaseStats pointer for the FoeParty's foePartyClass is loaded. All the fields common to FoePartyBaseStats are initialised with the base value. initFoePartyCounters() is called to init the counters field.

See also
FoeParty
foePartyClass
FoePartyBaseStats
initFoePartyCounters()
Parameters
fpThe FoeParty whose fields will be initialised.
t_klsThe Koliseo_Temp used for allocations.

◆ initPerks()

void initPerks ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its perks field by allocating all the Perk accounted in perkClass.

Perks are initialised using the ordering of perkClass.

See also
Fighter
Perk
perkClass
PERKSMAX
Parameters
fThe Fighter pointer whose perks field will be initialised.
klsThe Koliseo used for allocation.

◆ initPlayerStats()

void initPlayerStats ( Fighter * player,
Path * path,
Koliseo * kls )

Takes one Fighter and one Path pointers and initialises the fighter fields.

Luck value is set as path luck value modulo MAXPLAYERLUCK. The BaseStats pointer for the fighter's figtherClass is loaded. The stats field is initalised with all inner values at 0. setSpecials(), initCounters() are called to init the specialslots and counters fields. initEquipSlots() is called to init the equipslots field, and the relative int field are set to 0. initArtifactsFun() is called to init all the Artifact effect_fun field. All the tempboost_STAT and permboost_STAT fields are set to 0. All the fields common to BaseStats are initialised with the base value. The status field is set to Normal.

See also
Fighter
fighterClass
Path
BaseStats
countStats
MAXPLAYERLUCK
setSpecials()
initCounters()
initEquipSlots()
initArtifactsFun()
fighterStatus
Parameters
playerThe Fighter whose fields will be initialised.
pathThe Path pointer of the current game.
klsThe Koliseo used for allocation.

◆ initShop()

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 passed.

See also
Shop
Parameters
sThe Shop whose fields will be initialised.
indexWeightThe integer for room index weight.
playerThe Fighter player to influence item generation.
t_klsThe Koliseo_Temp used for allocations.

◆ initTreasure()

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 fighter's stats.

See also
Treasure
Parameters
tThe allocated Treasure pointer with already set class to initialise.
fThe Fighter pointer to influence item generation.
t_klsThe Koliseo_Temp used for allocations.

◆ prepareBoss()

void prepareBoss ( Boss * b,
Koliseo_Temp * t_kls )

Takes a Boss pointer and initialises all the fields making it ready for use in battle.

Calls initBossStats() after setting class and level, then forces a stat reset to update the stats with the level boost.

See also
Boss
initBossStats()
Parameters
bThe allocated Boss pointer to initialise.
t_klsThe Koliseo_Temp used for allocations.

◆ prepareChest()

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 battle, using fighter stats to influence init.

Calls initChest() after setting class.

See also
Chest
initChest()
Parameters
cThe allocated Chest pointer to initialise.
fThe Fighter pointer to influence item generation.
t_klsThe Koliseo_Temp used for allocations.

◆ prepareFoeParty()

void prepareFoeParty ( FoeParty * fp,
int partysize,
int roomindex,
Koliseo_Temp * t_kls )

Takes a FoeParty pointer, a size for complete party, and an integer for the current room index, and initialises all the fields making the FoeParty ready for use in battle.

Calls initFoePartyStats() after setting class and level

See also
FoeParty
initFoePartyStats()
Parameters
fpThe allocated FoeParty pointer to initialise.
partysizeSize of party.
roomindexIndex of current room.
t_klsThe Koliseo_Temp used for allocations.

◆ prepareRoadfork()

void prepareRoadfork ( Roadfork * r)

Takes a Roadfork pointer and initialises all the fields making it ready for use in battle.

Calls initRoadfork() after setting class.

See also
Roadfork
initRoadfork()
Parameters
rThe allocated Roadfork pointer to initialise.

◆ prepareRoomEnemy()

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 current enemy index.

The class field of the enemy is randomised according to ENEMYCLASSESMAX. If the room index is multiple of BEASTROOM and the enemy is the last one in he room, its beast field is set to 1. The EnemyBaseStats pointer for the enemy's enemyClass is loaded and the level field for the enemy is set to base level, before increasing. initEnemyStats() is called to set all stat fields and statResetEnemy() is called with force=true to apply the boosted stats to leveled enemies.

See also
Enemy
enemyClass
ENEMYCLASSESMAX
BEASTROOM
BSTFACTOR
ENEMYLVLRATIO
EnemyBaseStats
initEnemyStats()
statResetEnemy()
Parameters
eThe Enemy pointer to prepare.
roomindexThe index of current room.
enemiesInRoomThe number of enemies in current room.
enemyindexThe index of current enemy.
t_klsThe Koliseo_Temp used for allocations.

◆ prepareTreasure()

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 in battle, based on the fighter stats.

Calls initTreasure() after setting class.

See also
Treasure
initTreasure()
Parameters
tThe allocated Treasure pointer to initialise.
fThe Fighter pointer to influence item generation.
t_klsThe Koliseo_Temp used for allocations.

◆ setBossSkills()

void setBossSkills ( Boss * b,
Koliseo_Temp * t_kls )

Takes a Boss pointer and prepares its skillSlot fields by allocating BOSS_SKILL_SLOTS slots.

Skill slots are initialised.

See also
Boss
Skilllot
Boss_SKILL_SLOTS
SKILLSTOTAL
costFromSkill()
stringFromSkill()
Parameters
t_klsThe Koliseo_Temp used for allocations.
bThe Boss pointer whose skill slots will be initialised.

◆ setEnemySkills()

void setEnemySkills ( Enemy * e,
Koliseo_Temp * t_kls )

Takes a Enemy pointer and prepares its skillSlot fields by allocating ENEMY_SKILL_SLOTS slots.

Skill slots are initialised.

See also
Enemy
Skilllot
ENEMY_SKILL_SLOTS
SKILLSTOTAL
costFromSkill()
stringFromSkill()
Parameters
t_klsThe Koliseo_Temp used for allocations.
eThe Enemy pointer whose skill slots will be initialised.

◆ setSkills()

void setSkills ( Fighter * f,
Koliseo * kls )

Takes a Fighter pointer and prepares its skillSlot fields by allocating FIGHTER_SKILL_SLOTS slots.

Skill slots are initialised.

See also
Fighter
Skilllot
FIGHTER_SKILL_SLOTS
SKILL_TYPE_LAST_UNLOCKABLE
costFromSkill()
stringFromSkill()
Parameters
klsThe Koliseo used for allocations.
fThe Fighter pointer whose skill slots will be initialised.