Document some stuff with Entrance lightning (#1745)
Some checks are pending
Format code / format (push) Waiting to run
Build C code / extract-assets (push) Waiting to run
Build C code / build-linux (push) Blocked by required conditions
Build C code / build-macos (push) Blocked by required conditions
Build C code / build-windows (push) Blocked by required conditions
Build C code / build-linux-lle (push) Blocked by required conditions
Build Saturn version / build-and-test-saturn (push) Waiting to run
Build Saturn version / function-finder-saturn (push) Waiting to run
Build Debug Module tool / build (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Waiting to run
Build PSX and PSP version / build-and-test (us, us) (push) Waiting to run
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Blocked by required conditions

Mostly just some light renaming.

I used my new entity animation viewer to figure out what this function
was, it's a very subtle cloud effect that would have been hard to
identify otherwise.

The driving factor for this was removing ext.generic from this entity,
which is also complete.

This applies to both NO3 and NP3.
This commit is contained in:
bismurphy 2024-10-05 17:51:28 -04:00 committed by GitHub
parent 9ce2a3fbf6
commit 077578210e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 21 deletions

View File

@ -49,7 +49,7 @@ EntityStairwayPiece = 0x801BAEF0;
EntityFallingRock = 0x801BB3BC;
EntityDeathSkySwirl = 0x801BBB8C;
EntityLightningThunder = 0x801BBDC0;
EntityUnkId2A = 0x801BBE70;
EntityLightningCloud = 0x801BBE70;
EntitySwitch = 0x801BBF38;
EntityHeartRoomGoldDoor = 0x801BC05C;
EntityUnkId49 = 0x801BC3FC;

View File

@ -188,7 +188,7 @@ void EntityBackgroundLightning(Entity* self) {
}
otherEnt = AllocEntity(&g_Entities[224], &g_Entities[256]);
if (otherEnt != NULL) {
CreateEntityFromCurrentEntity(E_ID_2A, otherEnt);
CreateEntityFromCurrentEntity(E_LIGHTNING_CLOUD, otherEnt);
if (randOf3 > 2) {
randOf3 = 0;
}
@ -1905,19 +1905,22 @@ void EntityLightningThunder(Entity* self) {
}
}
void EntityUnkId2A(Entity* entity) {
if (entity->step == 0) {
// When lightning strikes, we get a bright bolt, but it is against a cloud
// as a background. It's subtle and hard to see, but it's there.
void EntityLightningCloud(Entity* self) {
if (self->step == 0) {
InitializeEntity(D_80180B18);
entity->zPriority = 0x29;
entity->flags &= ~FLAG_POS_CAMERA_LOCKED;
entity->animCurFrame = entity->params + 0x22;
entity->posX.i.hi = D_8018139C[entity->params << 1];
entity->posY.i.hi = D_8018139E[entity->params << 1];
entity->ext.generic.unk80.modeS16.unk0 = 5;
self->zPriority = 0x29;
self->flags &= ~FLAG_POS_CAMERA_LOCKED;
// There are 3 shapes of cloud, this picks which one.
self->animCurFrame = self->params + 0x22;
self->posX.i.hi = D_8018139C[self->params << 1];
self->posY.i.hi = D_8018139E[self->params << 1];
self->ext.backgroundLightning.timer = 5;
}
entity->ext.generic.unk80.modeS16.unk0--;
if ((entity->ext.generic.unk80.modeS16.unk0 << 0x10) == 0) {
DestroyEntity(entity);
if (--self->ext.backgroundLightning.timer == 0) {
DestroyEntity(self);
}
}

View File

@ -49,7 +49,7 @@ typedef enum EntityIDs {
/* 0x1E */ E_CAVERN_DOOR_LEVER_UNK0 = 0x1E,
/* 0x27 */ E_FALLING_ROCK_2 = 0x27,
/* 0x29 */ E_LIGHTNING_THUNDER = 0x29,
/* 0x2A */ E_ID_2A,
/* 0x2A */ E_LIGHTNING_CLOUD,
/* 0x2E */ E_ID_2E = 0x2E,
/* 0x30 */ E_ID_30 = 0x30,
/* 0x31 */ E_ID_31,

View File

@ -50,7 +50,7 @@ void EntityBackgroundLightning(Entity* self) {
}
newEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
if (newEntity != NULL) {
CreateEntityFromCurrentEntity(E_801B5E98, newEntity);
CreateEntityFromCurrentEntity(E_LIGHTNING_CLOUD, newEntity);
if (random0to3 >= 3) {
random0to3 = 0;
}
@ -1583,18 +1583,21 @@ void EntityLightningThunder(Entity* self) {
}
}
void func_801B5E98(Entity* self) {
// When lightning strikes, we get a bright bolt, but it is against a cloud
// as a background. It's subtle and hard to see, but it's there.
void EntityLightningCloud(Entity* self) {
if (self->step == 0) {
InitializeEntity(D_80180AA8);
self->zPriority = 0x29;
self->flags &= ~FLAG_POS_CAMERA_LOCKED;
// There are 3 shapes of cloud, this picks which one.
self->animCurFrame = self->params + 0x22;
self->posX.i.hi = D_80181220[self->params][0];
self->posY.i.hi = D_80181220[self->params][1];
self->ext.generic.unk80.modeS16.unk0 = 5;
self->ext.backgroundLightning.timer = 5;
}
if (--self->ext.generic.unk80.modeS16.unk0 == 0) {
if (--self->ext.backgroundLightning.timer == 0) {
DestroyEntity(self);
}
}

View File

@ -41,7 +41,7 @@ void EntityMermanRockRightSide(Entity* self);
void func_801B5488(Entity* self);
void EntityFallingRock2(Entity* self);
void EntityLightningThunder(Entity* self);
void func_801B5E98(Entity* self);
void EntityLightningCloud(Entity* self);
void EntitySwitch(Entity* self);
void EntityHeartRoomGoldDoor(Entity* self);
void EntityAlucardWaterEffect(Entity* self);
@ -134,7 +134,7 @@ PfnEntityUpdate PfnEntityUpdates[] = {
func_801B5488,
EntityFallingRock2,
EntityLightningThunder,
func_801B5E98,
EntityLightningCloud,
EntitySwitch,
EntityHeartRoomGoldDoor,
EntityAlucardWaterEffect,

View File

@ -30,7 +30,7 @@ typedef enum {
/* 0x1E */ E_CAVERN_DOOR_LEVER_UNK0 = 0x1E,
/* 0x27 */ E_FALLING_ROCK_2 = 0x27,
/* 0x28 */ E_LIGHTNING_THUNDER,
/* 0x29 */ E_801B5E98,
/* 0x29 */ E_LIGHTNING_CLOUD,
/* 0x2D */ E_SPLASH_WATER = 0x2D,
/* 0x2E */ E_SURFACING_WATER,
/* 0x2F */ E_SIDE_WATER_SPLASH,