V-Gears 0
Free Final Fantasy VII engine.
KernelDataInstaller Class Reference

#include <KernelDataInstaller.h>

Collaboration diagram for KernelDataInstaller:

Classes

struct  AccessoryData
 Data for each accessory. More...
 
struct  ArmorData
 Data for each armor. More...
 
struct  AttackData
 Data for each attack. More...
 
struct  CharacterData
 Character data. More...
 
struct  CommandData
 Data for each command. More...
 
struct  GrowthData
 Battle data. More...
 
struct  ItemData
 Data for each items. More...
 
struct  KeyItemData
 Data for each key item. More...
 
struct  MateriaData
 Data for each materia. More...
 
struct  MateriaStatBonus
 Stat bonuses given by equipping materia. More...
 
struct  StatBonus
 Bonus in stat givven by weapons or armor. More...
 
struct  StatCurve
 Stat curve. More...
 
struct  StatusEffect
 
struct  SummonNameData
 List of summon names. More...
 
struct  Target
 List of target selection options. More...
 
struct  WeaponData
 Data for each weapon. More...
 

Public Member Functions

 KernelDataInstaller (std::string path)
 Constructor. More...
 
 ~KernelDataInstaller ()
 Destructor. More...
 
void ReadPrices ()
 Reads items and materia prices from the executable. More...
 
int ReadCommands ()
 Reads the command data from the kernel. More...
 
void WriteCommands (std::string file_name)
 Saves command data to a Lua script. More...
 
int ReadAttacks ()
 Reads the attack data from the kernel. More...
 
void WriteAttacks (std::string file_name)
 Saves command data to a Lua script. More...
 
int ReadCharacters ()
 Reads character data from the kernel. More...
 
void WriteCharacters (std::string file_name)
 Saves character data to a Lua script. More...
 
void ReadGrowth ()
 Reads growth data from the kernel. More...
 
void WriteGrowth (std::string file_name)
 Saves growth data to a Lua script. More...
 
int ReadItems ()
 Reads the items from the kernel. More...
 
void WriteItems (std::string file_name)
 Saves item data to a Lua script. More...
 
int ReadWeapons ()
 Reads the weapon info from the kernel. More...
 
void WriteWeapons (std::string file_name)
 Saves weapon data to a Lua script. More...
 
int ReadArmors ()
 Reads the armor info from the kernel. More...
 
void WriteArmors (std::string file_name)
 Saves armor data to a Lua script. More...
 
int ReadAccessories ()
 Reads the accessory info from the kernel. More...
 
void WriteAccessories (std::string file_name)
 Saves accessory data to a Lua script. More...
 
int ReadMateria ()
 Reads materia info from the kernel. More...
 
void WriteMateria (std::string file_name)
 Saves materia data to a Lua script. More...
 
int ReadKeyItems ()
 Reads key item info from the kernel. More...
 
void WriteKeyItems (std::string file_name)
 Saves key item data to a Lua script. More...
 
int ReadSummonNames ()
 Reads summon name info from the kernel. More...
 
void WriteSummonNames (std::string file_name)
 Saves summon names data to a Lua script. More...
 
void ReadInitialSaveMap ()
 Reads the initial savemap from the kernel. More...
 
void WriteInitialSaveMap (std::string file_name)
 Saves the initial savemap to a Lua script. More...
 

Private Types

enum  KERNEL_SECTIONS {
  KERNEL_COMMAND_DATA = 0 , KERNEL_ATTACK_DATA , KERNEL_BATTLE_AND_GROWTH_DATA , KERNEL_INITIALIZATION_DATA ,
  KERNEL_ITEM_DATA , KERNEL_WEAPON_DATA , KERNEL_ARMOR_DATA , KERNEL_ACCESSORY_DATA ,
  KERNEL_MATERIA_DATA , KERNEL_COMMAND_DESCRIPTIONS , KERNEL_ATTACK_DESCRIPTIONS , KERNEL_ITEM_DESCRIPTIONS ,
  KERNEL_WEAPON_DESCRIPTIONS , KERNEL_ARMOR_DESCRIPTIONS , KERNEL_ACCESSORY_DESCRIPTIONS , KERNEL_MATERIA_DESCRIPTIONS ,
  KERNEL_KEY_ITEM_DESCRIPTIONS , KERNEL_COMMAND_NAMES , KERNEL_ATTACK_NAMES , KERNEL_ITEM_NAMES ,
  KERNEL_WEAPON_NAMES , KERNEL_ARMOR_NAMES , KERNEL_ACCESSORY_NAMES , KERNEL_MATERIA_NAMES ,
  KERNEL_KEY_ITEM_NAMES , KERNEL_BATTLE_AND_BATTLE_SCREEN_TEXT , KERNEL_SUMMON_ATTACK_NAMES
}
 
