FE8U Unit-Status Rework
Download Here
updated 2022.05.25: fixed on MSG function to adapt to SkillSystem_FE8, add a new mss_def.s
in folder /external
for ModularStatScreen. Thanks for @Mikey_Seregon 's testing.
FE8U Unit-Status Rework
In vanilla, unit status (buff & debuffs) use a u8 byte at Unit Struct +0x30
, 4 bits for status-index, 4 bits for status-duration. As a result, unit can only hold no more than 15 status, since there have been 13 status used in vanilla, hackers can only make 2 more status in vanilla routine.
Previously, SME tried to modify this by expanding the status index to 5 bits, but failed to handle the skill duration decreasing at the beginning of the turn. In this hack, I have expanded unit status index to 6 bits, which can support up to 63 different states simultaneously. Meanwhile, through a series of modifications, we successfully used the remaining 2 bits to make the status last for up to 4 turns.
At the same time, a table is build to store status informations, such as, how unitâs atk decrese during suffering this status or how long will this status continue, etc.
In addition, it provides adaptations for currently common patches, such as MSG and ModExpSave.
How to Use it
Directly include âUnitStatus.eventâ, then you will get this patch installed. As examples, I have makde some status as templetes, include âavoidâ(unit grants avoid rate +15% in one turn), âGravityâ(unit cannot move in one turn), âExpose Defâ(unit Def -5 in one turn), etc. All of these status is defined in Templates/UnitStatusDef.h
, you can directly use function void SetUnitStatus(struct Unit* unit, int statusId)
to give units status.
Meanwhile, you need to put functions defined in External
folder to support patchs, including:
-
Modular Status Getter
: âPowGetter_UnitStatusâ to power-getter loop, âMagGetter_UnitStatusâ to magic-getter loop ⌠-
Expanded Modular Save
: âMSu_SaveUnitStatusâ and âMSu_LoadUnitStatusâ to save-suspand table, which needs 0x89 bytes to store data. -
Pre-Battle Calc
: âBC_UnitStatusâ to Pre-Battle Calc loop. -
Modular Stat Screen
: use the fixedmss_def.s
inside folder/external
How to make your own status
Please refer to Templates
folder:
-
Add your status declearation to
UnitStatusDef.h
andUnitStatusDef.event
-
Create a new folder for your own.
-
Inside which, make the status info(
struct UnitStatusInfo
), on refer toinclude/unit-status.h
Note
-
in
struct UnitStatusInfo
, each status hold two attributes, âis_debuffâ and âis_buffâ, if you defined the status as.is_debuff = 1
, then this status duration will decrease at enimyâs turn, otherwise decrease in its own turn. -
âgbafe.hâ which is included inside c files is used as FE-CLib-Mokha