Skip to content

Commit

Permalink
Merge pull request #619 from octorock/objects
Browse files Browse the repository at this point in the history
  • Loading branch information
hytopoulos committed Aug 7, 2023
2 parents d7a82d0 + 4d67e6f commit 8a294a4
Show file tree
Hide file tree
Showing 178 changed files with 3,744 additions and 3,503 deletions.
6 changes: 3 additions & 3 deletions assets/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22883,19 +22883,19 @@
"type": "animation"
},
{
"path": "animations/gSpriteAnimations_Thunderbold_0.bin",
"path": "animations/gSpriteAnimations_Thunderbolt_0.bin",
"start": 1190252,
"size": 16,
"type": "animation"
},
{
"path": "animations/gSpriteAnimations_Thunderbold_1.bin",
"path": "animations/gSpriteAnimations_Thunderbolt_1.bin",
"start": 1190268,
"size": 12,
"type": "animation"
},
{
"path": "animations/gSpriteAnimations_Thunderbold_2.bin",
"path": "animations/gSpriteAnimations_Thunderbolt_2.bin",
"start": 1190280,
"size": 28,
"type": "animation"
Expand Down
20 changes: 0 additions & 20 deletions data/animations/object/thunderbold.s

This file was deleted.

20 changes: 20 additions & 0 deletions data/animations/object/thunderbolt.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.include "asm/macros.inc"
.include "constants/constants.inc"

.section .rodata
.align 2

gSpriteAnimations_Thunderbolt_0:: @ 0812296C
.include "animations/gSpriteAnimations_Thunderbolt_0.s"

gSpriteAnimations_Thunderbolt_1:: @ 0812297C
.include "animations/gSpriteAnimations_Thunderbolt_1.s"

gSpriteAnimations_Thunderbolt_2:: @ 08122988
.include "animations/gSpriteAnimations_Thunderbolt_2.s"

gSpriteAnimations_Thunderbolt:: @ 081229A4
.4byte gSpriteAnimations_Thunderbolt_0
.4byte gSpriteAnimations_Thunderbolt_1
.4byte gSpriteAnimations_Thunderbolt_2
.4byte 00000000
2 changes: 1 addition & 1 deletion data/gfx/sprite_ptrs.s
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ gSpritePtrs:: @ 080029B4
.4byte 00000000
.4byte 00000000

.4byte gSpriteAnimations_Thunderbold
.4byte gSpriteAnimations_Thunderbolt
.4byte 00000000
.4byte 00000000
.4byte 00000000
Expand Down
2 changes: 1 addition & 1 deletion include/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern void sub_08001290(struct Entity_*, u32);
extern void GenericKnockback(struct Entity_*);
extern u32 GetFuserId(struct Entity_*);
extern u32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
extern u32 GravityUpdate(struct Entity_*, u32);
extern u32 GravityUpdate(struct Entity_* entity, u32 gravity);
extern u32 CheckOnScreen(struct Entity_*);
extern bool32 EntityInRectRadius(struct Entity_*, struct Entity_*, u32, u32);
extern void UpdateAnimationVariableFrames(struct Entity_*, u32);
Expand Down
1 change: 0 additions & 1 deletion include/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "player.h"

void CreateItemEntity(u32, u32, u32);
void sub_08081404(Entity*, u32);
extern void ExecuteItemFunction(ItemBehavior* this, u32 index);

extern void ItemDebug(ItemBehavior*, u32);
Expand Down
4 changes: 2 additions & 2 deletions include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ typedef enum {
EZLO_CAP_FLYING,
GIANT_TWIG,
OBJECT_63,
THUNDERBOLD,
THUNDERBOLT,
LADDER_HOLE,
WATER_DROP_OBJECT,
GLEEROK_PARTICLE,
Expand Down Expand Up @@ -330,7 +330,7 @@ void SwordsmanNewsletter();
void EzloCapFlying();
void GiantTwig();
void Object63();
void Thunderbold();
void Thunderbolt();
void LadderHoleInBookshelf();
void WaterDropObject();
void GleerokParticle();
Expand Down
12 changes: 12 additions & 0 deletions include/object/cutsceneOrchestrator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef CUTSCENEORCHESTRATOR_H
#define CUTSCENEORCHESTRATOR_H

#include "script.h"

typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[28];
/*0x84*/ ScriptExecutionContext* context;
} CutsceneOrchestratorEntity;

#endif // CUTSCENEORCHESTRATOR_H
18 changes: 18 additions & 0 deletions include/object/itemOnGround.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef ITEMONGROUND_H
#define ITEMONGROUND_H

#include "entity.h"

typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68;
/*0x69*/ u8 unk_69;
/*0x6a*/ u8 unk_6a;
/*0x6b*/ u8 unused1[1];
/*0x6c*/ u16 unk_6c;
/*0x6e*/ u16 unk_6e;
/*0x70*/ u8 unused2[22];
/*0x86*/ u16 unk_86;
} ItemOnGroundEntity;

