-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
107 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
#include "mar.h" | ||
|
||
#ifndef CASTLE_FLAG_BANK | ||
#define CASTLE_FLAG_BANK -0x118 | ||
#endif | ||
|
||
void EntityUnkId13(Entity* self); | ||
void EntityUnkId14(Entity* self); | ||
void EntityUnkId15(Entity* self); | ||
|
||
#define HEART_DROP_CASTLE_FLAG 0 | ||
#include "../../st/e_misc.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,5 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
#include "cen.h" | ||
// Bizarre variable - u16 here, but u8 in EntityHolyGlassesCutscene | ||
extern u16 D_801805D8[]; | ||
|
||
void EntityHeartDrop(Entity* self) { | ||
u16 index; | ||
u8 value; | ||
PfnEntityUpdate update; | ||
|
||
if (!self->step) { | ||
index = self->ext.heartDrop.unkB4 = self->params + 0xC0; | ||
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7); | ||
if (value & 1) { | ||
DestroyEntity(self); | ||
return; | ||
} | ||
|
||
index -= 0xC0; | ||
index = D_801805D8[index]; | ||
if (index < 128) { | ||
self->ext.heartDrop.update = EntityPrizeDrop; | ||
} else { | ||
self->ext.heartDrop.update = EntityEquipItemDrop; | ||
index -= 128; | ||
} | ||
self->params = index + 0x8000; | ||
} else { | ||
index = self->ext.heartDrop.unkB4; | ||
if (self->step < 5) { | ||
if (self->hitFlags) { | ||
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |= | ||
1 << (index & 7); | ||
self->step = 5; | ||
} | ||
} | ||
} | ||
update = self->ext.heartDrop.update; | ||
update(self); | ||
} | ||
#define HEART_DROP_CASTLE_FLAG 0xC0 | ||
#include "../entity_heart_drop.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,5 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
#include "dre.h" | ||
|
||
extern u16 D_80180660[]; | ||
void EntityHeartDrop(Entity* self) { | ||
u16 index; | ||
u8 value; | ||
PfnEntityUpdate update; | ||
|
||
if (!self->step) { | ||
index = self->ext.heartDrop.unkB4 = self->params + 0x118; | ||
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7); | ||
if (value & 1) { | ||
DestroyEntity(self); | ||
return; | ||
} | ||
|
||
index -= 0x118; | ||
index = D_80180660[index]; | ||
if (index < 128) { | ||
self->ext.heartDrop.update = EntityPrizeDrop; | ||
} else { | ||
self->ext.heartDrop.update = EntityEquipItemDrop; | ||
index -= 128; | ||
} | ||
self->params = index + 0x8000; | ||
} else { | ||
index = self->ext.heartDrop.unkB4; | ||
if (self->step < 5) { | ||
if (self->hitFlags) { | ||
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |= | ||
1 << (index & 7); | ||
self->step = 5; | ||
} | ||
} | ||
} | ||
update = self->ext.heartDrop.update; | ||
update(self); | ||
} | ||
#define HEART_DROP_CASTLE_FLAG 0x118 | ||
#include "../entity_heart_drop.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
extern u16 g_HeartDropArray[]; | ||
|
||
void EntityHeartDrop(Entity* self) { | ||
u16 index; | ||
u8 value; | ||
PfnEntityUpdate update; | ||
|
||
if (!self->step) { | ||
index = self->ext.heartDrop.unkB4 = | ||
self->params + HEART_DROP_CASTLE_FLAG; | ||
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7); | ||
if (value & 1) { | ||
DestroyEntity(self); | ||
return; | ||
} | ||
|
||
index -= HEART_DROP_CASTLE_FLAG; | ||
index = g_HeartDropArray[index]; | ||
if (index < 128) { | ||
self->ext.heartDrop.update = EntityPrizeDrop; | ||
} else { | ||
self->ext.heartDrop.update = EntityEquipItemDrop; | ||
index -= 128; | ||
} | ||
self->params = index + 0x8000; | ||
} else { | ||
index = self->ext.heartDrop.unkB4; | ||
if (self->step < 5) { | ||
if (self->hitFlags) { | ||
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |= | ||
1 << (index & 7); | ||
self->step = 5; | ||
} | ||
} | ||
} | ||
update = self->ext.heartDrop.update; | ||
update(self); | ||
} |
Oops, something went wrong.