Refactor and cleanup for TT_002 (#1904)

This is mostly just the low hanging fruit that I kind of already had a
good handle on. The rest of the refactoring is going to take a little
more digging in and probably some running the game in a debugger to
figure out what's going on.

I think the update for D8 and D9 are for the "hidden path" mode where
the Faerie tells you to try to destroy a wall. DA,DB, and DC i think are
actually yousi code for performing the "song". But I'm not sure on any
of that.

DD and DF are for the sub entities created when using an Item. I think
they should use a different extension, but still need to dig into that
more.
This commit is contained in:
H.M. Burger 2024-11-15 13:37:13 -06:00 committed by GitHub
parent 17aa8803e7
commit 2503ab71fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 305 additions and 282 deletions

View File

@ -607,7 +607,7 @@ typedef struct {
// There appears to be a 2nd Ext used in the Faerie code
typedef struct {
/* 0x7C */ struct Entity* unk7C;
/* 0x7C */ struct Entity* parent;
} ET_FaerieUnk0;
typedef struct {
@ -617,19 +617,19 @@ typedef struct {
} FaerieUnkA4;
typedef struct {
/* 0x7C */ s16 unk7c;
/* 0x7E */ s16 unk7E;
/* 0x7C */ s16 subEntityDdTimer;
/* 0x7E */ s16 isAbilityInitialized;
/* 0x80 */ s16 unk80;
/* 0x82 */ s16 unk82;
/* 0x84 */ s16 randomMovementAngle;
/* 0x86 */ s16 targetAngle;
/* 0x88 */ s16 unk88;
/* 0x88 */ s16 defaultDistToTargetLoc;
/* 0x8A */ s16 maxAngle;
/* 0x8C */ s16 frameCounter;
/* 0x8E */ s16 unk8E;
/* 0x90 */ s16 unk90;
/* 0x92 */ s16 unk92;
/* 0x94 */ s16 unk94;
/* 0x90 */ s16 requireUncurseLuckCheck;
/* 0x92 */ s16 requireAntivenomLuckCheck;
/* 0x94 */ s16 requirePotionLuckCheck;
/* 0x96 */ s16 timer;
/* 0x98 */ s32 left;
/* 0x9C */ s32 top;

View File

@ -299,7 +299,7 @@ typedef enum {
PLAYER_STATUS_CURSE = 0x8000,
PLAYER_STATUS_UNK10000 = 0x10000, // possibly freezing?
PLAYER_STATUS_UNK20000 = 0x20000,
PLAYER_STATUS_UNK40000 = 0x40000,
PLAYER_STATUS_UNK40000 = 0x40000, // possibly zero hp/dead
PLAYER_STATUS_UNK80000 = 0x80000,
PLAYER_STATUS_UNK100000 = 0x100000,
PLAYER_STATUS_UNK200000 = 0x200000,

View File

@ -1,4 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#ifndef SERVANT_PRIVATE_H
#define SERVANT_PRIVATE_H
#include <servant.h>
#ifndef VERSION_PSP
@ -28,3 +30,5 @@ STATIC u32 ServantUpdateAnim(
Entity* self, s8* frameProps, AnimationFrame** frames);
STATIC void SetEntityAnimation(Entity* entity, AnimationFrame* anim);
STATIC void UpdateServantDefault(Entity* self);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ typedef struct {
// essentially % chance for abilities to trigger.
typedef struct {
s16 timer;
s16 unk1;
s16 lifeAppleChance;
s16 hammerChance;
s16 uncurseChance;
s16 antivenomChance;

View File

@ -2,7 +2,7 @@
#include "faerie.h"
#include "items.h"
FaerieAnimIndex D_us_80172368[] = {
FaerieAnimIndex g_AnimIndexParams[] = {
{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {4, 1}, {4, 1}, {0, 0},
{4, 1}, {4, 1}, {3, 0}, {5, 0}, {0, 0}, {0, 0}, {0, 0}, {4, 1},
{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {4, 1}, {0, 0},
@ -12,70 +12,70 @@ FaerieAnimIndex D_us_80172368[] = {
FaerieAbilityStats g_FaerieAbilityStats[] = {
{.timer = 0x1E, // lvl 0-9
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x20,
.uncurseChance = 0x10,
.antivenomChance = 0x10,
.resistChance = 0x10,
.healChance = 0xC0},
{.timer = 0x14, // lvl 10-19
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x20,
.uncurseChance = 0x10,
.antivenomChance = 0x10,
.resistChance = 0x20,
.healChance = 0xC0},
{.timer = 0x0F, // lvl 20-29
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x40,
.uncurseChance = 0x20,
.antivenomChance = 0x20,
.resistChance = 0x20,
.healChance = 0xD0},
{.timer = 0x0A, // lvl 30-39
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x40,
.uncurseChance = 0x20,
.antivenomChance = 0x20,
.resistChance = 0x40,
.healChance = 0xD0},
{.timer = 0x0A, // lvl 40-49
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x60,
.uncurseChance = 0x20,
.antivenomChance = 0x30,
.resistChance = 0x40,
.healChance = 0xE0},
{.timer = 0x05, // lvl 50-59
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x60,
.uncurseChance = 0x40,
.antivenomChance = 0x30,
.resistChance = 0x40,
.healChance = 0xE0},
{.timer = 0x03, // lvl 60-69
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0x80,
.uncurseChance = 0x40,
.antivenomChance = 0x40,
.resistChance = 0x60,
.healChance = 0xE0},
{.timer = 0x02, // lvl 70-79
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0xA0,
.uncurseChance = 0x60,
.antivenomChance = 0x50,
.resistChance = 0x60,
.healChance = 0xFF},
{.timer = 0x01, // lvl 80-89
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0xC0,
.uncurseChance = 0x60,
.antivenomChance = 0x60,
.resistChance = 0x80,
.healChance = 0xFF},
{.timer = 0x00, // lvl 90-99
.unk1 = 0xFF,
.lifeAppleChance = 0xFF,
.hammerChance = 0xC0,
.uncurseChance = 0x60,
.antivenomChance = 0x60,