enum  ELEMENT {
  FIRE = 0 , ICE , BOLT , EARTH ,
  POISON , GRAVITY , WATER , WIND ,
  HOLY , RESTORATIVE , CUT , HIT ,
  PUNCH , SHOOT , SHOUT , HIDDEN
}
 
enum  RESTORE_TYPE { RESTORE_HP = 0 , RESTORE_MP = 1 , RESTORE_STATUS = 2 , RESTORE_NONE = 3 }
 Determines what an item affects on when used from the menu. More...
 
enum  STATUS {
  DEATH = 0 , NEAR_DEATH , SLEEP , POISONED ,
  SADNESS , FURY , CONFU , SILENCE ,
  HASTE , SLOW , STOP , FROG ,
  SMALL , SLOW_NUMB , PETRIFY , REGEN ,
  BARRIER , M_BARRIER , REFLECT , DUAL ,
  SHIELD , D_SENTENCE , MANIPULATE , BERSERK ,
  PEERLESS , PARALYSIS , DARKNESS , DUAL_DRAIN ,
  DEATH_FORCE , RESIST , LUCKY_GIRL , IMPRISONED
}
 List of altered status. More...
 
enum  STATUS_EFFECT { INFLICT = 0 , CURE = 1 , TOGGLE = 2 }
 How a status effect modifier attack or item can act. More...
 
enum  COMMAND_MENU {
  NONE = 0 , MAGIC = 1 , SUMMON = 2 , ITEM = 3 ,
  E_SKILL = 4 , THROW = 5 , LIMIT = 6 , TARGET = 7 ,
  W_MAGIC = 8 , W_SUMMON = 9 , W_ITEM = 10 , COIN = 11
}
 Menus that must be shown when selecting a command. More...
 
enum  SLOT_TYPE { SLOT_UNLINKED = 0 , SLOT_LINKED = 1 }
 Materia slot types. More...
 
enum class  MATERIA_TYPE {
  MAGIC = 1 , SUPPORT , COMMAND , INDEPENDENT ,
  SUMMON
}
 Types of materia. More...
 
enum  STAT_CURVE_TYPE { CURVE_PRIMARY = 0 , CURVE_HP , CURVE_MP , CURVE_EXP }
 Types of stat curves. More...
 

Private Member Functions

std::string GetBasicStatName (int id)
 Retrieves the 3-letter name of a basic stat from it's id. More...
 

Private Attributes

std::vector< CommandDatacommands_
 Items read from the kernel. More...
 
std::vector< AttackDataattacks_
 Attacks read from the kernel. More...
 
std::vector< CharacterDatacharacters_
 Character info read from the kernel. More...
 
GrowthData growth_
 
std::vector< ItemDataitems_
 Items read from the kernel. More...
 
std::vector< WeaponDataweapons_
 Weapons read from the kernel. More...
 
std::vector< ArmorDataarmors_
 Armors read from the kernel. More...
 
std::vector< AccessoryDataaccessories_
 Accessories read from the kernel. More...
 
std::vector< MateriaDatamateria_
 Materia read from the kernel. More...
 
std::vector< KeyItemDatakey_items_
 Key items read from the kernel. More...
 
std::vector< SummonNameDatasummon_names_
 Summon names read from the kernel. More...
 
SaveMap savemap_
 The initial savemap structure. More...
 
BinGZipFile kernel_
 The kernel file. More...
 
std::string exe_path_
 Path to ff7.exe file. More...
 
u32 prices_ [416]
 Item and materia shop prices. More...
 
std::string attack_names_ [128]
 Attack names, required for other sections. More...
 
std::string command_names_ [128]
 Command names, required for other sections. More...
 

Member Enumeration Documentation

◆ COMMAND_MENU

Menus that must be shown when selecting a command.

Enumerator
NONE 

No menu, execute command directly, without target selection.

