mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-11 03:23:46 +00:00
Fix misc 11 (#1209)
* Pass boolean for `freezeFlag` to `Actor_SetDropFlag` * Use `else if`s in `func_80835F44` * Cleanup `transitionCtx` usage of instance data * `TransitionContext.setEnvColor` -> `TransitionContext.setUnkColor` * Fixup one comment * linebreaks (#1) * Run formatter Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
parent
765cfd63e9
commit
ca77b26c90
35 changed files with 79 additions and 93 deletions
|
@ -1421,7 +1421,7 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP);
|
|||
s32 TransitionCircle_IsDone(void* thisx);
|
||||
void TransitionCircle_SetType(void* thisx, s32 type);
|
||||
void TransitionCircle_SetColor(void* thisx, u32 color);
|
||||
void TransitionCircle_SetEnvColor(void* thisx, u32 color);
|
||||
void TransitionCircle_SetUnkColor(void* thisx, u32 color);
|
||||
void TransitionFade_Start(void* this);
|
||||
void* TransitionFade_Init(void* this);
|
||||
void TransitionFade_Destroy(void* this);
|
||||
|
|
|
@ -1101,8 +1101,7 @@ typedef struct {
|
|||
TransitionCircle circle;
|
||||
TransitionTriforce triforce;
|
||||
TransitionWipe wipe;
|
||||
char data[0x228];
|
||||
};
|
||||
} instanceData;
|
||||
/* 0x228 */ s32 transitionType;
|
||||
/* 0x22C */ void* (*init)(void* transition);
|
||||
/* 0x230 */ void (*destroy)(void* transition);
|
||||
|
@ -1111,7 +1110,7 @@ typedef struct {
|
|||
/* 0x23C */ void (*start)(void* transition);
|
||||
/* 0x240 */ void (*setType)(void* transition, s32 type);
|
||||
/* 0x244 */ void (*setColor)(void* transition, u32 color);
|
||||
/* 0x248 */ void (*setEnvColor)(void* transition, u32 color);
|
||||
/* 0x248 */ void (*setUnkColor)(void* transition, u32 color);
|
||||
/* 0x24C */ s32 (*isDone)(void* transition);
|
||||
} TransitionContext; // size = 0x250
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x000 */ Color_RGBA8_u32 color;
|
||||
/* 0x004 */ Color_RGBA8_u32 envColor;
|
||||
/* 0x004 */ Color_RGBA8_u32 unkColor;
|
||||
/* 0x008 */ s32 texX;
|
||||
/* 0x00C */ s32 texY;
|
||||
/* 0x010 */ s32 speed;
|
||||
|
|
|
@ -5302,7 +5302,7 @@ s32 Camera_Unique9(Camera* camera) {
|
|||
camera->roll = anim->rollTarget;
|
||||
break;
|
||||
case 16:
|
||||
// same as 16, but don't unset bit 0x8 on unk_14C
|
||||
// same as 21, but don't unset bit 0x8 on unk_14C
|
||||
if (anim->unk_38 == 0) {
|
||||
anim->unk_38 = 1;
|
||||
} else if (camera->unk_14C & 8) {
|
||||
|
|
|
@ -204,8 +204,8 @@ void TransitionCircle_SetColor(void* thisx, u32 color) {
|
|||
this->color.rgba = color;
|
||||
}
|
||||
|
||||
void TransitionCircle_SetEnvColor(void* thisx, u32 envColor) {
|
||||
void TransitionCircle_SetUnkColor(void* thisx, u32 unkColor) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
this->envColor.rgba = envColor;
|
||||
this->unkColor.rgba = unkColor;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) {
|
|||
transitionCtx->update = TransitionCircle_Update;
|
||||
transitionCtx->setType = TransitionCircle_SetType;
|
||||
transitionCtx->setColor = TransitionCircle_SetColor;
|
||||
transitionCtx->setEnvColor = TransitionCircle_SetEnvColor;
|
||||
transitionCtx->setUnkColor = TransitionCircle_SetUnkColor;
|
||||
} else {
|
||||
switch (transitionCtx->transitionType) {
|
||||
case TRANS_TYPE_TRIFORCE:
|
||||
|
@ -72,7 +72,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) {
|
|||
transitionCtx->update = TransitionTriforce_Update;
|
||||
transitionCtx->setType = TransitionTriforce_SetType;
|
||||
transitionCtx->setColor = TransitionTriforce_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
transitionCtx->setUnkColor = NULL;
|
||||
break;
|
||||
|
||||
case TRANS_TYPE_WIPE:
|
||||
|
@ -85,7 +85,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) {
|
|||
transitionCtx->update = TransitionWipe_Update;
|
||||
transitionCtx->setType = TransitionWipe_SetType;
|
||||
transitionCtx->setColor = TransitionWipe_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
transitionCtx->setUnkColor = NULL;
|
||||
break;
|
||||
|
||||
case TRANS_TYPE_FADE_BLACK:
|
||||
|
@ -106,7 +106,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) {
|
|||
transitionCtx->update = TransitionFade_Update;
|
||||
transitionCtx->setType = TransitionFade_SetType;
|
||||
transitionCtx->setColor = TransitionFade_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
transitionCtx->setUnkColor = NULL;
|
||||
break;
|
||||
|
||||
case TRANS_TYPE_FILL_WHITE2:
|
||||
|
@ -170,7 +170,7 @@ void Gameplay_Destroy(GameState* thisx) {
|
|||
}
|
||||
|
||||
if (globalCtx->transitionMode == TRANS_MODE_INSTANCE_RUNNING) {
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.data);
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData);
|
||||
func_800BC88C(globalCtx);
|
||||
globalCtx->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
|
@ -515,11 +515,11 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
}
|
||||
// fallthrough
|
||||
case TRANS_MODE_INSTANCE_INIT:
|
||||
globalCtx->transitionCtx.init(&globalCtx->transitionCtx.data);
|
||||
globalCtx->transitionCtx.init(&globalCtx->transitionCtx.instanceData);
|
||||
|
||||
// circle types
|
||||
if ((globalCtx->transitionCtx.transitionType >> 5) == 1) {
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data,
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData,
|
||||
globalCtx->transitionCtx.transitionType | TC_SET_PARAMS);
|
||||
}
|
||||
|
||||
|
@ -549,40 +549,44 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) ||
|
||||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) ||
|
||||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(160, 160, 160, 255));
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(160, 160, 160, 255));
|
||||
if (globalCtx->transitionCtx.setUnkColor != NULL) {
|
||||
globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(160, 160, 160, 255));
|
||||
}
|
||||
} else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(140, 140, 100, 255));
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(140, 140, 100, 255));
|
||||
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
if (globalCtx->transitionCtx.setUnkColor != NULL) {
|
||||
globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(140, 140, 100, 255));
|
||||
}
|
||||
} else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(70, 100, 110, 255));
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(70, 100, 110, 255));
|
||||
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
if (globalCtx->transitionCtx.setUnkColor != NULL) {
|
||||
globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(70, 100, 110, 255));
|
||||
}
|
||||
} else {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0));
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, RGBA8(0, 0, 0, 0));
|
||||
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0));
|
||||
if (globalCtx->transitionCtx.setUnkColor != NULL) {
|
||||
globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData,
|
||||
RGBA8(0, 0, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 1);
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, 1);
|
||||
} else {
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 2);
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, 2);
|
||||
}
|
||||
|
||||
globalCtx->transitionCtx.start(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.start(&globalCtx->transitionCtx.instanceData);
|
||||
|
||||
if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) {
|
||||
globalCtx->transitionMode = TRANS_MODE_INSTANCE_WAIT;
|
||||
|
@ -592,10 +596,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
break;
|
||||
|
||||
case TRANS_MODE_INSTANCE_RUNNING:
|
||||
if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx)) {
|
||||
if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx.instanceData)) {
|
||||
if (globalCtx->transitionCtx.transitionType >= TRANS_TYPE_MAX) {
|
||||
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData);
|
||||
func_800BC88C(globalCtx);
|
||||
globalCtx->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
|
@ -613,7 +617,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
SET_NEXT_GAMESTATE(&globalCtx->state, FileChoose_Init, FileChooseContext);
|
||||
}
|
||||
} else {
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData);
|
||||
func_800BC88C(globalCtx);
|
||||
globalCtx->transitionMode = TRANS_MODE_OFF;
|
||||
|
||||
|
@ -626,7 +630,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
|
||||
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
} else {
|
||||
globalCtx->transitionCtx.update(&globalCtx->transitionCtx.data, R_UPDATE_RATE);
|
||||
globalCtx->transitionCtx.update(&globalCtx->transitionCtx.instanceData, R_UPDATE_RATE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1161,7 +1165,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
|||
SET_FULLSCREEN_VIEWPORT(&view);
|
||||
|
||||
View_ApplyTo(&view, VIEW_ALL, &gfxP);
|
||||
globalCtx->transitionCtx.draw(&globalCtx->transitionCtx.data, &gfxP);
|
||||
globalCtx->transitionCtx.draw(&globalCtx->transitionCtx.instanceData, &gfxP);
|
||||
}
|
||||
|
||||
TransitionFade_Draw(&globalCtx->transitionFade, &gfxP);
|
||||
|
|
|
@ -799,7 +799,7 @@ void EnAm_UpdateDamage(EnAm* this, GlobalContext* globalCtx) {
|
|||
if (this->dyna.actor.colChkInfo.damageEffect != AM_DMGEFF_MAGIC_FIRE_LIGHT) {
|
||||
this->unk_264 = 0;
|
||||
this->damageEffect = this->dyna.actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->dyna.actor, &this->hurtCollider.info, 0);
|
||||
Actor_SetDropFlag(&this->dyna.actor, &this->hurtCollider.info, false);
|
||||
|
||||
if ((this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_NUT) ||
|
||||
(this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) ||
|
||||
|
|
|
@ -1150,7 +1150,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) {
|
|||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
this->dmgEffect = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, 0);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, false);
|
||||
switch (this->dmgEffect) {
|
||||
case 7:
|
||||
this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage;
|
||||
|
|
|
@ -549,7 +549,7 @@ void EnBili_UpdateDamage(EnBili* this, GlobalContext* globalCtx) {
|
|||
|
||||
if ((this->actor.colChkInfo.health != 0) && (this->collider.base.acFlags & AC_HIT)) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (Actor_ApplyDamage(&this->actor) == 0) {
|
||||
|
|
|
@ -688,7 +688,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
this->damageEffect = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider2.info, 0);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider2.info, false);
|
||||
if ((this->damageEffect == 1) || (this->damageEffect == 0xE)) {
|
||||
if (this->unk_23C == 0) {
|
||||
Actor_ApplyDamage(&this->actor);
|
||||
|
|
|
@ -412,7 +412,7 @@ void EnCrow_Respawn(EnCrow* this, GlobalContext* globalCtx) {
|
|||
void EnCrow_UpdateDamage(EnCrow* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, true);
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (this->actor.colChkInfo.damageEffect == 1) { // Deku Nuts
|
||||
EnCrow_SetupTurnAway(this);
|
||||
|
|
|
@ -1032,7 +1032,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->collider, 1);
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->collider, true);
|
||||
|
||||
if ((this->collider.base.colType != COLTYPE_HARD) &&
|
||||
((this->actor.colChkInfo.damageEffect != DEKUBABA_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0))) {
|
||||
|
|
|
@ -444,7 +444,7 @@ void EnDekunuts_Die(EnDekunuts* this, GlobalContext* globalCtx) {
|
|||
void EnDekunuts_ColliderCheck(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if (this->actor.colChkInfo.mass == 0x32) {
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (this->actor.colChkInfo.damageEffect != 1) {
|
||||
|
|
|
@ -717,7 +717,7 @@ void EnDodongo_CollisionCheck(EnDodongo* this, GlobalContext* globalCtx) {
|
|||
this->colliderBody.base.acFlags &= ~AC_HIT;
|
||||
} else if ((this->colliderBody.base.acFlags & AC_HIT) && (this->actionState > DODONGO_DEATH)) {
|
||||
this->colliderBody.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->colliderBody, 0);
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->colliderBody, false);
|
||||
if (this->actor.colChkInfo.damageEffect != 0xE) {
|
||||
this->damageEffect = this->actor.colChkInfo.damageEffect;
|
||||
if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 0xF)) {
|
||||
|
|
|
@ -603,7 +603,7 @@ void EnEiyer_Stunned(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
void EnEiyer_UpdateDamage(EnEiyer* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
|
||||
if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) {
|
||||
if (Actor_ApplyDamage(&this->actor) == 0) {
|
||||
|
|
|
@ -622,7 +622,7 @@ void EnFirefly_UpdateDamage(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, true);
|
||||
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (Actor_ApplyDamage(&this->actor) == 0) {
|
||||
|
|
|
@ -979,7 +979,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
|
||||
if ((this->collider.base.acFlags & AC_HIT) != 0) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (this->collider.base.colType != COLTYPE_HARD) {
|
||||
isSmall = 0;
|
||||
|
|
|
@ -1370,7 +1370,7 @@ void EnGeldB_CollisionCheck(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
this->bodyCollider.base.acFlags &= ~AC_HIT;
|
||||
if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) {
|
||||
this->damageEffect = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true);
|
||||
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH);
|
||||
if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) ||
|
||||
(this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) {
|
||||
|
|
|
@ -461,7 +461,7 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) {
|
|||
void EnHintnuts_ColliderCheck(EnHintnuts* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if (this->collider.base.ac->id != ACTOR_EN_NUTSBALL) {
|
||||
EnHintnuts_SetupBurrow(this);
|
||||
} else {
|
||||
|
|
|
@ -683,7 +683,7 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
sp38 = this->actor.world.pos;
|
||||
sp38.y += 50.0f;
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true);
|
||||
temp_v0_3 = this->actor.colChkInfo.damageEffect;
|
||||
this->unk_2FD = temp_v0_3 & 0xFF;
|
||||
this->bodyCollider.base.acFlags &= ~AC_HIT;
|
||||
|
|
|
@ -555,7 +555,7 @@ void EnOkuta_UpdateHeadScale(EnOkuta* this) {
|
|||
void EnOkuta_ColliderCheck(EnOkuta* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
Enemy_StartFinishingBlow(globalCtx, &this->actor);
|
||||
this->actor.colChkInfo.health = 0;
|
||||
|
|
|
@ -884,7 +884,7 @@ void EnPeehat_Adult_CollisionCheck(EnPeehat* this, GlobalContext* globalCtx) {
|
|||
this->colJntSph.base.acFlags &= ~AC_HIT;
|
||||
} else if (this->colJntSph.base.acFlags & AC_HIT) {
|
||||
this->colJntSph.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->colJntSph, 1);
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->colJntSph, true);
|
||||
if (this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_NUT ||
|
||||
this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_LIGHT_ICE_ARROW) {
|
||||
return;
|
||||
|
|
|
@ -1133,7 +1133,7 @@ void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if (this->unk_195 != 0) {
|
||||
((EnPoSisters*)this->actor.parent)->unk_19C--;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2);
|
||||
|
|
|
@ -753,7 +753,7 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) {
|
|||
this->unk_31C = this->actor.colChkInfo.damageEffect;
|
||||
|
||||
if (this->unk_31B != 11) {
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if (player->unk_844 != 0) {
|
||||
this->unk_31D = player->unk_845;
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ void EnShopnuts_SpawnSalesman(EnShopnuts* this, GlobalContext* globalCtx) {
|
|||
void EnShopnuts_ColliderCheck(EnShopnuts* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
EnShopnuts_SetupSpawnSalesman(this);
|
||||
} else if (globalCtx->actorCtx.unk_02 != 0) {
|
||||
EnShopnuts_SetupSpawnSalesman(this);
|
||||
|
|
|
@ -449,7 +449,7 @@ void func_80AFD968(EnSkb* this, GlobalContext* globalCtx) {
|
|||
this->collider.base.acFlags &= ~2;
|
||||
if (this->actor.colChkInfo.damageEffect != 6) {
|
||||
this->unk_282 = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, true);
|
||||
this->unk_281 = 0;
|
||||
if (this->actor.colChkInfo.damageEffect == 1) {
|
||||
if (this->unk_280 != 6) {
|
||||
|
|
|
@ -852,7 +852,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
if (thisx->colChkInfo.damageEffect != 0xE) { // Immune to fire magic
|
||||
this->damageEffect = thisx->colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(thisx, &this->collider.elements[0].info, 0);
|
||||
Actor_SetDropFlag(thisx, &this->collider.elements[0].info, false);
|
||||
// Stun if Tektite hit by nut, boomerang, hookshot, ice arrow or ice magic
|
||||
if ((thisx->colChkInfo.damageEffect == 1) || (thisx->colChkInfo.damageEffect == 0xF)) {
|
||||
if (this->action != TEKTITE_STUNNED) {
|
||||
|
|
|
@ -600,7 +600,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->unk_8A8 = 6.0f;
|
||||
this->unk_8A4 = 8.0f;
|
||||
this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000;
|
||||
Actor_SetDropFlag(&this->actor, &this->cylinder.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->cylinder.info, true);
|
||||
this->stateFlags3 &= ~PLAYER_STATE3_2;
|
||||
this->stateFlags3 |= PLAYER_STATE3_0;
|
||||
sActionState = ENTORCH2_DAMAGE;
|
||||
|
|
|
@ -578,7 +578,7 @@ void EnTp_UpdateDamage(EnTp* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->collider, 1);
|
||||
Actor_SetDropFlagJntSph(&this->actor, &this->collider, true);
|
||||
this->damageEffect = this->actor.colChkInfo.damageEffect;
|
||||
|
||||
if (this->actor.colChkInfo.damageEffect != TAILPASARAN_DMGEFF_NONE) {
|
||||
|
|
|
@ -496,7 +496,7 @@ void EnVali_ReturnToLurk(EnVali* this, GlobalContext* globalCtx) {
|
|||
void EnVali_UpdateDamage(EnVali* this, GlobalContext* globalCtx) {
|
||||
if (this->bodyCollider.base.acFlags & AC_HIT) {
|
||||
this->bodyCollider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true);
|
||||
|
||||
if ((this->actor.colChkInfo.damageEffect != BARI_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (Actor_ApplyDamage(&this->actor) == 0) {
|
||||
|
|
|
@ -503,7 +503,7 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) {
|
|||
void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
if ((this->collider.base.acFlags & AC_HIT) != 0) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (Actor_ApplyDamage(&this->actor) == 0) {
|
||||
Enemy_StartFinishingBlow(globalCtx, &this->actor);
|
||||
|
|
|
@ -562,7 +562,7 @@ void func_80B3349C(EnWeiyer* this, GlobalContext* globalCtx) {
|
|||
void func_80B3368C(EnWeiyer* this, GlobalContext* globalCtx) {
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->collider.info, true);
|
||||
|
||||
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
|
||||
if (this->actor.colChkInfo.damageEffect == 1) {
|
||||
|
|
|
@ -1266,7 +1266,7 @@ void EnWf_UpdateDamage(EnWf* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) {
|
||||
this->damageEffect = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.info, 1);
|
||||
Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.info, true);
|
||||
this->slashStatus = 0;
|
||||
|
||||
if ((this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_STUN) ||
|
||||
|
|
|
@ -2002,7 +2002,7 @@ void EnZf_UpdateDamage(EnZf* this, GlobalContext* globalCtx) {
|
|||
(D_80B4A1B4 != this->actor.params)) &&
|
||||
(this->actor.colChkInfo.damageEffect != ENZF_DMGEFF_IMMUNE)) {
|
||||
this->damageEffect = this->actor.colChkInfo.damageEffect;
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 0);
|
||||
Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, false);
|
||||
|
||||
if ((this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_STUN) ||
|
||||
(this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_ICE)) {
|
||||
|
|
|
@ -2881,34 +2881,25 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) {
|
|||
((temp >= 0) && ((AMMO(sExplosiveInfos[temp].itemId) == 0) ||
|
||||
(globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3)))))) {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (actionParam == PLAYER_AP_LENS) {
|
||||
} else if (actionParam == PLAYER_AP_LENS) {
|
||||
if (func_80087708(globalCtx, 0, 3)) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
Actor_DisableLens(globalCtx);
|
||||
} else {
|
||||
globalCtx->actorCtx.lensActive = true;
|
||||
}
|
||||
|
||||
func_80078884((globalCtx->actorCtx.lensActive) ? NA_SE_SY_GLASSMODE_ON : NA_SE_SY_GLASSMODE_OFF);
|
||||
} else {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (actionParam == PLAYER_AP_NUT) {
|
||||
} else if (actionParam == PLAYER_AP_NUT) {
|
||||
if (AMMO(ITEM_NUT) != 0) {
|
||||
func_8083C61C(globalCtx, this);
|
||||
} else {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
temp = Player_ActionToMagicSpell(this, actionParam);
|
||||
if (temp >= 0) {
|
||||
} else if ((temp = Player_ActionToMagicSpell(this, actionParam)) >= 0) {
|
||||
if (((actionParam == PLAYER_AP_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) ||
|
||||
((gSaveContext.unk_13F4 != 0) && (gSaveContext.unk_13F0 == 0) &&
|
||||
(gSaveContext.magic >= sMagicSpellCosts[temp]))) {
|
||||
|
@ -2917,34 +2908,27 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) {
|
|||
} else {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (actionParam >= PLAYER_AP_MASK_KEATON) {
|
||||
} else if (actionParam >= PLAYER_AP_MASK_KEATON) {
|
||||
if (this->currentMask != PLAYER_MASK_NONE) {
|
||||
this->currentMask = PLAYER_MASK_NONE;
|
||||
} else {
|
||||
this->currentMask = actionParam - PLAYER_AP_MASK_KEATON + 1;
|
||||
}
|
||||
func_808328EC(this, NA_SE_PL_CHANGE_ARMS);
|
||||
return;
|
||||
}
|
||||
|
||||
if (((actionParam >= PLAYER_AP_OCARINA_FAIRY) && (actionParam <= PLAYER_AP_OCARINA_TIME)) ||
|
||||
(actionParam >= PLAYER_AP_BOTTLE_FISH)) {
|
||||
func_808328EC(this, NA_SE_PL_CHANGE_ARMS);
|
||||
} else if (((actionParam >= PLAYER_AP_OCARINA_FAIRY) && (actionParam <= PLAYER_AP_OCARINA_TIME)) ||
|
||||
(actionParam >= PLAYER_AP_BOTTLE_FISH)) {
|
||||
if (!func_8008E9C4(this) ||
|
||||
((actionParam >= PLAYER_AP_BOTTLE_POTION_RED) && (actionParam <= PLAYER_AP_BOTTLE_FAIRY))) {
|
||||
TitleCard_Clear(globalCtx, &globalCtx->actorCtx.titleCtx);
|
||||
this->unk_6AD = 4;
|
||||
this->itemActionParam = actionParam;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ((actionParam != this->heldItemActionParam) ||
|
||||
((this->heldActor == 0) && (Player_ActionToExplosive(this, actionParam) >= 0))) {
|
||||
} else if ((actionParam != this->heldItemActionParam) ||
|
||||
((this->heldActor == 0) && (Player_ActionToExplosive(this, actionParam) >= 0))) {
|
||||
this->nextModelGroup = Player_ActionToModelGroup(this, actionParam);
|
||||
nextAnimType = gPlayerModelTypes[this->nextModelGroup][PLAYER_MODELGROUPENTRY_ANIM];
|
||||
|
||||
if ((this->heldItemActionParam >= 0) && (Player_ActionToMagicSpell(this, actionParam) < 0) &&
|
||||
(item != this->heldItemId) &&
|
||||
(D_80854164[gPlayerModelTypes[this->modelGroup][PLAYER_MODELGROUPENTRY_ANIM]][nextAnimType] !=
|
||||
|
@ -2956,10 +2940,9 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) {
|
|||
func_808323B4(globalCtx, this);
|
||||
func_80833664(globalCtx, this, actionParam);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
D_80853614 = D_80853618 = true;
|
||||
}
|
||||
|
||||
D_80853614 = D_80853618 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue