mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-23 13:09:44 +00:00
Figuring out gold and vessel collect functions
This commit is contained in:
parent
76ea3c33b4
commit
6ef021444c
@ -53,5 +53,7 @@ AnimateEntity = 0x80191E6C;
|
||||
AllocEntity = 0x80192800;
|
||||
InitializeEntity = 0x80192CAC;
|
||||
ReplaceCandleWithDrop = 0x80193394;
|
||||
CollectHeartVessel = 0x801938FC;
|
||||
CollectLifeVessel = 0x8019394C;
|
||||
EntityCandleDrop = 0x801939E0;
|
||||
EntityCandleHeartDrop = 0x801943EC;
|
@ -1,4 +1,6 @@
|
||||
PfnEntityUpdates = 0x801803E0;
|
||||
c_GoldPrizes = 0x80180E30;
|
||||
c_HeartPrizes = 0x80180EC0;
|
||||
EntityCandle = 0x8018726C;
|
||||
SpawnExplosionEntity = 0x8018A860;
|
||||
DestroyEntity = 0x8018B600;
|
||||
@ -7,4 +9,7 @@ AnimateEntity = 0x8018B730;
|
||||
AllocEntity = 0x8018BE70;
|
||||
InitializeEntity = 0x8018C310;
|
||||
ReplaceCandleWithDrop = 0x8018C9F8;
|
||||
CollectHeart = 0x8018CC90;
|
||||
CollectHeart = 0x8018CC90;
|
||||
CollectGold = 0x8018CD10;
|
||||
CollectHeartVessel = 0x8018CF04;
|
||||
CollectLifeVessel = 0x8018CFA8;
|
||||
|
@ -255,6 +255,12 @@ extern s32 D_8003CACC;
|
||||
|
||||
// dra
|
||||
#define RENDERFLAGS_NOSHADOW 2
|
||||
#define PLAYER_ALUCARD 0
|
||||
#define PLAYER_RICHTER 1
|
||||
#define MAX_GOLD 999999
|
||||
#define HEART_VESSEL_INCREASE 5
|
||||
#define HEART_VESSEL_RICHTER 30
|
||||
#define LIFE_VESSEL_INCREASE 5
|
||||
|
||||
#define MaxEntityCount 32
|
||||
#define EntityExplosionID 2
|
||||
@ -299,6 +305,8 @@ extern s32 playerX;
|
||||
extern s32 playerY;
|
||||
extern u32 D_800978B8;
|
||||
extern s32 D_800973FC;
|
||||
extern s32 D_80097410;
|
||||
extern s32 D_80097414;
|
||||
extern Unkstruct1 D_80097490;
|
||||
extern u16 D_80097494;
|
||||
extern s16 D_80097496;
|
||||
|
@ -834,15 +834,15 @@ void func_801937C4(void) {
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_801937EC);
|
||||
|
||||
void func_801938FC(void) {
|
||||
void CollectHeartVessel(void) {
|
||||
D_8003C6D8(0x670);
|
||||
D_8003C744(5, 0x4000);
|
||||
D_8003C744(HEART_VESSEL_INCREASE, 0x4000);
|
||||
DestroyEntity(D_8006C26C);
|
||||
}
|
||||
|
||||
void func_8019394C(void) {
|
||||
void CollectLifeVessel(void) {
|
||||
D_8003C6D8(0x670);
|
||||
D_8003C744(5, 0x8000);
|
||||
D_8003C744(LIFE_VESSEL_INCREASE, 0x8000);
|
||||
DestroyEntity(D_8006C26C);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,9 @@ extern u8 D_801805D8[];
|
||||
extern u8 D_801805E0[];
|
||||
extern u16 D_801805E8[];
|
||||
extern u8 D_801805F8[];
|
||||
extern s8 D_80180EC0[];
|
||||
extern s32 D_80180E08[];
|
||||
extern s32 c_GoldPrizes[];
|
||||
extern s8 c_HeartPrizes[];
|
||||
|
||||
extern PfnEntityUpdate PfnEntityUpdates[];
|
||||
extern s16 D_80180A94[];
|
||||
@ -23,6 +25,7 @@ void EntityCandleDrop(Entity*);
|
||||
void EntityCandleHeartDrop(Entity*);
|
||||
void func_8018D894(Entity *);
|
||||
void func_801916C4(s32);
|
||||
void func_80192F40(s32, s32);
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_80186FD0);
|
||||
|
||||
@ -425,7 +428,7 @@ void CollectHeart(u16 heartSize) {
|
||||
|
||||
D_8003C7DC(0x67A);
|
||||
hearts = &g_playerHeart;
|
||||
*hearts += D_80180EC0[heartSize];
|
||||
*hearts += c_HeartPrizes[heartSize];
|
||||
if (g_playerHeartMax < *hearts) {
|
||||
*hearts = g_playerHeartMax;
|
||||
}
|
||||
@ -433,15 +436,55 @@ void CollectHeart(u16 heartSize) {
|
||||
}
|
||||
#endif
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018CD10);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", CollectGold);
|
||||
#else
|
||||
void CollectGold(u16 goldSize) {
|
||||
s32 *gold, *unk;
|
||||
u16 goldSizeIndex;
|
||||
|
||||
gold = &g_playerGold;
|
||||
D_8003C7DC(0x6A9);
|
||||
goldSizeIndex = goldSize - 2;
|
||||
*gold += c_GoldPrizes[goldSizeIndex];
|
||||
if (*gold > MAX_GOLD) {
|
||||
*gold = MAX_GOLD;
|
||||
}
|
||||
|
||||
unk = &D_80097410;
|
||||
if (*unk) {
|
||||
D_8003C7B4(D_80097414);
|
||||
*unk = 0;
|
||||
}
|
||||
|
||||
func_80192F40(D_80180E08[goldSizeIndex], 1);
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
#endif
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018CDEC);
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018CF04);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", CollectHeartVessel);
|
||||
#else
|
||||
void CollectHeartVessel(void) {
|
||||
if (g_CurrentPlayableCharacter != PLAYER_ALUCARD) {
|
||||
D_8003C7DC(0x67A);
|
||||
g_playerHeart += HEART_VESSEL_RICHTER;
|
||||
if (g_playerHeartMax < g_playerHeart) {
|
||||
g_playerHeart = g_playerHeartMax;
|
||||
}
|
||||
} else {
|
||||
D_8003C7DC(0x67A);
|
||||
D_8003C848(HEART_VESSEL_INCREASE, 0x4000);
|
||||
}
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
#endif
|
||||
|
||||
void func_8018CFA8(void) {
|
||||
void CollectLifeVessel(void) {
|
||||
D_8003C7DC(0x67A);
|
||||
D_8003C848(5, 0x8000);
|
||||
D_8003C848(LIFE_VESSEL_INCREASE, 0x8000);
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user