| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449 |
- /*
- * Copyright (C) 2022 The V-Gears Team
- *
- * This file is part of V-Gears
- *
- * V-Gears is free software: you can redistribute it and/or modify it under
- * terms of the GNU General Public License as published by the Free Software
- * Foundation, version 3.0 (GPLv3) of the License.
- *
- * V-Gears is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
- #pragma once
- #include "common/BinGZipFile.h"
- #include "common/TypeDefine.h"
- #include "Characters.h"
- #include "SaveMap.h"
- class KernelDataInstaller{
- public:
- /**
- * Constructor.
- *
- * @param[in] path Absolute path to the KERNEL.BIN file
- */
- KernelDataInstaller(std::string path);
- /**
- * Destructor.
- */
- ~KernelDataInstaller();
- void ReadPrices(std::string menu_path);
- /**
- * Reads the command data from the kernel.
- *
- * @return The number of commands read.
- */
- int ReadCommands();
- /**
- * Saves command data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteCommands(std::string file);
- /**
- * Reads the attack data from the kernel.
- *
- * @return The number of attacks read.
- */
- int ReadAttacks();
- /**
- * Saves command data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteAttacks(std::string file);
- /**
- * Reads character data from the kernel.
- *
- * @return The number of characters read.
- */
- int ReadCharacters();
- /**
- * Saves character data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteCharacters(std::string file);
- /**
- * Reads growth data from the kernel.
- */
- void ReadGrowth();
- /**
- * Saves growth data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteGrowth(std::string file);
- /**
- * Reads the items from the kernel.
- *
- * @return The number of items read.
- */
- int ReadItems();
- /**
- * Saves item data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteItems(std::string file);
- /**
- * Reads the weapon info from the kernel.
- *
- * @return The number of weapons read.
- */
- int ReadWeapons();
- /**
- * Saves weapon data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteWeapons(std::string file);
- /**
- * Reads the armor info from the kernel.
- *
- * @return The number of armor read.
- */
- int ReadArmors();
- /**
- * Saves armor data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteArmors(std::string file);
- /**
- * Reads the accessory info from the kernel.
- *
- * @return The number of accessories read.
- */
- int ReadAccessories();
- /**
- * Saves accessory data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteAccessories(std::string file);
- /**
- * Reads materia info from the kernel.
- *
- * @return The number of accessories read.
- */
- int ReadMateria();
- /**
- * Saves materia data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteMateria(std::string file);
- /**
- * Reads key item info from the kernel.
- *
- * @return The number of key items read.
- */
- int ReadKeyItems();
- /**
- * Saves key item data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteKeyItems(std::string file);
- /**
- * Reads summon name info from the kernel.
- *
- * @return The number of summons read.
- */
- int ReadSummonNames();
- /**
- * Saves summon names data to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteSummonNames(std::string file);
- /**
- * Reads the initial savemap from the kernel.
- */
- void ReadInitialSaveMap();
- /**
- * Saves the initial savemap to an xml file
- *
- * @param file[in] Absolute path to the target XML file.
- */
- void WriteInitialSaveMap(std::string file);
- private:
- enum KERNEL_SECTIONS{
- /**
- * Command data section in KERNEL.BIN.
- */
- KERNEL_COMMAND_DATA = 0,
- /**
- * Attack data section in KERNEL.BIN.
- */
- KERNEL_ATTACK_DATA,
- /**
- * Battle and growth data section in KERNEL.BIN.
- */
- KERNEL_BATTLE_AND_GROWTH_DATA,
- /**
- * Initialization data section in KERNEL.BIN.
- */
- KERNEL_INITIALIZATION_DATA,
- /**
- * Item data section in KERNEL.BIN.
- */
- KERNEL_ITEM_DATA,
- /**
- * Weapon data section in KERNEL.BIN.
- */
- KERNEL_WEAPON_DATA,
- /**
- * Armor data section in KERNEL.BIN.
- */
- KERNEL_ARMOR_DATA,
- /**
- * Accessory data section in KERNEL.BIN.
- */
- KERNEL_ACCESSORY_DATA,
- /**
- * Materia data section in KERNEL.BIN.
- */
- KERNEL_MATERIA_DATA,
- /**
- * Command descriptions section in KERNEL.BIN.
- */
- KERNEL_COMMAND_DESCRIPTIONS,
- /**
- * Magic descriptions section in KERNEL.BIN.
- */
- KERNEL_MAGIC_DESCRIPTIONS,
- /**
- * Item descriptions section in KERNEL.BIN.
- */
- KERNEL_ITEM_DESCRIPTIONS,
- /**
- * Weapon descriptions section in KERNEL.BIN.
- */
- KERNEL_WEAPON_DESCRIPTIONS,
- /**
- * Armor descriptions section in KERNEL.BIN.
- */
- KERNEL_ARMOR_DESCRIPTIONS,
- /**
- * Accessory descriptions section in KERNEL.BIN.
- */
- KERNEL_ACCESSORY_DESCRIPTIONS,
- /**
- * Materia descriptions section in KERNEL.BIN.
- */
- KERNEL_MATERIA_DESCRIPTIONS,
- /**
- * Key Item descriptions section in KERNEL.BIN.
- */
- KERNEL_KEY_ITEM_DESCRIPTIONS,
- /**
- * Command Names section in KERNEL.BIN.
- */
- KERNEL_COMMAND_NAMES,
- /**
- * Magic Names section in KERNEL.BIN.
- */
- KERNEL_MAGIC_NAMES,
- /**
- * Item Names section in KERNEL.BIN.
- */
- KERNEL_ITEM_NAMES,
- /**
- * Weapon Names section in KERNEL.BIN.
- */
- KERNEL_WEAPON_NAMES,
- /**
- * Armor Names section in KERNEL.BIN.
- */
- KERNEL_ARMOR_NAMES,
- /**
- * Accessory Names section in KERNEL.BIN.
- */
- KERNEL_ACCESSORY_NAMES,
- /**
- * Materia Names section in KERNEL.BIN.
- */
- KERNEL_MATERIA_NAMES,
- /**
- * Key Item Names section in KERNEL.BIN.
- */
- KERNEL_KEY_ITEM_NAMES,
- /**
- * Battle and Battle-Screen Text section in KERNEL.BIN.
- */
- KERNEL_BATTLE_AND_BATTLE_SCREEN_TEXT,
- /**
- * Summon Attack Names section in KERNEL.BIN.
- */
- KERNEL_SUMMON_ATTACK_NAMES
- };
- enum ELEMENT{
- /**
- * Fire element.
- */
- FIRE = 0,
- /**
- * Ice element.
- */
- ICE,
- /**
- * Bolt element.
- */
- BOLT,
- /**
- * Earth element.
- */
- EARTH,
- /**
- * Poison element.
- */
- POISON,
- /**
- * Gravity element.
- */
- GRAVITY,
- /**
- * Water element.
- */
- WATER,
- /**
- * Wind element.
- */
- WIND,
- /**
- * Holy element.
- */
- HOLY,
- /**
- * Restorative element.
- */
- RESTORATIVE,
- /**
- * Cut element.
- */
- CUT,
- /**
- * Hit element.
- */
- HIT,
- /**
- * Punch element.
- */
- PUNCH,
- /**
- * Shoot element.
- */
- SHOOT,
- /**
- * Shout element.
- */
- SHOUT,
- /**
- * Hidden element.
- */
- HIDDEN,
- };
- /**
- * List of target selection options.
- */
- struct Target{
- /**
- * The target can be selected.
- *
- * If the target of the attack is selectable, at least between some subset of possible
- * targets, this must be true.
- */
- bool selection_enabled;
- /**
- * The default target is an enemy.
- *
- * When true, the cursor starts in an enemy row. When false, it starts in the ally row.
- * It may or may not be possible to change it.
- */
- bool default_enemy;
- /**
- * The default target is a group.
- *
- * When true, the cursor starts will all the members of a row selected. When false, it
- * starts with only one target selected. It may or may not be possible to change it.
- */
- bool default_multiple;
- /**
- * The selection can change between groups and individuals.
- *
- * When true, the target can be changed between groups and individuals When false,
- * only {@see default_multiple} determines if the target is an individual or a group.
- */
- bool toggle_multiple;
- /**
- * The target group can be changed.
- *
- * When true, the target cannot be changed between enemies and allies. In this case
- * {@see default_enemy} will determine the group that can be targeted.
- */
- bool fixed_row;
- /**
- * The command is short ranged.
- *
- * When true, if the target or the caster is not in the front of their row, the target
- * will take half damage. Also, when true, an enemy covered by another enemy can't be
- * targeted.
- */
- bool short_range;
- /**
- * Targets all, enemies and allies.
- *
- * When true, all allies and enemies are targets, and the selection can't be changed.
- */
- bool all_rows;
- /**
- * The target is random.
- *
- * When multiple targets are selected, one will be selected at random to be the
- * receiving target. Cursor will cycle among all viable targets.
- */
- bool random;
- };
- /**
- * Determines what an item affects on when used from the menu.
- */
- enum RESTORE_TYPE{
- /**
- * The item affects a party member or group HP.
- */
- RESTORE_HP = 0,
- /**
- * The item affects a party member or group MP.
- */
- RESTORE_MP = 1,
- /**
- * The item affects a party member or group status.
- */
- RESTORE_STATUS = 2,
- /**
- * The item is not restorative.
- */
- RESTORE_NONE = 3
- };
- /**
- * List of altered status.
- */
- enum STATUS{
- /**
- * The character is dead.
- */
- DEATH = 0,
- /**
- * The character has critical HP.
- */
- NEAR_DEATH,
- /**
- * The character is asleep.
- */
- SLEEP,
- /**
- * The character is poisoned.
- */
- POISONED,
- /**
- * The character is sad.
- */
- SADNESS,
- /**
- * The character is furious.
- */
- FURY,
- /**
- * The character is confused.
- */
- CONFU,
- /**
- * The character is silenced.
- */
- SILENCE,
- /**
- * The character is slow.
- */
- HASTE,
- /**
- * The character is
- */
- SLOW,
- /**
- * The character is stopped.
- */
- STOP,
- /**
- * The character is a frog.
- */
- FROG,
- /**
- * The character is small.
- */
- SMALL,
- /**
- * The character is going to be petrified.
- */
- SLOW_NUMB,
- /**
- * The character is petrified.
- */
- PETRIFY,
- /**
- * The character is regenerating health.
- */
- REGEN,
- /**
- * The character has a physical barrier.
- */
- BARRIER,
- /**
- * The character has a magical barrier
- */
- M_BARRIER,
- /**
- * The character reflects magical attacks.
- */
- REFLECT,
- /**
- * The character has dual status.
- *
- * @todo What does it do.
- */
- DUAL,
- /**
- * The character has a shield.
- */
- SHIELD,
- /**
- * The character has a death sentence.
- */
- D_SENTENCE,
- /**
- * The character is being manipulated.
- */
- MANIPULATE,
- /**
- * The character is berserk.
- */
- BERSERK,
- /**
- * The character is invincible.
- */
- PEERLESS,
- /**
- * The character is paralyzed.
- */
- PARALYSIS,
- /**
- * The character is blinded.
- */
- DARKNESS,
- /**
- * The character has dual drain.
- */
- DUAL_DRAIN,
- /**
- * The character has deathforce.
- */
- DEATH_FORCE,
- /**
- * The character has resist.
- */
- RESIST,
- /**
- * Cait' Sith lucky girl mode.
- */
- LUCKY_GIRL,
- /**
- * The character is imprisioned.
- */
- IMPRISONED
- };
- /**
- * How a status effect modifier attack or item can act.
- */
- enum STATUS_EFFECT{
- /**
- * Inflicts status changes.
- */
- INFLICT = 0,
- /**
- * Cures status changes.
- */
- CURE = 1,
- /**
- * Toggles status changes.
- *
- * If the target doesn't have the status change, inflict it. If the target already has
- * the status change, cure it.
- */
- TOGGLE = 2
- };
- struct StatusEffect{
- /**
- * The list of status to inflict or cure.
- */
- std::vector<int> status;
- /**
- * The chance of landing a status effect (out of 63).
- */
- u16 chance;
- /**
- * The status change mode.
- */
- STATUS_EFFECT mode;
- };
- /**
- * Data for each command.
- *
- * As found in KERNEL.BIN, file 0, in order, up to camera_multiple. Members after
- * camera_multiple are not found literally in KERNEL.BIN, but are derived from other
- * members or found in other files of the kernel (text files).
- */
- struct CommandData{
- /**
- * Cursor action when the command is selected.
- */
- u8 cursor_action;
- /**
- * Targeting mode. 1 byte.
- *
- * See {@see target} and {@TargetModes} for more information.
- */
- u8 target_raw;
- /**
- * Unknown data (Always 0XFFFF). 2 bytes.
- */
- u16 unknown;
- /**
- * Camera movement ID for single target. 2 bytes.
- *
- * Determines the camera movement when the command is executed over a single target.
- */
- u16 camera_single;
- /**
- * Camera movement ID for multiple target. 2 bytes.
- *
- * Determines the camera movement when the command is executed over multiple targets.
- */
- u16 camera_multiple;
- /**
- * Command ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Command name.
- *
- * Not found in the same file as the rest of the data, but on file 17.
- */
- std::string name;
- /**
- * Command description.
- *
- * Not found in the same file as the rest of the data, but on file 9.
- */
- std::string description;
- /**
- * Target selection mode.
- *
- * Derived from {@see target_raw}.
- */
- Target target;
- };
- /**
- * Data for each attack.
- *
- * As found in KERNEL.BIN, file 1, in order, up to camera_multiple. Members after
- * special_raw are not found literally in KERNEL.BIN, but are derived from other
- * members.
- */
- struct AttackData{
- /**
- * Probability of the attack to land. 1 byte.
- */
- u8 accuracy;
- /**
- * Impact effect. 1 byte.
- *
- * The sprite shown when the attack hits.
- */
- u8 impact_effect;
- /**
- * Index of the animation played by the target when hit. 1 byte.
- */
- u8 hurt_anim;
- /**
- * Unknown data. 1 bytes.
- */
- u8 unknown;
- /**
- * MP cost. 2 bytes.
- *
- * Determines the camera movement when the command is executed over a single target.
- */
- u16 mp;
- /**
- * Impact sound. 2 bytes.
- *
- * Determines the camera movement when the command is executed over multiple targets.
- */
- u16 sound;
- /**
- * Camera movement ID for single target. 2 bytes.
- *
- * Determines the camera movement when the command is executed over a single target.
- */
- u16 camera_single;
- /**
- * Camera movement ID for multiple target. 2 bytes.
- *
- * Determines the camera movement when the command is executed over multiple targets.
- */
- u16 camera_multiple;
- /**
- * Targeting mode. 1 byte.
- *
- * See {@see target} and {@TargetModes} for more information.
- */
- u8 target_raw;
- /**
- * Atack effect ID. 1 byte.
- *
- * Used for animation in battle.
- */
- u8 effect;
- /**
- * Damage formula. 1 byte.
- *
- * This byte is divided into two nybbles (four bits). Upper nybble determines what
- * considerations are made in calculating damage such as physical/magical, allowing
- * criticals, how to calculate accuracy, etc. There are also three sets of known
- * formulae that are paired with the upper nybble values. These are selected in the
- * Lower Nybble and determine how to calculate pre-defense damage
- */
- u8 damage_raw;
- /**
- * The attack power. 1 byte.
- *
- * Used for damage/healing calculation.
- */
- u8 power;
- /**
- * The restore type.
- *
- * See {@restore_typ} and {@RESTORE_TYPE} for more information.
- */
- u8 condition_raw;
- /**
- * Information about status change mode and chance. 1 bytes.
- */
- u8 status_change_raw;
- /**
- * Special flags. 1 byte.
- *
- * @todo Document and retrieve with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Battle/Attack_Special_Effects
- */
- u8 additional_effects_raw;
- /**
- * Special flags. 1 byte.
- *
- * @todo Document and retrieve with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Item_data
- */
- u8 additional_effects_mod_raw;
- /**
- * Information about what status can be inflicted or cured. 4 bytes.
- *
- * The first six bits are the chance of inflicting/curing (out of 63). If the seventh
- * bit is set, the status is cured instead of inflicted. If the eighth bit is set, then
- * the status is toggled (cured if present, inflicted if not present).
- */
- u32 status_raw;
- /**
- * Information about the item elements. 2 bytes.
- */
- u16 element_raw;
- /**
- * Special flags. 2 bytes.
- *
- * @todo document and parse with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Battle/Special_Attack_Flags
- */
- u16 special_raw;
- /**
- * Attack ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Target selection mode.
- *
- * Derived from {@see target_raw}.
- */
- Target target;
- /**
- * The damage formula.
- *
- * It's the upper nybble in {@see damage_raw}.
- */
- u8 damage_formula;
- /**
- * The damage modifier.
- *
- * It's the lower nybble in {@see damage_raw}.
- */
- u8 damage_modifier;
- /**
- * What the attack restores when used.
- *
- * Same as {@see condition_raw}, except for the wrong cases.
- */
- RESTORE_TYPE restore_type;
- /**
- * Status effects.
- *
- * Derived from {@see status_change_raw} and {@see status_raw}.
- */
- StatusEffect status;
- /**
- * Elements of the attack.
- *
- * Derived from {@see element_raw}.
- */
- std::vector<int> elements;
- };
- /**
- * Data for each items
- *
- * As found in KERNEL.BIN, file 4, in order, up to special. Members after special are not
- * found literally in KERNEL.BIN, but are derived from other members or found in other
- * files of the kernel (text files).
- */
- struct ItemData{
- /**
- * Unknown data (Always 0XFFFF). 4 bytes.
- */
- u32 unknown_0;
- /**
- * Unknown data (Always 0XFFFF). 4 bytes.
- */
- u32 unknown_1;
- /**
- * Camera movement ID. 2 bytes.
- *
- * Used for items useable in battle, determines the camera movement.
- */
- u16 camera;
- /**
- * Item restrictions. 2 bytes.
- *
- * Contains bits indicating if the item is {@see selleable}, {@see useable_battle} and
- * {@see useable_menu}.
- */
- u16 restrict_raw;
- /**
- * Targeting mode. 1 byte.
- *
- * See {@see target} and {@TargetModes} for more information.
- */
- u8 target_raw;
- /**
- * Item effect ID. 1 byte.
- *
- * Used for animation in battle.
- */
- u8 effect;
- /**
- * Damage formula. 1 byte.
- *
- * This byte is divided into two nybbles (four bits). Upper nybble determines what
- * considerations are made in calculating damage such as physical/magical, allowing
- * criticals, how to calculate accuracy, etc. There are also three sets of known
- * formulae that are paired with the upper nybble values. These are selected in the
- * Lower Nybble and determine how to calculate pre-defense damage
- */
- u8 damage_raw;
- /**
- * The item power. 1 byte.
- *
- * Used for damage/healing calculation.
- */
- u8 power;
- /**
- * The restore type.
- *
- * See {@restore_typ} and {@RESTORE_TYPE} for more information.
- */
- u8 condition_raw;
- /**
- * Information about status change mode and chance. 1 bytes.
- */
- u8 status_change_raw;
- /**
- * Special flags. 1 byte.
- *
- * @todo Document and retrieve with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Battle/Attack_Special_Effects
- */
- u8 additional_effects_raw;
- /**
- * Special flags. 1 byte.
- *
- * @todo Document and retrieve with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Item_data
- */
- u8 additional_effects_mod_raw;
- /**
- * Information about what status can be inflicted or cured. 4 bytes.
- *
- * The first six bits are the chance of inflicting/curing (out of 63). If the seventh
- * bit is set, the status is cured instead of inflicted. If the eighth bit is set, then
- * the status is toggled (cured if present, inflicted if not present).
- */
- u32 status_raw;
- /**
- * Information about the item elements. 2 bytes.
- */
- u16 element_raw;
- /**
- * Special flags. 2 bytes.
- *
- * @todo document and parse with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Battle/Special_Attack_Flags
- */
- u16 special_raw;
- /**
- * Item ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Item name.
- *
- * Not found in the same file as the rest of the data, but on file 19.
- */
- std::string name;
- /**
- * Item description.
- *
- * Not found in the same file as the rest of the data, but on file 11.
- */
- std::string description;
- /**
- * Indicates if the item can be sold.
- *
- * True if the bit 0 in {@see restrict_raw} is 0.
- */
- bool sellable;
- /**
- * Indicates if the item can be used in battle.
- *
- * True if the bit 2 in {@see restrict_raw} is 0.
- */
- bool useable_battle;
- /**
- * Indicates if the item can be used in the menu.
- *
- * True if the bit 4 in {@see restrict_raw} is 0.
- */
- bool useable_menu;
- /**
- * Target selection mode.
- *
- * Derived from {@see target_raw}.
- */
- Target target;
- /**
- * The damage formula.
- *
- * It's the upper nybble in {@see damage_raw}.
- */
- u8 damage_formula;
- /**
- * The damage modifier.
- *
- * It's the lower nybble in {@see damage_raw}.
- */
- u8 damage_modifier;
- /**
- * What the item restores when used.
- *
- * Same as {@see condition_raw}, except for the wrong cases.
- */
- RESTORE_TYPE restore_type;
- /**
- * Status effects.
- *
- * Derived from {@see status_change_raw} and {@see status_raw}.
- */
- StatusEffect status;
- /**
- * Elements of the item.
- *
- * Derived from {@see element_raw}.
- */
- std::vector<int> elements;
- };
- /**
- * Materia slot types.
- */
- enum SLOT_TYPE{
- /**
- * A non linked slot.
- */
- SLOT_UNLINKED = 0,
- /**
- * 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.
- */
- SLOT_LINKED = 1
- };
- /**
- * Bonus in stat givven by weapons or armor.
- */
- struct StatBonus{
- /**
- * ID of the raised stat.
- */
- u8 stat;
- /**
- * Stat value raise.
- */
- u8 bonus;
- };
- /**
- * Data for each weapon
- *
- * As found in KERNEL.BIN, file 5, in order, up to special. Members after special are not
- * found literally in KERNEL.BIN, but are derived from other members or found in other
- * files of the kernel (text files).
- */
- struct WeaponData{
- /**
- * Targeting mode. 1 byte.
- *
- * See {@see target} and {@TargetModes} for more information.
- */
- u8 target_raw;
- /**
- * Effect ID, unused (Always 0XFF). 1 byte.
- */
- u8 unused_0;
- /**
- * Damage formula. 1 byte.
- *
- * This byte is divided into two nybbles (four bits). Upper nybble determines what
- * considerations are made in calculating damage such as physical/magical, allowing
- * criticals, how to calculate accuracy, etc. There are also three sets of known
- * formulae that are paired with the upper nybble values. These are selected in the
- * Lower Nybble and determine how to calculate pre-defense damage
- */
- u8 damage_raw;
- /**
- * Unused data (Always 0XFF). 1 byte.
- */
- u8 unused_1;
- /**
- * The weapon power. 1 byte.
- *
- * Used for damage calculation.
- */
- u8 power;
- /**
- * The status effect the weapon induces. 1 byte.
- */
- u8 status;
- /**
- * Weapon materia growth multiplier. 1 byte.
- */
- u8 growth;
- /**
- * Weapon critical chance. 1 byte.
- */
- u8 critical;
- /**
- * Weapon accuracy. 1 byte.
- */
- u8 accuracy;
- /**
- * Weapon battle model. 1 byte.
- *
- * This byte is divided into two nybbles (four bits). Upper nybble determines the
- * attack animation modifier, and it's only used for Barret and Vincent. The lower
- * nybble is actually the index of the weapon model.
- */
- u8 model_raw;
- /**
- * Unused data (Always 0XFF). 1 byte.
- */
- u8 unused_2;
- /**
- * Consider it unused.
- *
- * @todo Verify.
- */
- u8 high_sound;
- /**
- * Camera movement ID. 2 bytes.
- *
- * Used for both single and multiple targeted attacks with this weapon. Always 0xFFFF.
- */
- u16 camera;
- /**
- * Characters that can equip the weapon. 2 bytes.
- *
- * Contains bits indicating the characters that can equip the weapon {@see character}
- * for more info.
- */
- u16 equip_raw;
- /**
- * Weapon element ids.
- */
- u16 element_raw;
- /**
- * Unused data (Always 0XFFFF). 1 byte.
- */
- u8 unused_3;
- /**
- * Stat the weapon raises.
- *
- * {@see stat_bonus} for more info.
- */
- u8 stat_raw[4];
- /**
- * The amount the raised stats are raised by.
- *
- * {@see stat_bonus} for more info.
- */
- u8 stat_bonus_raw[4];
- /**
- * Materia slots.
- *
- * {@see slots} for more info.
- */
- u8 slots_raw[8];
- /**
- * Sound effect id for normal hit.
- */
- u8 sound;
- /**
- * Sound effect id for critical hit.
- */
- u8 sound_critical;
- /**
- * Sound effect id for miss hit.
- */
- u8 sound_miss;
- /**
- * Impcat effect ID. 1 byte.
- *
- * Used for animation in battle.
- */
- u8 effect;
- /**
- * Special flags. 2 bytes.
- *
- * @todo document and parse with info from
- * https://wiki.ffrtt.ru/index.php?title=FF7/Battle/Special_Attack_Flags
- */
- u16 special_raw;
- /**
- * Weapon restrictions. 2 bytes.
- *
- * Contains bits indicating if the item is {@see selleable}, {@see useable_battle} and
- * {@see useable_menu}and {@see throwable}.
- */
- u16 restrict_raw;
- /**
- * Weapon ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Weapon name.
- *
- * Not found in the same file as the rest of the data, but on file 20.
- */
- std::string name;
- /**
- * Weapon description.
- *
- * Not found in the same file as the rest of the data, but on file 12.
- */
- std::string description;
- /**
- * Indicates if the weapon can be sold.
- *
- * True if the bit 0 in {@see restrict_raw} is 0.
- */
- bool sellable;
- /**
- * Indicates if the weapon can be used in battle.
- *
- * True if the bit 2 in {@see restrict_raw} is 0.
- */
- bool useable_battle;
- /**
- * Indicates if the weapon can be used in the menu.
- *
- * True if the bit 4 in {@see restrict_raw} is 0.
- */
- bool useable_menu;
- /**
- * Indicates if the weapon can be sold.
- *
- * True if the bit 8 in {@see restrict_raw} is 0.
- */
- bool throwable;
- /**
- * Target selection mode.
- *
- * Derived from {@see target_raw}.
- */
- Target target;
- /**
- * The damage formula.
- *
- * It's the upper nybble in {@see damage_raw}.
- */
- u8 damage_formula;
- /**
- * The damage modifier.
- *
- * It's the lower nybble in {@see damage_raw}.
- */
- u8 damage_modifier;
- /**
- * Attack animation ID.
- *
- * It's the upper nybble in {@see model_raw}. It's only used for Barret and Vincent.
- */
- u8 animation_index;
- /**
- * Weapon model ID.
- *
- * It's the lower nybble in {@see model_raw}.
- */
- u8 model;
- /**
- * The weapon battle model index.
- *
- * It's the lower nybble in {@see model_raw}.
- */
- std::vector<u8> equip;
- /**
- * Bonus in stats.
- *
- * Derived from {@see stat_raw} and {@stat_bonus_raw}.
- */
- std::vector<StatBonus> stat_bonus;
- /**
- * Materia slots.
- *
- * Derived and simplified from {@see slots_raw}.
- */
- std::vector<u8> materia_slots;
- /**
- * Elements of the weapon.
- *
- * Derived from {@see element_raw}.
- */
- std::vector<int> elements;
- };
- /**
- * Data for each armor
- *
- * As found in KERNEL.BIN, file 6, in order, up to unknown_3. Members after unknown_3 are
- * not found literally in KERNEL.BIN, but are derived from other members or found in other
- * files of the kernel (text files).
- */
- struct ArmorData{
- /**
- * Unknown (Always 0XFF). 1 byte.
- */
- u8 unknown_0;
- /**
- * Elemental resistance mode. 1 byte.
- *
- * For all elements in {@see element_raw}:
- * If 0: Absorbs.
- * If 1: Nullifies.
- * If 2: Halves.
- * If any other value: normal.
- */
- u8 element_defense_mode;
- /**
- * Defense stat. 1 byte.
- */
- u8 defense;
- /**
- * Magic defense stat. 1 byte.
- */
- u8 m_defense;
- /**
- * Evasion stat. 1 byte.
- */
- u8 evasion;
- /**
- * Magic evasion stat. 1 byte.
- */
- u8 m_evasion;
- /**
- * The status effect the armor protects against. 1 byte.
- */
- u8 status;
- /**
- * Unknown (Always 0XFFFF). 1 byte.
- */
- u16 unknown_1;
- /**
- * Materia slots.
- *
- * {@see slots} for more info.
- */
- u8 slots_raw[8];
- /**
- * Armor materia growth multiplier. 1 byte.
- */
- u8 growth;
- /**
- * Characters that can equip the armor. 2 bytes.
- *
- * Contains bits indicating the characters that can equip the armor {@see character}
- * for more info.
- */
- u16 equip_raw;
- /**
- * Elements the armor protects agains.
- */
- u16 element_raw;
- /**
- * Unknown (Always 0XFF). 1 byte.
- */
- u16 unknown_2;
- /**
- * Stat the weapon raises.
- *
- * {@see stat_bonus} for more info.
- */
- u8 stat_raw[4];
- /**
- * The amount the raised stats are raised by.
- *
- * {@see stat_bonus} for more info.
- */
- u8 stat_bonus_raw[4];
- /**
- * Weapon restrictions. 2 bytes.
- *
- * Contains bits indicating if the item is {@see selleable}, {@see useable_battle} and
- * {@see useable_menu}and {@see throwable}.
- */
- u16 restrict_raw;
- /**
- * Unknown (Always 0XFFFF). 1 byte.
- */
- u16 unknown_3;
- /**
- * Armor ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Armor name.
- *
- * Not found in the same file as the rest of the data, but on file 20.
- */
- std::string name;
- /**
- * Armor description.
- *
- * Not found in the same file as the rest of the data, but on file 12.
- */
- std::string description;
- /**
- * Indicates if the armor can be sold.
- *
- * True if the bit 0 in {@see restrict_raw} is 0.
- */
- bool sellable;
- /**
- * Indicates if the armor can be used in battle.
- *
- * True if the bit 2 in {@see restrict_raw} is 0.
- */
- bool useable_battle;
- /**
- * Indicates if the armor can be used in the menu.
- *
- * True if the bit 4 in {@see restrict_raw} is 0.
- */
- bool useable_menu;
- /**
- * The weapon battle model index.
- *
- * It's the lower nybble in {@see model_raw}.
- */
- std::vector<u8> equip;
- /**
- * Bonus in stats.
- *
- * Derived from {@see stat_raw} and {@stat_bonus_raw}.
- */
- std::vector<StatBonus> stat_bonus;
- /**
- * Materia slots.
- *
- * Derived and simplified from {@see slots_raw}.
- */
- std::vector<u8> materia_slots;
- /**
- * Elements of the weapon.
- *
- * Derived from {@see element_raw}.
- */
- std::vector<int> elements;
- };
- /**
- * Data for each accessory
- *
- * As found in KERNEL.BIN, file 7, in order, up to unknown_3. Members after unknown_3 are
- * not found literally in KERNEL.BIN, but are derived from other members or found in other
- * files of the kernel (text files).
- */
- struct AccessoryData{
- /**
- * Stat the weapon raises.
- *
- * {@see stat_bonus} for more info.
- */
- u8 stat_raw[2];
- /**
- * The amount the raised stats are raised by.
- *
- * {@see stat_bonus} for more info.
- */
- u8 stat_bonus_raw[2];
- /**
- * Elemental resistance mode. 1 byte.
- *
- * For all elements in {@see element_raw}:
- * If 0: Absorbs.
- * If 1: Nullifies.
- * If 2: Halves.
- * If any other value: normal.
- */
- u8 element_defense_mode;
- /**
- * The special status effect the accesory induces.
- *
- * 0: Auto haste.
- * 1: Auto berserk.
- * 2: Curse.
- * 3: Auto reflect.
- * 4: Steal rate +.
- * 5: Manipulate rate +.
- * 6: Barrier + MBarrier.
- * Other: Nothing.
- */
- u8 effect;
- /**
- * Elements the armor protects against. 2 bytes.
- *
- * The defense type is defined in {@see element_defense_mode}.
- */
- u16 element_raw;
- /**
- * The status effect the armor protects against. 4 bytes.
- */
- u32 status_raw;
- /**
- * Characters that can equip the armor. 2 bytes.
- *
- * Contains bits indicating the characters that can equip the armor {@see character}
- * for more info.
- */
- u16 equip_raw;
- /**
- * Weapon restrictions. 2 bytes.
- *
- * Contains bits indicating if the item is {@see selleable}, {@see useable_battle} and
- * {@see useable_menu}and {@see throwable}.
- */
- u16 restrict_raw;
- /**
- * Accessory ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Accessory name.
- *
- * Not found in the same file as the rest of the data, but on file 20.
- */
- std::string name;
- /**
- * Accessory description.
- *
- * Not found in the same file as the rest of the data, but on file 12.
- */
- std::string description;
- /**
- * Indicates if the accessory can be sold.
- *
- * True if the bit 0 in {@see restrict_raw} is 0.
- */
- bool sellable;
- /**
- * Indicates if the accessory can be used in battle.
- *
- * True if the bit 2 in {@see restrict_raw} is 0.
- */
- bool useable_battle;
- /**
- * Indicates if the accessory can be used in the menu.
- *
- * True if the bit 4 in {@see restrict_raw} is 0.
- */
- bool useable_menu;
- /**
- * The weapon battle model index.
- *
- * It's the lower nybble in {@see model_raw}.
- */
- std::vector<u8> equip;
- /**
- * Bonus in stats.
- *
- * Derived from {@see stat_raw} and {@stat_bonus_raw}.
- */
- std::vector<StatBonus> stat_bonus;
- /**
- * Elements of the accesory.
- *
- * Derived from {@see element_raw}.
- */
- std::vector<int> elements;
- /**
- * Statuses the accessory protects against.
- *
- * Derived from {@see status_raw}.
- */
- std::vector<int> status;
- };
- /**
- * Types of materia.
- */
- enum class MATERIA_TYPE{
- /**
- * Magic materia.
- */
- MAGIC = 1,
- /**
- * Support materia.
- */
- SUPPORT,
- /**
- * Command materia.
- */
- COMMAND,
- /**
- * Independent materia.
- */
- INDEPENDENT,
- /**
- * Summon materia.
- */
- SUMMON
- };
- /**
- * Stat bonuses given by equipping materia.
- *
- * They can be negative.
- */
- struct MateriaStatBonus{
- /**
- * Strength bonus. Absolute.
- */
- int str;
- /**
- * Vitality bonus. Absolute.
- */
- int vit;
- /**
- * Magic bonus. Absolute.
- */
- int mag;
- /**
- * Spirit bonus. Absolute.
- */
- int spr;
- /**
- * Dexterity bonus. Absolute.
- */
- int dex;
- /**
- * Luck bonus. Absolute.
- */
- int lck;
- /**
- * Max HP bonus. Percentile.
- */
- int hp;
- /**
- * Max MP bonus. Percentile.
- */
- int mp;
- /**
- * Indicates if at least one of the stats is changed by the materia.
- */
- bool change;
- };
- /**
- * Data for each materia.
- *
- * As found in KERNEL.BIN, file 8, in order, up to attributes. Members after attributes are
- * not found literally in KERNEL.BIN, but are derived from other members or found in other
- * files of the kernel (text files).
- */
- struct MateriaData{
- /**
- * AP amounts at which the materia levels up. 4 x 1 byte.
- *
- * It can be used to determine how many levels the materia has.
- */
- u16 level_up_ap[4];
- /**
- * Index of stat modifier. 1 byte.
- */
- u8 stat_raw;
- /**
- * Status effects. 3 bytes, not 4!
- */
- u32 status_raw;
- /**
- * Materia element. 1 byte.
- */
- u8 element;
- /**
- * Materia type. 1 byte.
- *
- * 2 nybbles. The upper one is the subtype, and it's ignored in V-Gears. The lower one
- * the actual type.
- */
- u8 type_raw;
- /**
- * Materia attributes. 6 x 1 byte.
- *
- * They are mostly ignored in V-Gears.
- */
- u8 attribute[6];
- /**
- * Accessory ID.
- *
- * Not actually in the item file data, it's the order at which it appears.
- */
- int id;
- /**
- * Accessory name.
- *
- * Not found in the same file as the rest of the data, but on file 20.
- */
- std::string name;
- /**
- * Accessory description.
- *
- * Not found in the same file as the rest of the data, but on file 12.
- */
- std::string description;
- /**
- * Mateira type.
- *
- * Derived from {@see type_raw}.
- */
- int type;
- /**
- * Stat bonuses for equipping the materia.
- *
- * Derived from {@see stat_raw}.
- */
- MateriaStatBonus stats;
- /**
- * Statuses the materia inflicts.
- *
- * Derived from {@see status_raw}.
- */
- std::vector<int> status;
- };
- /**
- * Data for each key item.
- *
- * There is no data file about key items in KERNEL.BIN, there are only names (file 24) and
- * descriptions (file 16)
- */
- struct KeyItemData{
- /**
- * Key item ID.
- *
- * Not actually in KERNEL.BIN, it;s the order at which they appear.
- */
- int id;
- /**
- * Key item name.
- */
- std::string name;
- /**
- * Key item description.
- */
- std::string description;
- };
- /**
- * List of summon names.
- *
- * There is no data file about key items in KERNEL.BIN, there are only names (file 26).
- */
- struct SummonNameData{
- /**
- * Summon ID.
- *
- * Not actually in KERNEL.BIN, it;s the order at which they appear.
- */
- int id;
- /**
- * Summon name.
- */
- std::string name;
- };
- /**
- * Character data.
- *
- * Contains information about a character. Contained in the file 3 of the kernel, one
- * entry for each character. Each section is 56 bytes long. The character ID is not
- * actually in the data, but it's the order at which they appear. The character name is
- * also not in the dataand it must be filled manually.
- */
- struct CharacterData{
- /**
- * Strength stat growth curve. 1 byte.
- */
- u8 curve_str;
- /**
- * Vitality stat growth curve. 1 byte.
- */
- u8 curve_vit;
- /**
- * Magic stat growth curve. 1 byte.
- */
- u8 curve_mag;
- /**
- * Spirit stat growth curve. 1 byte.
- */
- u8 curve_spr;
- /**
- * Dexterity stat growth curve. 1 byte.
- */
- u8 curve_dex;
- /**
- * Luck stat growth curve. 1 byte.
- */
- u8 curve_lck;
- /**
- * HP stat growth curve. 1 byte.
- */
- u8 curve_hp;
- /**
- * MP stat growth curve. 1 byte.
- */
- u8 curve_mp;
- /**
- * Experience-for-next-level growth curve. 1 byte.
- */
- u8 curve_exp;
- /**
- * Ignored data. 1 byte.
- */
- u8 unused_0;
- /**
- * Starting level. 1 byte.
- */
- u8 initial_level;
- /**
- * Ignored data. 1 byte.
- */
- u8 unused_1;
- /**
- * 1-1 limit slot command. 1 byte.
- */
- u8 limit_1_1;
- /**
- * 1-2 limit slot command. 1 byte.
- */
- u8 limit_1_2;
- /**
- * 1-3 limit slot command. 1 byte, unused.
- */
- u8 limit_1_3;
- /**
- * 2-1 limit slot command. 1 byte.
- */
- u8 limit_2_1;
- /**
- * 2-2 limit slot command. 1 byte.
- */
- u8 limit_2_2;
- /**
- * 2-3 limit slot command. 1 byte, unused.
- */
- u8 limit_2_3;
- /**
- * 3-1 limit slot command. 1 byte.
- */
- u8 limit_3_1;
- /**
- * 3-2 limit slot command. 1 byte.
- */
- u8 limit_3_2;
- /**
- * 3-3 limit slot command. 1 byte, unused.
- */
- u8 limit_3_3;
- /**
- * 4-1 limit slot command. 1 byte.
- */
- u8 limit_4_1;
- /**
- * 4-2 limit slot command. 1 byte, unused.
- */
- u8 limit_4_2;
- /**
- * 4-3 limit slot command. 1 byte, unused.
- */
- u8 limit_4_3;
- /**
- * Kills required to unlock limit level 2. 2 bytes.
- */
- u16 limit_2_kills;
- /**
- * Kills required to unlock limit level 3. 2 bytes.
- */
- u16 limit_3_kills;
- /**
- * Kills required to unlock limit 1-2. 2 bytes.
- */
- u16 limit_1_2_uses;
- /**
- * Kills required to unlock limit 1-3. 2 bytes, unused.
- */
- u16 limit_1_3_uses;
- /**
- * Kills required to unlock limit 2-2. 2 bytes.
- */
- u16 limit_2_2_uses;
- /**
- * Kills required to unlock limit 2-3. 2 bytes, unused.
- */
- u16 limit_2_3_uses;
- /**
- * Kills required to unlock limit 3-2. 2 bytes.
- */
- u16 limit_3_2_uses;
- /**
- * Kills required to unlock limit 3-3. 2 bytes, unused.
- */
- u16 limit_3_3_uses;
- /**
- * HP divisor for limit level 1.
- */
- u32 limit_1_div;
- /**
- * HP divisor for limit level 2.
- */
- u32 limit_2_div;
- /**
- * HP divisor for limit level 3.
- */
- u32 limit_3_div;
- /**
- * HP divisor for limit level 4.
- */
- u32 limit_4_div;
- /**
- * Character ID.
- */
- int id;
- /**
- * Character default name.
- */
- std::string name;
- };
- /**
- * Types of stat curves.
- *
- * Althought any of them can be used for any stat, this is their intended use.
- */
- enum STAT_CURVE_TYPE{
- /**
- * Normal curve, used for primary stat.
- */
- CURVE_PRIMARY = 0,
- /**
- * HP curve. Base values must be multiplied by 40 when calculating.
- */
- CURVE_HP,
- /**
- * MP curve. Base values must be multiplied by 2 when calculating.
- */
- CURVE_MP,
- /**
- * Experience curve. Base must be ignored when calculating. Gradient is quadratic.
- */
- CURVE_EXP
- };
- /**
- * Stat curve.
- *
- * determines value growth
- */
- struct StatCurve{
- /**
- * Curve ID.
- */
- int id;
- /**
- * Type of curve.
- */
- STAT_CURVE_TYPE type;
- /**
- * Curve gradients.
- */
- u8 gradient[8];
- /**
- * Curve bases.
- */
- u8 base[8];
- };
- /**
- * Battle data.
- *
- * Contains several pieces of data related to character growth. Contained in the file 3 of
- * the kernel, after the character data (starts at offset 0x01F8). The kernel contains more
- * data, but it's not needed for V-Gears (random table, scene lookup...)
- */
- struct GrowthData{
- /**
- * Random bonus to primary stats, 12 entries of 1 byte.
- */
- u8 bonus_stat[12];
- /**
- * Random bonus to HP stat, 12 entries of 1 byte.
- */
- u8 bonus_hp[12];
- /**
- * Random bonus to MP stat, 12 entries of 1 byte.
- */
- u8 bonus_mp[12];
- /**
- * Stat curves. 64 curves of 16 bit each.
- *
- * 37 for primary stats, 9 for HP, 9 form MP, 9 for experience.
- */
- StatCurve curves[64];
- };
- /**
- * Items read from the kernel.
- */
- std::vector<CommandData> commands_;
- /**
- * Attacks read from the kernel.
- */
- std::vector<AttackData> attacks_;
- /**
- * Character info read from the kernel.
- */
- std::vector<CharacterData> characters_;
- GrowthData growth_;
- /**
- * Items read from the kernel.
- */
- std::vector<ItemData> items_;
- /**
- * Weapons read from the kernel.
- */
- std::vector<WeaponData> weapons_;
- /**
- * Armors read from the kernel.
- */
- std::vector<ArmorData> armors_;
- /**
- * Accessories read from the kernel.
- */
- std::vector<AccessoryData> accessories_;
- /**
- * Materia read from the kernel.
- */
- std::vector<MateriaData> materia_;
- /**
- * Key items read from the kernel.
- */
- std::vector<KeyItemData> key_items_;
- /**
- * Summon names read from the kernel.
- */
- std::vector<SummonNameData> summon_names_;
- SaveMap savemap_;
- /**
- * The kernel file.
- */
- BinGZipFile kernel_;
- /**
- * 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.
- */
- u32 prices_[416];
- };
|