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

En_Heishi1 and Eff_Ss_Solder_Srch_Ball OK (#234)

* progress

* init ok and merge master

* enheishi1 and srchball OK

* cleanup

* cleanup

* cleanup

* more cleanup

* done

* more comments

* add file headers

* some review comments

* move vectors

* more review comments

* angle in decimal

* add prototype

* semicolon would be good

* fix

* make unset actor ids 0

* reword comment

* no &
This commit is contained in:
fig02 2020-07-09 15:12:03 -04:00 committed by GitHub
parent b4a7ac9d71
commit 8b6e86649d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 636 additions and 1880 deletions

View file

@ -2106,7 +2106,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
actor->yawTowardsLink = func_8002DA78(actor, &player->actor);
actor->flags &= ~0x1000000;
if ((DECR(actor->freeze) == 0) && (actor->flags & 0x50)) {
if ((DECR(actor->freezeTimer) == 0) && (actor->flags & 0x50)) {
if (actor == player->unk_664) {
actor->unk_10C = 1;
} else {
@ -2499,14 +2499,14 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) {
u8 sEnemyActorTypes[] = { ACTORTYPE_ENEMY, ACTORTYPE_BOSS };
void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 freezeValue) {
void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 duration) {
Actor* actor;
s32 i;
for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++) {
actor = actorCtx->actorList[sEnemyActorTypes[i]].first;
while (actor != NULL) {
actor->freeze = freezeValue;
actor->freezeTimer = duration;
actor = actor->next;
}
}
@ -4050,7 +4050,7 @@ void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) {
if (colBody->acHitItem == NULL) {
actor->unk_116 = 0x00;
} else if (freezeFlag && (colBody->acHitItem->toucher.flags & 0x10060000)) {
actor->freeze = colBody->acHitItem->toucher.damage;
actor->freezeTimer = colBody->acHitItem->toucher.damage;
actor->unk_116 = 0x00;
} else if (colBody->acHitItem->toucher.flags & 0x0800) {
actor->unk_116 = 0x01;
@ -4066,7 +4066,7 @@ void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) {
actor->unk_116 = 0x20;
} else if ((colBody->acHitItem->toucher.flags << 0xC) < 0) {
if (freezeFlag) {
actor->freeze = colBody->acHitItem->toucher.damage;
actor->freezeTimer = colBody->acHitItem->toucher.damage;
}
actor->unk_116 = 0x40;
} else {
@ -4086,7 +4086,7 @@ void func_8003573C(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) {
if (curColBody->acHitItem == NULL) {
flag = 0x00;
} else if (freezeFlag && (curColBody->acHitItem->toucher.flags & 0x10060000)) {
actor->freeze = curColBody->acHitItem->toucher.damage;
actor->freezeTimer = curColBody->acHitItem->toucher.damage;
flag = 0x00;
} else if (curColBody->acHitItem->toucher.flags & 0x0800) {
flag = 0x01;
@ -4102,7 +4102,7 @@ void func_8003573C(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) {
flag = 0x20;
} else if (curColBody->acHitItem->toucher.flags & 0x80000) {
if (freezeFlag) {
actor->freeze = curColBody->acHitItem->toucher.damage;
actor->freezeTimer = curColBody->acHitItem->toucher.damage;
}
flag = 0x40;
} else {

View file

@ -3366,7 +3366,7 @@ void func_80059EC8(Camera* camera) {
Gameplay_ChangeCameraStatus(camera->globalCtx, camera->unk_162, 7);
if ((camera->unk_162 == 0) && (camera->unk_168 != 0)) {
player->actor.freeze = 0;
player->actor.freezeTimer = 0;
player->stateFlags1 &= ~0x20000000;
if (player->action != 0) {

View file

@ -1440,11 +1440,11 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx,
if (D_8011E1C0 != cmd->base) {
D_8011E1C0 = cmd->base;
if ((cmd->type == 3) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
func_8010B680(globalCtx, cmd->textId1, 0);
func_8010B680(globalCtx, cmd->textId1, NULL);
} else if ((cmd->type == 4) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
func_8010B680(globalCtx, cmd->textId1, 0);
func_8010B680(globalCtx, cmd->textId1, NULL);
} else {
func_8010B680(globalCtx, cmd->base, 0);
func_8010B680(globalCtx, cmd->base, NULL);
}
return;
}

View file

@ -89,7 +89,7 @@ void EffectSs_Reset(EffectSs* effectSs) {
effectSs->draw = NULL;
effectSs->update = NULL;
effectSs->unk_38 = 0;
effectSs->unk_3C = 0;
effectSs->unk_3C = NULL;
for (i = 0; i < ARRAY_COUNT(effectSs->regs); i++) {
effectSs->regs[i] = 0;

View file

@ -1,5 +1,6 @@
#include <ultra64.h>
#include <global.h>
#include "overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h"
// Draw utility for some G effects
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80027F80.s")
@ -168,9 +169,18 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80029DBC.s")
// EffectSsSolderSrchBall Spawn Functions
void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 arg4,
s16* linkDetected) {
EffectSsSolderSrchBallInitParams initParams;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80029E24.s")
Math_Vec3f_Copy(&initParams.pos, pos);
Math_Vec3f_Copy(&initParams.velocity, velocity);
Math_Vec3f_Copy(&initParams.accel, accel);
initParams.unk_24 = arg4;
initParams.linkDetected = linkDetected;
EffectSs_Spawn(globalCtx, EFFECT_SS_SOLDER_SRCH_BALL, 128, &initParams);
}
// EffectSsKakera Spawn Functions

View file

@ -3829,7 +3829,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
gSaveContext.timer2State = 5;
gSaveContext.cutsceneIndex = 0;
D_8015FFE6 = 40;
func_8010B680(globalCtx, 0x71B0, 0);
func_8010B680(globalCtx, 0x71B0, NULL);
func_8002DF54(globalCtx, 0, 8);
} else {
gSaveContext.timer2State = 6;
@ -3855,7 +3855,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
gSaveContext.timer2Value++;
if (gSaveContext.eventInf[1] & 1) {
if (gSaveContext.timer2Value == 240) {
func_8010B680(globalCtx, 0x6083, 0);
func_8010B680(globalCtx, 0x6083, NULL);
gSaveContext.timer2State = 0;
gSaveContext.eventInf[1] &= ~1;
}

View file

@ -323,7 +323,7 @@ void Gameplay_Init(GlobalContext* globalCtx) {
gSaveContext.dogIsLost = true;
if (Inventory_ReplaceItem(globalCtx, ITEM_WEIRD_EGG, ITEM_CHICKEN) ||
Inventory_ReplaceItem(globalCtx, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) {
func_8010B680(globalCtx, 0x3066, 0);
func_8010B680(globalCtx, 0x3066, NULL);
}
gSaveContext.nextDayTime = 0xFFFE;
} else {

View file

@ -389,7 +389,7 @@ s32 func_8008F2F8(GlobalContext* globalCtx) {
if (temp_a3->unk_0 != 0 && !(gSaveContext.unk_13C6 & temp_a3->unk_0) &&
((phi_v1 == 0 && player->currentTunic != 1) ||
((phi_v1 == 1 || phi_v1 == 3) && player->currentBoots == 1 && player->currentTunic != 2))) {
func_8010B680(globalCtx, temp_a3->unk_2, 0);
func_8010B680(globalCtx, temp_a3->unk_2, NULL);
gSaveContext.unk_13C6 |= temp_a3->unk_0;
}
}