1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-15 04:14:34 +00:00

z_en_weather_tag decomp (#329)

* Initial commit of weather_tag actor decomp

* Formatted source files and updated spec.

* Fixed references to the environment context variable that I changed.

* Deleted the last of the asm (forgot the stuff in the data folder)

* Made all requested changes to z_en_weather_tag

* Forgot to change basereg

* Removed unnecessary field in weather tag struct

* Update src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* That field in the header was totally necessary, not sure what I was thinking, sorry for all the commits

* Renamed what I thought was struct padding to more accurately represent the fact that that field is an unused variable.

* Update src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
fullgrowngaming 2020-08-20 18:28:41 -07:00 committed by GitHub
parent 4bd417aeba
commit b406e041b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 335 additions and 1163 deletions

View file

@ -329,16 +329,16 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
break;
case 27:
if (globalCtx->state.frames & 8) {
if (globalCtx->envCtx.unk_8C[0] < 40) {
globalCtx->envCtx.unk_8C[0] += 2;
globalCtx->envCtx.unk_8C[4] -= 3;
globalCtx->envCtx.unk_8C[5] -= 3;
if (globalCtx->envCtx.unk_8C[0][0] < 40) {
globalCtx->envCtx.unk_8C[0][0] += 2;
globalCtx->envCtx.unk_8C[1][1] -= 3;
globalCtx->envCtx.unk_8C[1][2] -= 3;
}
} else {
if (globalCtx->envCtx.unk_8C[0] > 2) {
globalCtx->envCtx.unk_8C[0] -= 2;
globalCtx->envCtx.unk_8C[4] += 3;
globalCtx->envCtx.unk_8C[5] += 3;
if (globalCtx->envCtx.unk_8C[0][0] > 2) {
globalCtx->envCtx.unk_8C[0][0] -= 2;
globalCtx->envCtx.unk_8C[1][1] += 3;
globalCtx->envCtx.unk_8C[1][2] += 3;
}
}
break;

View file

@ -155,28 +155,28 @@ void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base);
}
if (globalCtx->envCtx.unk_8C[3] != 0) {
globalCtx->envCtx.unk_8C[3] -= 0x19;
if (globalCtx->envCtx.unk_8C[1][0] != 0) {
globalCtx->envCtx.unk_8C[1][0] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[4] != 0) {
globalCtx->envCtx.unk_8C[4] -= 0x19;
if (globalCtx->envCtx.unk_8C[1][1] != 0) {
globalCtx->envCtx.unk_8C[1][1] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[5] != 0) {
globalCtx->envCtx.unk_8C[5] -= 0x19;
if (globalCtx->envCtx.unk_8C[1][2] != 0) {
globalCtx->envCtx.unk_8C[1][2] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[0] != 0) {
globalCtx->envCtx.unk_8C[0] -= 0x19;
if (globalCtx->envCtx.unk_8C[0][0] != 0) {
globalCtx->envCtx.unk_8C[0][0] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[1] != 0) {
globalCtx->envCtx.unk_8C[1] -= 0x19;
if (globalCtx->envCtx.unk_8C[0][1] != 0) {
globalCtx->envCtx.unk_8C[0][1] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[2] != 0) {
globalCtx->envCtx.unk_8C[2] -= 0x19;
if (globalCtx->envCtx.unk_8C[0][2] != 0) {
globalCtx->envCtx.unk_8C[0][2] -= 0x19;
}
if (this->timer == 0) {
@ -289,8 +289,8 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) {
Audio_PlayActorSound2(thisx, NA_SE_IT_BOMB_EXPLOSION);
if (globalCtx) {};
globalCtx->envCtx.unk_8C[3] = globalCtx->envCtx.unk_8C[4] = globalCtx->envCtx.unk_8C[5] = 0xFA;
globalCtx->envCtx.unk_8C[0] = globalCtx->envCtx.unk_8C[1] = globalCtx->envCtx.unk_8C[2] = 0xFA;
globalCtx->envCtx.unk_8C[1][0] = globalCtx->envCtx.unk_8C[1][1] = globalCtx->envCtx.unk_8C[1][2] = 0xFA;
globalCtx->envCtx.unk_8C[0][0] = globalCtx->envCtx.unk_8C[0][1] = globalCtx->envCtx.unk_8C[0][2] = 0xFA;
func_8005AA1C(&globalCtx->cameras[0], 2, 0xB, 8);
thisx->params = BOMB_EXPLOSION;
this->timer = 10;

View file

@ -250,28 +250,28 @@ void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base);
}
if (globalCtx->envCtx.unk_8C[3] != 0) {
globalCtx->envCtx.unk_8C[3] -= 0x19;
if (globalCtx->envCtx.unk_8C[1][0] != 0) {
globalCtx->envCtx.unk_8C[1][0] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[4] != 0) {
globalCtx->envCtx.unk_8C[4] -= 0x19;
if (globalCtx->envCtx.unk_8C[1][1] != 0) {
globalCtx->envCtx.unk_8C[1][1] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[5] != 0) {
globalCtx->envCtx.unk_8C[5] -= 0x19;
if (globalCtx->envCtx.unk_8C[1][2] != 0) {
globalCtx->envCtx.unk_8C[1][2] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[0] != 0) {
globalCtx->envCtx.unk_8C[0] -= 0x19;
if (globalCtx->envCtx.unk_8C[0][0] != 0) {
globalCtx->envCtx.unk_8C[0][0] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[1] != 0) {
globalCtx->envCtx.unk_8C[1] -= 0x19;
if (globalCtx->envCtx.unk_8C[0][1] != 0) {
globalCtx->envCtx.unk_8C[0][1] -= 0x19;
}
if (globalCtx->envCtx.unk_8C[2] != 0) {
globalCtx->envCtx.unk_8C[2] -= 0x19;
if (globalCtx->envCtx.unk_8C[0][2] != 0) {
globalCtx->envCtx.unk_8C[0][2] -= 0x19;
}
if (this->timer == 0) {
@ -399,8 +399,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
}
Audio_PlayActorSound2(thisx, NA_SE_IT_BOMB_EXPLOSION);
globalCtx->envCtx.unk_8C[3] = globalCtx->envCtx.unk_8C[4] = globalCtx->envCtx.unk_8C[5] = 0xFA;
globalCtx->envCtx.unk_8C[0] = globalCtx->envCtx.unk_8C[1] = globalCtx->envCtx.unk_8C[2] = 0xFA;
globalCtx->envCtx.unk_8C[1][0] = globalCtx->envCtx.unk_8C[1][1] = globalCtx->envCtx.unk_8C[1][2] = 0xFA;
globalCtx->envCtx.unk_8C[0][0] = globalCtx->envCtx.unk_8C[0][1] = globalCtx->envCtx.unk_8C[0][2] = 0xFA;
func_8005AA1C(&globalCtx->cameras[0], 2, 0xB, 8);
thisx->params = BOMBFLOWER_EXPLOSION;
this->timer = 10;

View file

@ -5,6 +5,7 @@
*/
#include "z_en_weather_tag.h"
#include "vt.h"
#define FLAGS 0x00000010
@ -14,7 +15,22 @@ void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx);
void EnWeatherTag_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx);
/*
void func_80B31658(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31700(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31850(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31924(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B317A8(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31A10(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31B24(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31C20(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B316B0(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31758(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31800(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B318C0(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B319A0(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31AA0(EnWeatherTag* this, GlobalContext* globalCtx);
void func_80B31CC0(EnWeatherTag* this, GlobalContext* globalCtx);
const ActorInit En_Weather_Tag_InitVars = {
ACTOR_EN_WEATHER_TAG,
ACTORTYPE_PROP,
@ -26,45 +42,296 @@ const ActorInit En_Weather_Tag_InitVars = {
(ActorFunc)EnWeatherTag_Update,
NULL,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31020.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/EnWeatherTag_Destroy.s")
void EnWeatherTag_SetupAction(EnWeatherTag* this, EnWeatherTagActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/EnWeatherTag_Init.s")
void EnWeatherTag_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B312C8.s")
void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx) {
EnWeatherTag* this = THIS;
u32 temp_v0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B3149C.s")
this->actor.flags &= ~1;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31658.s")
switch (this->actor.params & 0xF) {
case 0:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ (;o;) About ☆☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ;o;) くらいよー ☆☆☆☆☆ \n" VT_RST);
EnWeatherTag_SetupAction(this, func_80B31658);
break;
case 1:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n" VT_RST);
if (Flags_GetEventChkInf(0x18)) {
Actor_Kill(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80B31700);
break;
case 2:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ Yukigafuru You won't come (._.) ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ゆきがふるー あなたはこないー (._.) ☆☆☆☆☆ \n" VT_RST);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B316B0.s")
if (gSaveContext.eventChkInf[4] & 0x400) {
Actor_Kill(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80B31850);
break;
case 3:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ Wow wa wa na wa saa ki ha (^o^) ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n" VT_RST);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31700.s")
if (gSaveContext.eventChkInf[4] & 0x400) {
Actor_Kill(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80B31924);
break;
case 4:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n" VT_RST);
if (gSaveContext.eventChkInf[4] & 0x200) {
Actor_Kill(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80B317A8);
break;
case 5:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ Cloudy Rain Thunder (;O;) Uo Melancholy ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり雨雷 (;O;) うおお 憂鬱 ☆☆☆☆☆ \n" VT_RST);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31758.s")
temp_v0 = gSaveContext.eventChkInf[4];
if ((((temp_v0 & 0x100) == 0) || ((temp_v0 & 0x200) == 0) || ((temp_v0 & 0x400) == 0)) ||
CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
Actor_Kill(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80B31A10);
break;
case 6:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ The desert becomes thicker ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 砂漠が濃くなります ☆☆☆☆☆ \n" VT_RST);
EnWeatherTag_SetupAction(this, func_80B31B24);
break;
case 7:
osSyncPrintf("\n\n");
//"☆☆☆☆☆ Wow wa wa na wa saa ki ha (^o^) ☆☆☆☆☆"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n" VT_RST);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B317A8.s")
EnWeatherTag_SetupAction(this, func_80B31C20);
break;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31800.s")
u8 func_80B312C8(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 arg4, u8 arg5, u16 arg6, u8 arg7) {
s32 pad;
u8 ret = 0;
Player* player = PLAYER;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31850.s")
if (func_8002DB8C(&player->actor, &this->actor) < (this->actor.params >> 8) * 100.0f) {
if ((globalCtx->envCtx.unk_1E != 0) ||
(!D_8011FB3C || !(globalCtx->skyboxId == 1 || globalCtx->envCtx.unk_1F != globalCtx->envCtx.unk_20))) {
D_8011FB38 = 1;
if (globalCtx->envCtx.gloomySkyEvent == 0 &&
((globalCtx->envCtx.unk_1E != 0) ||
(!(globalCtx->envCtx.unk_1F == 1 || globalCtx->envCtx.unk_21 != 0)))) {
D_8011FB38 = 0;
if (D_8011FB30 != arg7) {
D_8011FB30 = arg7;
if (globalCtx->envCtx.gloomySkyEvent == 0) {
globalCtx->envCtx.unk_19 = 1;
globalCtx->envCtx.gloomySky = arg2;
globalCtx->envCtx.unk_18 = arg3;
globalCtx->envCtx.unk_1A = arg6;
globalCtx->envCtx.unk_21 = 1;
globalCtx->envCtx.unk_1F = arg4;
globalCtx->envCtx.unk_20 = arg5;
D_8011FB34 = arg5;
globalCtx->envCtx.unk_24 = arg6;
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B318C0.s")
ret = 1;
}
} else {
if (D_8011FB40 != 0) {
gSaveContext.dayTime += 0x14;
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31924.s")
return ret;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B319A0.s")
u8 func_80B3149C(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 arg4, u8 arg5, u16 arg6) {
s32 pad;
u8 ret = 0;
Player* player = PLAYER;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31A10.s")
if ((((this->actor.params >> 8) * 100.0f) + 100.0f) < func_8002DB8C(&player->actor, &this->actor)) {
if ((globalCtx->envCtx.unk_1E != 0) ||
(!D_8011FB3C || !(globalCtx->skyboxId == 1 || globalCtx->envCtx.unk_1F != globalCtx->envCtx.unk_20))) {
D_8011FB38 = 1;
if ((globalCtx->envCtx.gloomySkyEvent == 0) &&
((globalCtx->envCtx.unk_1E != 0) ||
(!(globalCtx->envCtx.unk_1F == 1 || globalCtx->envCtx.unk_21 != 0)))) {
D_8011FB38 = 0;
D_8011FB30 = 0;
globalCtx->envCtx.unk_19 = 1;
globalCtx->envCtx.gloomySky = arg2;
globalCtx->envCtx.unk_18 = arg3;
globalCtx->envCtx.unk_1A = arg6;
globalCtx->envCtx.unk_21 = 1;
globalCtx->envCtx.unk_1F = arg4;
globalCtx->envCtx.unk_20 = arg5;
D_8011FB34 = arg5;
globalCtx->envCtx.unk_24 = arg6;
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31AA0.s")
ret = 1;
}
} else {
if (D_8011FB40 != 0) {
gSaveContext.dayTime += 0x14;
}
}
}
return ret;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31B24.s")
void func_80B31658(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B312C8(this, globalCtx, 0, 1, 0, 3, 0x3C, 1) != 0) {
EnWeatherTag_SetupAction(this, func_80B316B0);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31C20.s")
void func_80B316B0(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B3149C(this, globalCtx, 1, 0, 3, 0, 0x3C) != 0) {
EnWeatherTag_SetupAction(this, func_80B31658);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/func_80B31CC0.s")
void func_80B31700(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B312C8(this, globalCtx, 0, 1, 0, 2, 0x64, 2) != 0) {
EnWeatherTag_SetupAction(this, func_80B31758);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weather_Tag/EnWeatherTag_Update.s")
void func_80B31758(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B3149C(this, globalCtx, 1, 0, 2, 0, 0x64) != 0) {
EnWeatherTag_SetupAction(this, func_80B31700);
}
}
void func_80B317A8(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B312C8(this, globalCtx, 0, 1, 0, 2, 0x3C, 2) != 0) {
EnWeatherTag_SetupAction(this, func_80B31800);
}
}
void func_80B31800(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B3149C(this, globalCtx, 1, 0, 2, 0, 0x3C) != 0) {
EnWeatherTag_SetupAction(this, func_80B31700);
}
}
void func_80B31850(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B312C8(this, globalCtx, 0, 1, 0, 2, 0x3C, 3) != 0) {
globalCtx->envCtx.unk_EE[3] = 0x40;
EnWeatherTag_SetupAction(this, func_80B318C0);
}
}
void func_80B318C0(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B3149C(this, globalCtx, 1, 0, 2, 0, 0x3C) != 0) {
globalCtx->envCtx.unk_EE[3] = 0;
EnWeatherTag_SetupAction(this, func_80B31850);
}
}
void func_80B31924(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B312C8(this, globalCtx, 0, 1, 0, 2, 0x64, 4) != 0) {
func_80077624(globalCtx);
globalCtx->envCtx.unk_EE[0] = 0x19;
EnWeatherTag_SetupAction(this, func_80B319A0);
}
}
void func_80B319A0(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B3149C(this, globalCtx, 1, 0, 2, 0, 0x64) != 0) {
func_80077684(globalCtx);
globalCtx->envCtx.unk_EE[0] = 0;
EnWeatherTag_SetupAction(this, func_80B31924);
}
}
void func_80B31A10(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B312C8(this, globalCtx, 0, 1, 0, 4, 0x64, 5) != 0) {
func_80077624(globalCtx);
globalCtx->envCtx.lightning = 1;
globalCtx->envCtx.unk_EE[0] = 0x1E;
EnWeatherTag_SetupAction(this, func_80B31AA0);
}
}
void func_80B31AA0(EnWeatherTag* this, GlobalContext* globalCtx) {
if (func_80B3149C(this, globalCtx, 1, 0, 4, 0, 0x64) != 0) {
func_80077684(globalCtx);
globalCtx->envCtx.lightning = 2;
globalCtx->envCtx.unk_EE[0] = 0;
EnWeatherTag_SetupAction(this, func_80B31A10);
}
}
void func_80B31B24(EnWeatherTag* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (func_8002DB8C(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) {
Math_SmoothScaleMaxMinS(&globalCtx->envCtx.unk_9E, -0x50, 1, 2, 1);
Math_SmoothScaleMaxMinS(&globalCtx->envCtx.unk_A0, -0x7D0, 1, 0x32, 1);
} else {
Math_SmoothScaleMaxMinS(&globalCtx->envCtx.unk_9E, 0, 1, 1, 1);
Math_SmoothScaleMaxMinS(&globalCtx->envCtx.unk_A0, 0, 1, 0x19, 1);
}
}
void func_80B31C20(EnWeatherTag* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (func_8002DB8C(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) {
func_80077624(globalCtx);
globalCtx->envCtx.lightning = 1;
globalCtx->envCtx.unk_EE[0] = 0x19;
EnWeatherTag_SetupAction(this, func_80B31CC0);
}
}
void func_80B31CC0(EnWeatherTag* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if ((((this->actor.params >> 8) * 100.0f) + 10.0f) < func_8002DB8C(&player->actor, &this->actor)) {
func_80077684(globalCtx);
globalCtx->envCtx.lightning = 2;
globalCtx->envCtx.unk_EE[0] = 0;
globalCtx->envCtx.unk_EE[1] = 0xA;
EnWeatherTag_SetupAction(this, func_80B31C20);
}
}
void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) {
EnWeatherTag* this = THIS;
this->actionFunc(this, globalCtx);
if (BREG(0) != 0) {
DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z,
this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f,
1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx);
}
}

View file

@ -6,9 +6,12 @@
struct EnWeatherTag;
typedef void (*EnWeatherTagActionFunc)(struct EnWeatherTag*, GlobalContext*);
typedef struct EnWeatherTag {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x8];
/* 0x014C */ EnWeatherTagActionFunc actionFunc;
/* 0x0150 */ char unk_150[0x04];
} EnWeatherTag; // size = 0x0154
extern const ActorInit En_Weather_Tag_InitVars;