MAGIC 

Show magic menu.

SUMMON 

Show summon menu.

ITEM 

Show item menu.

E_SKILL 

Show enemy skill menu.

THROW 

Show throw menu.

LIMIT 

Show limit menu.

TARGET 

No menu, skip to target selection.

W_MAGIC 

Show W-Magic menu.

W_SUMMON 

Show W-Summon menu.

W_ITEM 

Show W-Item menu.

COIN 

Show Coin menu.

◆ ELEMENT

Enumerator
FIRE 

Fire element.

ICE 

Ice element.

BOLT 

Bolt element.

EARTH 

Earth element.

POISON 

Poison element.

GRAVITY 

Gravity element.

WATER 

Water element.

WIND 

Wind element.

HOLY 

Holy element.

RESTORATIVE 

Restorative element.

CUT 

Cut element.

HIT 

Hit element.

PUNCH 

Punch element.

SHOOT 

Shoot element.

SHOUT 

Shout element.

HIDDEN 

Hidden element.

◆ KERNEL_SECTIONS

Enumerator
KERNEL_COMMAND_DATA 

Command data section in KERNEL.BIN.

KERNEL_ATTACK_DATA 

Attack data section in KERNEL.BIN.

KERNEL_BATTLE_AND_GROWTH_DATA 

Battle and growth data section in KERNEL.BIN.

KERNEL_INITIALIZATION_DATA 

Initialization data section in KERNEL.BIN.

KERNEL_ITEM_DATA 

Item data section in KERNEL.BIN.

KERNEL_WEAPON_DATA 

Weapon data section in KERNEL.BIN.

KERNEL_ARMOR_DATA 

Armor data section in KERNEL.BIN.

KERNEL_ACCESSORY_DATA 

Accessory data section in KERNEL.BIN.

KERNEL_MATERIA_DATA 

Materia data section in KERNEL.BIN.

KERNEL_COMMAND_DESCRIPTIONS 

Command descriptions section in KERNEL.BIN.

KERNEL_ATTACK_DESCRIPTIONS 

Attack descriptions section in KERNEL.BIN.

KERNEL_ITEM_DESCRIPTIONS 

Item descriptions section in KERNEL.BIN.

KERNEL_WEAPON_DESCRIPTIONS 

Weapon descriptions section in KERNEL.BIN.

KERNEL_ARMOR_DESCRIPTIONS 

Armor descriptions section in KERNEL.BIN.

KERNEL_ACCESSORY_DESCRIPTIONS 

Accessory descriptions section in KERNEL.BIN.

KERNEL_MATERIA_DESCRIPTIONS 

Materia descriptions section in KERNEL.BIN.

KERNEL_KEY_ITEM_DESCRIPTIONS 

Key Item descriptions section in KERNEL.BIN.

KERNEL_COMMAND_NAMES 

Command Names section in KERNEL.BIN.

KERNEL_ATTACK_NAMES 

Atack Names section in KERNEL.BIN.

KERNEL_ITEM_NAMES 

Item Names section in KERNEL.BIN.

KERNEL_WEAPON_NAMES 

Weapon Names section in KERNEL.BIN.

KERNEL_ARMOR_NAMES 

Armor Names section in KERNEL.BIN.

KERNEL_ACCESSORY_NAMES 

Accessory Names section in KERNEL.BIN.

KERNEL_MATERIA_NAMES 

Materia Names section in KERNEL.BIN.

KERNEL_KEY_ITEM_NAMES 

Key Item Names section in KERNEL.BIN.

KERNEL_BATTLE_AND_BATTLE_SCREEN_TEXT 

Battle and Battle-Screen Text section in KERNEL.BIN.

KERNEL_SUMMON_ATTACK_NAMES 

Summon Attack Names section in KERNEL.BIN.

◆ MATERIA_TYPE

enum class KernelDataInstaller::MATERIA_TYPE
strongprivate

Types of materia.

Enumerator
MAGIC 

Magic materia.

SUPPORT 

Support materia.

COMMAND 

Command materia.

INDEPENDENT 

Independent materia.

SUMMON 

Summon materia.

◆ RESTORE_TYPE

Determines what an item affects on when used from the menu.

Enumerator
RESTORE_HP 

The item affects a party member or group HP.

RESTORE_MP 

The item affects a party member or group MP.

RESTORE_STATUS 

