1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 06:10:21 +00:00

Bomb Related Effect Overlays (#283)

* fix colliderinit typo

* dead sound done

* deadsound documentation

* blast done

* progress

* spk init

* progress

* spark done

* ss bomb ok

* bomb done

* cleanup

* progress

* progress

* almost done with bomb2

* clean up gossip stone

* more

* cleanup and format

* remove unused asm file

* nonmatching reloc

* done i think

* mistakes

* fix headers

* idk how that got in here

* match bomb2

* asm file

* pr review
This commit is contained in:
fig02 2020-07-28 15:49:00 -04:00 committed by GitHub
parent c76c584006
commit 19c990b852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 822 additions and 2416 deletions

View file

@ -1,3 +1,9 @@
/*
* File: z_en_gs.c
* Overlay: ovl_En_Gs
* Description: Gossip Stone
*/
#include "z_en_gs.h"
#define FLAGS 0x02000009
@ -10,17 +16,10 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx);
void EnGs_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80A4F734(EnGs* this, GlobalContext* globalCtx);
void func_80A4F77C(EnGs* this);
void func_80A4E910(EnGs* this, GlobalContext* globalCtx);
void func_80A4EA08(EnGs* this, GlobalContext* globalCtx);
void func_80A4EB3C(EnGs* this, GlobalContext* globalCtx);
void func_80A4ED34(EnGs* this, GlobalContext* globalCtx);
void func_80A4F13C(EnGs* this, GlobalContext* globalCtx);
void func_80A4E648(EnGs* this, GlobalContext* globalCtx);
void func_80A4E470(EnGs* this, GlobalContext* globalCtx);
void func_80A4F700(EnGs* this, GlobalContext* globalCtx);
void func_80A4F77C(EnGs* this);
extern Gfx D_0404D4E0[];
extern Gfx D_06000950[];
extern Gfx D_060009D0[];
@ -54,26 +53,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
Color_RGBA8 D_80A4FDFC = { 0xFF, 0x32, 0x32, 0x00 };
Color_RGBA8 D_80A4FE00 = { 0x32, 0x32, 0xFF, 0x00 };
Color_RGBA8 D_80A4FE04 = { 0xFF, 0xFF, 0xFF, 0x00 };
Vec3f D_80A4FE08 = { 0.0f, -0.3f, 0.0f };
Color_RGBA8 D_80A4FE14 = { 0xC8, 0xC8, 0xC8, 0x80 };
Color_RGBA8 D_80A4FE18 = { 0x64, 0x64, 0x64, 0x00 };
Vec3f D_80A4FE1C = { 0.0f, 0.0f, 0.0f };
Vec3f D_80A4FE28 = { 0.0f, 0.0f, 0.0f };
Vec3s D_80A4FE34 = { 0x0000, 0x0000, 0x0000 };
Vec3f D_80A4FE3C = { 1.0f, 1.0f, 1.0f };
void EnGs_Init(Actor* thisx, GlobalContext* globalCtx) {
EnGs* this = THIS;
@ -267,10 +246,18 @@ void func_80A4EB3C(EnGs* this, GlobalContext* globalCtx) {
}
void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) {
static Color_RGBA8 flashRed = { 255, 50, 50, 0 };
static Color_RGBA8 flashBlue = { 50, 50, 255, 0 };
static Color_RGBA8 baseWhite = { 255, 255, 255, 0 };
static Vec3f dustAccel = { 0.0f, -0.3f, 0.0f };
static Color_RGBA8 dustPrim = { 200, 200, 200, 128 };
static Color_RGBA8 dustEnv = { 100, 100, 100, 0 };
static Vec3f bomb2Velocity = { 0.0f, 0.0f, 0.0f };
static Vec3f bomb2Accel = { 0.0f, 0.0f, 0.0f };
u8 i;
Vec3f sp60;
Vec3f sp5C;
Vec3f sp68;
Vec3f dustPos;
Vec3f dustVelocity;
Vec3f bomb2Pos;
if (this->unk_19F == 0) {
this->unk_200 = 0x28;
@ -287,16 +274,16 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) {
if (this->unk_19F == 2) {
this->unk_200--;
Color_RGBA8_Copy(&this->unk_1E4, &D_80A4FE04);
Color_RGBA8_Copy(&this->flashColor, &baseWhite);
if ((this->unk_200 < 0x50) && ((this->unk_200 % 0x14) < 8)) {
if (this->unk_200 < 0x14) {
Color_RGBA8_Copy(&this->unk_1E4, &D_80A4FDFC);
Color_RGBA8_Copy(&this->flashColor, &flashRed);
if ((this->unk_200 % 0x14) == 7) {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
}
} else {
Color_RGBA8_Copy(&this->unk_1E4, &D_80A4FE00);
Color_RGBA8_Copy(&this->flashColor, &flashBlue);
if ((this->unk_200 % 0x14) == 7) {
Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
@ -312,14 +299,14 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) {
if (this->unk_19F == 3) {
for (i = 0; i < 3; i++) {
sp5C.x = Math_Rand_CenteredFloat(15.0f);
sp5C.y = Math_Rand_ZeroFloat(-1.0f);
sp5C.z = Math_Rand_CenteredFloat(15.0f);
sp60.x = this->actor.posRot.pos.x + (sp5C.x + sp5C.x);
sp60.y = this->actor.posRot.pos.y + 7.0f;
sp60.z = this->actor.posRot.pos.z + (sp5C.z + sp5C.z);
func_8002836C(globalCtx, &sp60, &sp5C, &D_80A4FE08, &D_80A4FE14, &D_80A4FE18,
(s16)Math_Rand_ZeroFloat(50.0f) + 0xC8, 0x28, 0xF);
dustVelocity.x = Math_Rand_CenteredFloat(15.0f);
dustVelocity.y = Math_Rand_ZeroFloat(-1.0f);
dustVelocity.z = Math_Rand_CenteredFloat(15.0f);
dustPos.x = this->actor.posRot.pos.x + (dustVelocity.x + dustVelocity.x);
dustPos.y = this->actor.posRot.pos.y + 7.0f;
dustPos.z = this->actor.posRot.pos.z + (dustVelocity.z + dustVelocity.z);
func_8002836C(globalCtx, &dustPos, &dustVelocity, &dustAccel, &dustPrim, &dustEnv,
(s16)Math_Rand_ZeroFloat(50.0f) + 200, 40, 15);
}
func_8002F974(&this->actor, NA_SE_EV_FIRE_PILLAR - SFX_FLAG);
@ -336,11 +323,11 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) {
if (this->unk_19F == 4) {
func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 3);
if (this->actor.bgCheckFlags & 0x18) {
sp68.x = this->actor.posRot.pos.x;
sp68.y = this->actor.posRot.pos.y;
sp68.z = this->actor.posRot.pos.z;
bomb2Pos.x = this->actor.posRot.pos.x;
bomb2Pos.y = this->actor.posRot.pos.y;
bomb2Pos.z = this->actor.posRot.pos.z;
Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
func_80028E84(globalCtx, &sp68, &D_80A4FE1C, &D_80A4FE28, 0x64, 0x14);
EffectSsBomb2_SpawnLayered(globalCtx, &bomb2Pos, &bomb2Velocity, &bomb2Accel, 100, 20);
this->unk_200 = 10;
this->unk_19E |= 8;
this->actionFunc = func_80A4F700;
@ -460,6 +447,7 @@ void func_80A4F13C(EnGs* this, GlobalContext* globalCtx) {
}
}
#else
void func_80A4F13C(EnGs* this, GlobalContext* globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Gs/func_80A4F13C.s")
#endif
@ -476,6 +464,8 @@ void func_80A4F734(EnGs* this, GlobalContext* globalCtx) {
}
void func_80A4F77C(EnGs* this) {
static Vec3s D_80A4FE34 = { 0, 0, 0 };
static Vec3f D_80A4FE3C = { 1.0f, 1.0f, 1.0f };
s32 i;
for (i = 0; i < 3; i++) {
@ -565,8 +555,8 @@ void EnGs_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPDisplayList(gfxCtx->polyOpa.p++, D_06000950);
if (this->unk_19E & 4) {
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, this->unk_1E4.r, this->unk_1E4.g, this->unk_1E4.b,
this->unk_1E4.a);
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, this->flashColor.r, this->flashColor.g, this->flashColor.b,
this->flashColor.a);
} else {
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 255, 255, 255, 255);
}

View file

@ -20,7 +20,7 @@ typedef struct EnGs {
/* 0x01B4 */ Vec3f unk_1B4[2];
/* 0x01CC */ char unk_1CC[0xC];
/* 0x01D8 */ Vec3f unk_1D8;
/* 0x01E4 */ Color_RGBA8 unk_1E4;
/* 0x01E4 */ Color_RGBA8 flashColor;
/* 0x01E8 */ f32 unk_1E8;
/* 0x01EC */ f32 unk_1EC;
/* 0x01F0 */ f32 unk_1F0;