#endif // ITEMONGROUND_H
21 changes: 21 additions & 0 deletions include/object/lilypadLarge.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef LILYPADLARGE_H
#define LILYPADLARGE_H

#include "entity.h"

typedef struct {
Entity base;
u8 unk_68[4];
s32 unk_6c;
s32 unk_70;
s16 unk_74;
s16 unk_76;
union SplitWord unk_78;
union SplitWord unk_7c;
u8 unk_80[2];
u16 unk_82;
u8 unk_84;
u8 unk_85;
} LilypadLargeEntity;

#endif // LILYPADLARGE_H
6 changes: 3 additions & 3 deletions linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ SECTIONS {
src/object/ezloCapFlying.o(.text);
src/object/giantTwig.o(.text);
src/object/object63.o(.text);
src/object/thunderbold.o(.text);
src/object/thunderbolt.o(.text);
src/object/ladderHoleInBookshelf.o(.text);
src/object/waterDropObject.o(.text);
src/object/gleerokParticle.o(.text);
Expand Down Expand Up @@ -1487,8 +1487,8 @@ SECTIONS {
src/object/ezloCapFlying.o(.rodata);
src/object/giantTwig.o(.rodata);
src/object/object63.o(.rodata);
src/object/thunderbold.o(.rodata);
data/animations/object/thunderbold.o(.rodata);
src/object/thunderbolt.o(.rodata);
data/animations/object/thunderbolt.o(.rodata);
src/object/ladderHoleInBookshelf.o(.rodata);
src/object/gleerokParticle.o(.rodata);
src/object/linkEmptyingBottle.o(.rodata);
Expand Down
2 changes: 1 addition & 1 deletion src/manager/vaati3StartManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void Vaati3StartManager_Type0_Action1(Vaati3StartManager* this) {
super->timer = 120;
SetPlayerControl(2);
sub_08078B48();
object = CreateObject(THUNDERBOLD, 0, 0);
object = CreateObject(THUNDERBOLT, 0, 0);
if (object != NULL) {
object->x.HALF.HI = gRoomControls.origin_x + 0x88;
object->y.HALF.HI = gRoomControls.origin_y + 0x48;
Expand Down
2 changes: 1 addition & 1 deletion src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void (*const gObjectFunctions[])(Entity*) = {
[EZLO_CAP_FLYING] = EzloCapFlying,
[GIANT_TWIG] = GiantTwig,
[OBJECT_63] = Object63,
[THUNDERBOLD] = Thunderbold,
[THUNDERBOLT] = Thunderbolt,
[LADDER_HOLE] = LadderHoleInBookshelf,
[WATER_DROP_OBJECT] = WaterDropObject,
[GLEEROK_PARTICLE] = GleerokParticle,
Expand Down
45 changes: 20 additions & 25 deletions src/object/ambientClouds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @brief Ambient Clouds object
*/
#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
Expand All @@ -27,8 +28,6 @@ void AmbientClouds(Entity* this) {
}

void AmbientClouds_Init(Entity* this) {
Entity* pEVar2;

#ifndef EU
if ((this->flags & ENT_DID_INIT) != 0) {
#endif
Expand All @@ -44,10 +43,10 @@ void AmbientClouds_Init(Entity* this) {
this->parent = NULL;
CreateObjectWithParent(this, AMBIENT_CLOUDS, 0, 0xff);
for (; this->type != 0; --this->type) {
pEVar2 = CreateObjectWithParent(this, AMBIENT_CLOUDS, 0, this->type);
this->child = pEVar2;
if (pEVar2 != NULL) {
pEVar2->parent = this->parent;
Entity* entity = CreateObjectWithParent(this, AMBIENT_CLOUDS, 0, this->type);
this->child = entity;
if (entity != NULL) {
entity->parent = this->parent;
if (this->parent != NULL) {
this->parent->child = this->child;
}
Expand Down Expand Up @@ -77,9 +76,6 @@ void AmbientClouds_Init(Entity* this) {
}

void AmbientClouds_Action1(Entity* this) {
int iVar1;
Entity* pEVar2;

if (this->type2 == 0xff) {
this->spritePriority.b0 = 7;
this->spriteRendering.b3 = 3;
Expand All @@ -92,8 +88,7 @@ void AmbientClouds_Action1(Entity* this) {
else
this->timer = 0;
this->y.HALF.HI += (this->type2 - 1) * -0x24;
iVar1 = EntityInRectRadius(this, &gPlayerEntity, 0xf, 0xf);
if ((iVar1 != 0) && (this->timer != 0)) {
if (EntityInRectRadius(this, &gPlayerEntity, 15, 15) && (this->timer != 0)) {
this->action = 2;
this->spriteOrientation.flipY = 2;
this->spriteRendering.b3 = 3;
Expand All @@ -105,21 +100,21 @@ void AmbientClouds_Action1(Entity* this) {
gPlayerEntity.z.HALF.HI += 0x24;
sub_0807AA80(&gPlayerEntity);
if (this->subtimer == 0) {
pEVar2 = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (pEVar2 != NULL) {
pEVar2->x.HALF.HI += 8;
Entity* fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI += 8;
}
pEVar2 = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (pEVar2 != NULL) {
pEVar2->x.HALF.HI -= 8;
fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI -= 8;
}
pEVar2 = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (pEVar2 != NULL) {
pEVar2->y.HALF.HI += 8;
fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (fx != NULL) {
fx->y.HALF.HI += 8;
}
pEVar2 = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (pEVar2 != NULL) {
pEVar2->y.HALF.HI -= 8;
fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
if (fx != NULL) {
fx->y.HALF.HI -= 8;
}
}
}
Expand All @@ -131,7 +126,7 @@ void AmbientClouds_Action1(Entity* this) {

void AmbientClouds_Action2(Entity* this) {
this->y.HALF.HI += this->type2 * -0x24;
if (EntityInRectRadius(this, &gPlayerEntity, 0xf, 0xf)) {
if (EntityInRectRadius(this, &gPlayerEntity, 15, 15)) {
gPlayerState.field_0x14 = 1;
gPlayerState.flags |= PL_FLAGS2;
} else {
Expand All @@ -144,7 +139,7 @@ void AmbientClouds_Action2(Entity* this) {
}

void AmbientClouds_Action3(Entity* this) {
if (EntityInRectRadius(this, &gPlayerEntity, 0xf, 0xf)) {
if (EntityInRectRadius(this, &gPlayerEntity, 15, 15)) {
gPlayerState.field_0x14 = 1;
}
}
1 change: 1 addition & 0 deletions src/object/angryStatue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @brief Angry Statue object
*/
#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "hitbox.h"
Expand Down
1 change: 1 addition & 0 deletions src/object/archway.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @brief Archway object
*/
#define NENT_DEPRECATED
#include "entity.h"
#include "game.h"

Expand Down
Loading

0 comments on commit 8a294a4

Please sign in to comment.