The item affects a party member or group status.

RESTORE_NONE 

The item is not restorative.

◆ SLOT_TYPE

Materia slot types.

Enumerator
SLOT_UNLINKED 

A non linked slot.

SLOT_LINKED 

A linked slot.

If the slot is in an even position, it's linked to the one in the right. If it's in an odd position, it;s linked to the one in the Left. Remember that slot positions are 0-index.

◆ STAT_CURVE_TYPE

Types of stat curves.

Althought any of them can be used for any stat, this is their intended use.

Enumerator
CURVE_PRIMARY 

Normal curve, used for primary stat.

CURVE_HP 

HP curve.

Base values must be multiplied by 40 when calculating.

CURVE_MP 

MP curve.

Base values must be multiplied by 2 when calculating.

CURVE_EXP 

Experience curve.

Base must be ignored when calculating. Gradient is quadratic.

◆ STATUS

List of altered status.

Enumerator
DEATH 

The character is dead.

NEAR_DEATH 

The character has critical HP.

SLEEP 

The character is asleep.

POISONED 

The character is poisoned.

SADNESS 

The character is sad.

FURY 

The character is furious.

CONFU 

The character is confused.

SILENCE 

The character is silenced.

HASTE 

The character is slow.

SLOW 

The character is.

STOP 

The character is stopped.

FROG 

The character is a frog.

SMALL 

The character is small.

SLOW_NUMB 

The character is going to be petrified.

PETRIFY 

The character is petrified.

REGEN 

The character is regenerating health.

BARRIER 

The character has a physical barrier.

M_BARRIER 

The character has a magical barrier.

REFLECT 

The character reflects magical attacks.

DUAL 

The character has dual status.

Todo:
What does it do.
SHIELD 

The character has a shield.

D_SENTENCE 

The character has a death sentence.

MANIPULATE 

The character is being manipulated.

BERSERK 

The character is berserk.

PEERLESS 

The character is invincible.

PARALYSIS 

The character is paralyzed.

DARKNESS 

The character is blinded.

DUAL_DRAIN 

The character has dual drain.

DEATH_FORCE 

The character has deathforce.

RESIST 

The character has resist.

LUCKY_GIRL 

Cait' Sith lucky girl mode.

IMPRISONED 

The character is imprisioned.

◆ STATUS_EFFECT

How a status effect modifier attack or item can act.

Enumerator
INFLICT 

Inflicts status changes.

CURE 

Cures status changes.

TOGGLE 

Toggles status changes.

If the target doesn't have the status change, inflict it. If the target already has the status change, cure it.

Constructor & Destructor Documentation

◆ KernelDataInstaller()

KernelDataInstaller::KernelDataInstaller ( std::string  path)

Constructor.

Parameters
[in]pathPath selected in the installation as source directory.

◆ ~KernelDataInstaller()

KernelDataInstaller::~KernelDataInstaller ( )

Destructor.

Member Function Documentation

◆ GetBasicStatName()

std::string KernelDataInstaller::GetBasicStatName ( int  id)
private

Retrieves the 3-letter name of a basic stat from it's id.

Parameters
[in]idThe stat ID.
Returns
Stat name abbreviation. If the stat ID is unknown, "stat" will be returned.

◆ ReadAccessories()

int KernelDataInstaller::ReadAccessories ( )

Reads the accessory info from the kernel.

Returns
The number of accessories read.

◆ ReadArmors()

int KernelDataInstaller::ReadArmors ( )

Reads the armor info from the kernel.

Returns
The number of armor read.

◆ ReadAttacks()

int KernelDataInstaller::ReadAttacks ( )

Reads the attack data from the kernel.

Returns
The number of attacks read.

◆ ReadCharacters()

int KernelDataInstaller::ReadCharacters ( )

Reads character data from the kernel.

Returns
The number of characters read.

◆ ReadCommands()

int KernelDataInstaller::ReadCommands ( )

Reads the command data from the kernel.

Returns
The number of commands read.

◆ ReadGrowth()

void KernelDataInstaller::ReadGrowth ( )

Reads growth data from the kernel.

◆ ReadInitialSaveMap()

void KernelDataInstaller::ReadInitialSaveMap ( )

Reads the initial savemap from the kernel.

◆ ReadItems()

int KernelDataInstaller::ReadItems ( )

Reads the items from the kernel.

Returns
The number of items read.

◆ ReadKeyItems()

int KernelDataInstaller::ReadKeyItems ( )

Reads key item info from the kernel.

Returns
The number of key items read.

◆ ReadMateria()

int KernelDataInstaller::ReadMateria ( )

Reads materia info from the kernel.

Returns
The number of accessories read.

◆ ReadPrices()

void KernelDataInstaller::ReadPrices ( )

Reads items and materia prices from the executable.

◆ ReadSummonNames()

int KernelDataInstaller::ReadSummonNames ( )

Reads summon name info from the kernel.

Returns
The number of summons read.

◆ ReadWeapons()

int KernelDataInstaller::ReadWeapons ( )

Reads the weapon info from the kernel.

Returns
The number of weapons read.

◆ WriteAccessories()

void KernelDataInstaller::WriteAccessories ( std::string  file_name)

Saves accessory data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteArmors()

void KernelDataInstaller::WriteArmors ( std::string  file_name)

Saves armor data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteAttacks()

void KernelDataInstaller::WriteAttacks ( std::string  file_name)

Saves command data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteCharacters()

void KernelDataInstaller::WriteCharacters ( std::string  file_name)

Saves character data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteCommands()

void KernelDataInstaller::WriteCommands ( std::string  file_name)

Saves command data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteGrowth()

void KernelDataInstaller::WriteGrowth ( std::string  file_name)

Saves growth data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteInitialSaveMap()

void KernelDataInstaller::WriteInitialSaveMap ( std::string  file_name)

Saves the initial savemap to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteItems()

void KernelDataInstaller::WriteItems ( std::string  file_name)

Saves item data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteKeyItems()

void KernelDataInstaller::WriteKeyItems ( std::string  file_name)

Saves key item data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteMateria()

void KernelDataInstaller::WriteMateria ( std::string  file_name)

Saves materia data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteSummonNames()

void KernelDataInstaller::WriteSummonNames ( std::string  file_name)

Saves summon names data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

◆ WriteWeapons()

void KernelDataInstaller::WriteWeapons ( std::string  file_name)

Saves weapon data to a Lua script.

Parameters
[in]file_nameAbsolute path to the target Lua file.

Member Data Documentation

◆ accessories_

std::vector<AccessoryData> KernelDataInstaller::accessories_
private

Accessories read from the kernel.

◆ armors_

std::vector<ArmorData> KernelDataInstaller::armors_
private

Armors read from the kernel.

◆ attack_names_

std::string KernelDataInstaller::attack_names_[128]
private

Attack names, required for other sections.

◆ attacks_

std::vector<AttackData> KernelDataInstaller::attacks_
private

Attacks read from the kernel.

◆ characters_

std::vector<CharacterData> KernelDataInstaller::characters_
private

Character info read from the kernel.

◆ command_names_

std::string KernelDataInstaller::command_names_[128]
private

Command names, required for other sections.

◆ commands_

std::vector<CommandData> KernelDataInstaller::commands_
private

Items read from the kernel.

◆ exe_path_

std::string KernelDataInstaller::exe_path_
private

Path to ff7.exe file.

◆ growth_

GrowthData KernelDataInstaller::growth_
private

◆ items_

std::vector<ItemData> KernelDataInstaller::items_
private

Items read from the kernel.

◆ kernel_

BinGZipFile KernelDataInstaller::kernel_
private

The kernel file.

◆ key_items_

std::vector<KeyItemData> KernelDataInstaller::key_items_
private

Key items read from the kernel.

◆ materia_

std::vector<MateriaData> KernelDataInstaller::materia_
private

Materia read from the kernel.

◆ prices_

u32 KernelDataInstaller::prices_[416]
private

Item and materia shop prices.

Indexes 0 - 127: Items. Indexes 128 - 255: Weapons. Indexes 256 - 287: Armors. Indexes 288 - 319: Accessories Indxes 320 - 415: Materia.

◆ savemap_

SaveMap KernelDataInstaller::savemap_
private

The initial savemap structure.

◆ summon_names_

std::vector<SummonNameData> KernelDataInstaller::summon_names_
private

Summon names read from the kernel.

◆ weapons_

std::vector<WeaponData> KernelDataInstaller::weapons_
private

Weapons read from the kernel.


The documentation for this class was generated from the following files: