diff --git a/include/functions.h b/include/functions.h index ad6eea2dff..9cc9cd25b4 100644 --- a/include/functions.h +++ b/include/functions.h @@ -414,12 +414,12 @@ u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play); s8 func_8002F368(PlayState* play); void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y); u32 Actor_HasParent(Actor* actor, PlayState* play); -s32 func_8002F434(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange); -void func_8002F554(Actor* actor, PlayState* play, s32 getItemId); -void func_8002F580(Actor* actor, PlayState* play); +s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange); +s32 Actor_OfferGetItemNearby(Actor* actor, PlayState* play, s32 getItemId); +s32 Actor_OfferCarry(Actor* actor, PlayState* play); u32 Actor_HasNoParent(Actor* actor, PlayState* play); void func_8002F5C4(Actor* actorA, Actor* actorB, PlayState* play); -void func_8002F5F0(Actor* actor, PlayState* play); +void Actor_SetClosestSecretDistance(Actor* actor, PlayState* play); s32 Actor_IsMounted(PlayState* play, Actor* horse); u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide); s32 Actor_NotMounted(PlayState* play, Actor* horse); @@ -442,7 +442,7 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* play void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx); s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3); void func_800315AC(PlayState* play, ActorContext* actorCtx); -void func_80031A28(PlayState* play, ActorContext* actorCtx); +void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx); void func_80031B14(PlayState* play, ActorContext* actorCtx); void func_80031C3C(ActorContext* actorCtx, PlayState* play); Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, @@ -481,7 +481,7 @@ f32 Rand_ZeroFloat(f32 f); f32 Rand_CenteredFloat(f32 f); void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type); void func_8003424C(PlayState* play, Vec3f* arg1); -void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 xluFlag, s16 duration); +void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration); Hilite* func_800342EC(Vec3f* object, PlayState* play); Hilite* func_8003435C(Vec3f* object, PlayState* play); s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange, diff --git a/include/z64actor.h b/include/z64actor.h index e6a933ca26..a9c5b910b7 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -169,6 +169,18 @@ typedef struct { #define ACTOR_FLAG_27 (1 << 27) #define ACTOR_FLAG_28 (1 << 28) +#define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5) +#define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF) + +#define COLORFILTER_COLORFLAG_GRAY 0x8000 +#define COLORFILTER_COLORFLAG_RED 0x4000 +#define COLORFILTER_COLORFLAG_BLUE 0x0000 + +#define COLORFILTER_INTENSITY_FLAG 0x8000 + +#define COLORFILTER_BUFFLAG_XLU 0x2000 +#define COLORFILTER_BUFFLAG_OPA 0x0000 + #define BGCHECKFLAG_GROUND (1 << 0) // Standing on the ground #define BGCHECKFLAG_GROUND_TOUCH (1 << 1) // Has touched the ground (only active for 1 frame) #define BGCHECKFLAG_GROUND_LEAVE (1 << 2) // Has left the ground (only active for 1 frame) diff --git a/include/z64player.h b/include/z64player.h index 8a75c4d5bd..056722eb7e 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -556,7 +556,7 @@ typedef struct Player { /* 0x0698 */ f32 targetActorDistance; /* 0x069C */ char unk_69C[0x004]; /* 0x06A0 */ f32 unk_6A0; - /* 0x06A4 */ f32 unk_6A4; + /* 0x06A4 */ f32 closestSecretDistSq; /* 0x06A8 */ Actor* unk_6A8; /* 0x06AC */ s8 unk_6AC; /* 0x06AD */ u8 unk_6AD; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 8197e5f18e..6f6bd29729 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1570,7 +1570,30 @@ u32 Actor_HasParent(Actor* actor, PlayState* play) { } } -s32 func_8002F434(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) { +/** + * This function covers various interactions with the player actor, using Get Item IDs (see `GetItemID` enum). + * It is typically used to give items to the player, but also has other purposes. + * + * This function carries a get item request to the player actor if context allows it (e.g. the player is in range and + * not busy with certain things). The player actor performs the requested action itself. + * + * The following description of what the `getItemId` values can do is provided here for completeness, but these + * behaviors are entirely out of the scope of this function. All behavior is defined by the player actor. + * + * - Positive values (`GI_NONE < getItemId < GI_MAX`): + * Give an item to the player. The player may not get it immediately (for example if diving), but is expected to + * in the near future. + * - Negative values (`-GI_MAX < getItemId < GI_NONE`): + * Used by treasure chests to indicate the chest can be opened (by pressing A). + * The item gotten corresponds to the positive Get Item ID `abs(getItemId)`. + * - `GI_NONE`: + * Allows the player to pick up the actor (by pressing A), to carry it around. + * - `GI_MAX`: + * Allows the player to catch specific actors in a bottle. + * + * @return true If the player actor is capable of accepting the offer. + */ +s32 Actor_OfferGetItem(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) { Player* player = GET_PLAYER(play); if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | @@ -1596,12 +1619,12 @@ s32 func_8002F434(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 return false; } -void func_8002F554(Actor* actor, PlayState* play, s32 getItemId) { - func_8002F434(actor, play, getItemId, 50.0f, 10.0f); +s32 Actor_OfferGetItemNearby(Actor* actor, PlayState* play, s32 getItemId) { + return Actor_OfferGetItem(actor, play, getItemId, 50.0f, 10.0f); } -void func_8002F580(Actor* actor, PlayState* play) { - func_8002F554(actor, play, GI_NONE); +s32 Actor_OfferCarry(Actor* actor, PlayState* play) { + return Actor_OfferGetItemNearby(actor, play, GI_NONE); } u32 Actor_HasNoParent(Actor* actor, PlayState* play) { @@ -1627,11 +1650,11 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, PlayState* play) { actorA->parent = NULL; } -void func_8002F5F0(Actor* actor, PlayState* play) { +void Actor_SetClosestSecretDistance(Actor* actor, PlayState* play) { Player* player = GET_PLAYER(play); - if (actor->xyzDistToPlayerSq < player->unk_6A4) { - player->unk_6A4 = actor->xyzDistToPlayerSq; + if (actor->xyzDistToPlayerSq < player->closestSecretDistSq) { + player->closestSecretDistSq = actor->xyzDistToPlayerSq; } } @@ -2218,25 +2241,25 @@ void Actor_Draw(PlayState* play, Actor* actor) { if (actor->colorFilterTimer != 0) { Color_RGBA8 color = { 0, 0, 0, 255 }; - if (actor->colorFilterParams & 0x8000) { - color.r = color.g = color.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; - } else if (actor->colorFilterParams & 0x4000) { - color.r = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + if (actor->colorFilterParams & COLORFILTER_COLORFLAG_GRAY) { + color.r = color.g = color.b = COLORFILTER_GET_COLORINTENSITY(actor->colorFilterParams) | 7; + } else if (actor->colorFilterParams & COLORFILTER_COLORFLAG_RED) { + color.r = COLORFILTER_GET_COLORINTENSITY(actor->colorFilterParams) | 7; } else { - color.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + color.b = COLORFILTER_GET_COLORINTENSITY(actor->colorFilterParams) | 7; } - if (actor->colorFilterParams & 0x2000) { - func_80026860(play, &color, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); + if (actor->colorFilterParams & COLORFILTER_BUFFLAG_XLU) { + func_80026860(play, &color, actor->colorFilterTimer, COLORFILTER_GET_DURATION(actor->colorFilterParams)); } else { - func_80026400(play, &color, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); + func_80026400(play, &color, actor->colorFilterTimer, COLORFILTER_GET_DURATION(actor->colorFilterParams)); } } actor->draw(actor, play); if (actor->colorFilterTimer != 0) { - if (actor->colorFilterParams & 0x2000) { + if (actor->colorFilterParams & COLORFILTER_BUFFLAG_XLU) { func_80026A6C(play); } else { func_80026608(play); @@ -2500,7 +2523,10 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) { CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 6563); } -void func_80031A28(PlayState* play, ActorContext* actorCtx) { +/** + * Kill every actor which depends on an object that is not loaded. + */ +void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx) { Actor* actor; s32 i; @@ -2530,6 +2556,9 @@ void Actor_FreezeAllEnemies(PlayState* play, ActorContext* actorCtx, s32 duratio } } +/** + * Kill actors on room change and update flags accordingly + */ void func_80031B14(PlayState* play, ActorContext* actorCtx) { Actor* actor; s32 i; @@ -3633,12 +3662,12 @@ void func_8003424C(PlayState* play, Vec3f* arg1) { CollisionCheck_SpawnShieldParticlesMetal(play, arg1); } -void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 xluFlag, s16 duration) { - if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) { +void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration) { + if ((colorFlag == COLORFILTER_COLORFLAG_GRAY) && !(colorIntensityMax & COLORFILTER_INTENSITY_FLAG)) { Audio_PlayActorSfx2(actor, NA_SE_EN_LIGHT_ARROW_HIT); } - actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration; + actor->colorFilterParams = colorFlag | bufFlag | ((colorIntensityMax & 0xF8) << 5) | duration; actor->colorFilterTimer = duration; } @@ -4061,7 +4090,7 @@ s32 func_80035124(Actor* actor, PlayState* play) { ret = 1; } else { actor->shape.rot.x = actor->shape.rot.z = 0; - func_8002F580(actor, play); + Actor_OfferCarry(actor, play); } break; case 1: diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 9a6ee6e098..f1ad800879 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -351,7 +351,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { } if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, play)) { - func_8002F554(&this->actor, play, getItemId); + Actor_OfferGetItemNearby(&this->actor, play, getItemId); } EnItem00_SetupAction(this, EnItem00_Collected); @@ -498,7 +498,7 @@ void EnItem00_Collected(EnItem00* this, PlayState* play) { if (this->getItemId != GI_NONE) { if (!Actor_HasParent(&this->actor, play)) { - func_8002F434(&this->actor, play, this->getItemId, 50.0f, 80.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 50.0f, 80.0f); this->despawnTimer++; } else { this->getItemId = GI_NONE; @@ -696,7 +696,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { params = &this->actor.params; if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, play)) { - func_8002F554(&this->actor, play, getItemId); + Actor_OfferGetItemNearby(&this->actor, play, getItemId); } switch (*params) { diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 8dde9ac0ca..0deabe1366 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -269,7 +269,7 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) { status2++; } play->objectCtx.num = i; - func_80031A28(play, &play->actorCtx); + Actor_KillAllWithMissingObject(play, &play->actorCtx); continue; } diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 5f5b1ee922..4ac1b7dcf9 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -449,7 +449,7 @@ void BgPoEvent_AmyWait(BgPoEvent* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { sPuzzleState |= 0x20; this->timer = 5; - Actor_SetColorFilter(&this->dyna.actor, 0x4000, 0xFF, 0, 5); + Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 5); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EN_PO_LAUGH2); this->actionFunc = BgPoEvent_AmyPuzzle; } diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index ebd4255d90..788c7479ee 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -114,7 +114,7 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { BgTokiSwd_SetupAction(this, func_808BB0AC); } else { if (Actor_IsFacingPlayer(&this->actor, 0x2000)) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } } } diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 04e3da94a9..2289828c82 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -814,7 +814,8 @@ void BossSst_HeadUnfreezeHand(BossSst* this, PlayState* play) { void BossSst_HeadSetupStunned(BossSst* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBongoHeadKnockoutAnim, -5.0f); - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, Animation_GetLastFrame(&gBongoHeadKnockoutAnim)); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + Animation_GetLastFrame(&gBongoHeadKnockoutAnim)); this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->colliderCyl.base.acFlags &= ~AC_ON; this->vVanish = false; @@ -904,9 +905,12 @@ void BossSst_HeadVulnerable(BossSst* this, PlayState* play) { void BossSst_HeadSetupDamage(BossSst* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBongoHeadDamageAnim, -3.0f); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gBongoHeadDamageAnim)); - Actor_SetColorFilter(&sHands[LEFT]->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gBongoHeadDamageAnim)); - Actor_SetColorFilter(&sHands[RIGHT]->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gBongoHeadDamageAnim)); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, + Animation_GetLastFrame(&gBongoHeadDamageAnim)); + Actor_SetColorFilter(&sHands[LEFT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, + Animation_GetLastFrame(&gBongoHeadDamageAnim)); + Actor_SetColorFilter(&sHands[RIGHT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, + Animation_GetLastFrame(&gBongoHeadDamageAnim)); this->colliderCyl.base.acFlags &= ~AC_ON; BossSst_HeadSfx(this, NA_SE_EN_SHADEST_DAMAGE); this->actionFunc = BossSst_HeadDamage; @@ -1007,9 +1011,9 @@ void BossSst_HeadSetupDeath(BossSst* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gBongoHeadEyeOpenIdleAnim, -5.0f); BossSst_HeadSfx(this, NA_SE_EN_SHADEST_DEAD); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 60); - Actor_SetColorFilter(&sHands[LEFT]->actor, 0x4000, 0xFF, 0, 60); - Actor_SetColorFilter(&sHands[RIGHT]->actor, 0x4000, 0xFF, 0, 60); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 60); + Actor_SetColorFilter(&sHands[LEFT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 60); + Actor_SetColorFilter(&sHands[RIGHT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 60); this->timer = 60; this->colliderCyl.base.acFlags &= ~AC_ON; this->colliderJntSph.base.ocFlags1 &= ~OC1_ON; @@ -1962,7 +1966,7 @@ void BossSst_HandSetupReel(BossSst* this) { Animation_MorphToPlayOnce(&this->skelAnime, sHandFlatPoses[this->actor.params], 4.0f); this->timer = 36; Math_Vec3f_Copy(&this->center, &this->actor.world.pos); - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 200); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 200); this->actionFunc = BossSst_HandReel; } @@ -2086,7 +2090,8 @@ void BossSst_HandSetupStunned(BossSst* hand) { hand->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); hand->colliderJntSph.base.acFlags |= AC_ON; BossSst_HandSetInvulnerable(hand, true); - Actor_SetColorFilter(&hand->actor, 0, 0xFF, 0, Animation_GetLastFrame(&gBongoHeadKnockoutAnim)); + Actor_SetColorFilter(&hand->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + Animation_GetLastFrame(&gBongoHeadKnockoutAnim)); hand->actionFunc = BossSst_HandStunned; } @@ -2286,7 +2291,7 @@ void BossSst_HandSetupFrozen(BossSst* this) { } BossSst_SpawnIceCrystal(this, 0); - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0xA); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 10); this->handAngSpeed = 0; this->actionFunc = BossSst_HandFrozen; } diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index c99958ee2e..ab7f05be40 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1075,7 +1075,7 @@ void BossVa_BodyPhase1(BossVa* this, PlayState* play) { if (sBodyState & 0x7F) { this->skelAnime.curFrame = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 12); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BALINADE_DAMAGE); } @@ -1126,7 +1126,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) { if (this->actor.colorFilterTimer == 0) { sPhase2Timer++; if ((this->invincibilityTimer != 0) && (this->actor.colorFilterParams & 0x4000)) { - Actor_SetColorFilter(&this->actor, 0, 255, 0, 160); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 160); this->actor.colorFilterTimer = this->invincibilityTimer; } else { this->colliderBody.info.bumper.dmgFlags = DMG_BOOMERANG; @@ -1138,7 +1138,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) { if (this->colliderBody.base.ac->id == ACTOR_EN_BOOM) { sPhase2Timer &= 0xFE00; - Actor_SetColorFilter(&this->actor, 0, 255, 0, 160); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 160); this->colliderBody.info.bumper.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK; } else { sKillBari++; @@ -1149,7 +1149,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) { } } - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); } Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BALINADE_FAINT); @@ -1243,7 +1243,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) { if (this->colliderBody.base.acFlags & AC_HIT) { this->skelAnime.curFrame = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 12); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BALINADE_FAINT); sBodyState = 1; this->timer = 131; @@ -1374,7 +1374,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect != 1) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BALINADE_DAMAGE); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); sPhase4HP -= this->actor.colChkInfo.damage; if (sPhase4HP <= 0) { this->timer = 0; @@ -1392,7 +1392,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { this->timer = (s16)Rand_CenteredFloat(40.0f) + 160; this->vaBodySpinRate = 0; this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 125, 0, 255); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 125, COLORFILTER_BUFFLAG_OPA, 255); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BALINADE_FAINT); } } @@ -1718,7 +1718,7 @@ void BossVa_SetupSupportAttached(BossVa* this, PlayState* play) { void BossVa_SupportAttached(BossVa* this, PlayState* play) { this->timer++; if (sBodyState & 0x7F) { - Actor_SetColorFilter(&this->actor, 0, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 12); if (Rand_ZeroOne() > 0.5f) { Animation_Change(&this->skelAnime, &gBarinadeSupportDamage1Anim, 1.0f, 0.0f, Animation_GetLastFrame(&gBarinadeSupportDamage1Anim), ANIMMODE_ONCE, 0.0f); @@ -2114,7 +2114,7 @@ void BossVa_SetupZapperDamaged(BossVa* this, PlayState* play) { Animation_GetLastFrame(&gBarinadeZapperDamage2Anim), ANIMMODE_ONCE_INTERP, 4.0f); } - Actor_SetColorFilter(&this->actor, 0, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 12); this->burst = false; BossVa_SetupAction(this, BossVa_ZapperDamaged); } @@ -2687,7 +2687,8 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { } else { this->unk_1AC = 0; if (this->actor.colorFilterTimer == 0) { - Actor_SetColorFilter(&this->actor, 0, 255, 0x2000, GET_BODY(this)->actor.colorFilterTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, + GET_BODY(this)->actor.colorFilterTimer); } } @@ -2722,7 +2723,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { void BossVa_SetupBariPhase3Stunned(BossVa* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_0; this->timer = GET_BODY(this)->timer; - Actor_SetColorFilter(&this->actor, 0, 255, 0x2000, this->timer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, this->timer); BossVa_SetupAction(this, BossVa_BariPhase3Stunned); } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index d3a61b5263..a9bbc0fae9 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -118,7 +118,7 @@ void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - func_8002F5F0(&this->actor, play); + Actor_SetClosestSecretDistance(&this->actor, play); } // update routine for grottos that are open diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 280e667a24..ac558159ba 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -379,7 +379,7 @@ void EnAm_Sleep(EnAm* this, PlayState* play) { if (this->textureBlend == 0) { Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EN_AMOS_WAVE); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EN_AMOS_VOICE); - Actor_SetColorFilter(&this->dyna.actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); } if (this->textureBlend >= 240) { @@ -717,7 +717,7 @@ void EnAm_SetupStunned(EnAm* this, PlayState* play) { this->dyna.actor.speedXZ = -6.0f; } - Actor_SetColorFilter(&this->dyna.actor, 0, 120, 0, 100); + Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 100); if (this->damageEffect == AM_DMGEFF_ICE) { this->iceTimer = 48; @@ -881,7 +881,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) { } if ((this->deathTimer % 4) == 0) { - Actor_SetColorFilter(&this->dyna.actor, 0x4000, 255, 0, 4); + Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 4); } } diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index f733177672..5feef35ccd 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -125,7 +125,7 @@ void func_809B0558(EnAni* this, PlayState* play) { } SET_ITEMGETINF(ITEMGETINF_15); } else { - func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); + Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); } } @@ -133,7 +133,7 @@ void func_809B05F0(EnAni* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { EnAni_SetupAction(this, func_809B0558); } - func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); + Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); } void func_809B064C(EnAni* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 1a6d72eaf6..4af75cffcc 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -344,7 +344,7 @@ void EnAnubice_Die(EnAnubice* this, PlayState* play) { rotatedFireEffectPos.x += this->actor.world.pos.x + Rand_CenteredFloat(40.0f); rotatedFireEffectPos.y += this->actor.world.pos.y + Rand_CenteredFloat(40.0f); rotatedFireEffectPos.z += this->actor.world.pos.z + Rand_CenteredFloat(30.0f); - Actor_SetColorFilter(&this->actor, 0x4000, 128, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 128, COLORFILTER_BUFFLAG_OPA, 8); EffectSsEnFire_SpawnVec3f(play, &this->actor, &rotatedFireEffectPos, 100, 0, 0, -1); if ((this->animLastFrame <= curFrame) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 7baaefe9b1..b8dd3df4f7 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -325,7 +325,7 @@ void func_809B7174(EnBa* this) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.speedXZ = 10.0f; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BALINADE_HAND_DAMAGE); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 12); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); EnBa_SetupAction(this, EnBa_RecoilFromDamage); } diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index dd2d8b7a3a..26e8a10da6 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -516,7 +516,7 @@ void EnBb_SetupDamage(EnBb* this) { if (this->actor.params == ENBB_RED) { EnBb_KillFlameTrail(this); } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0xC); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); this->timer = 5; EnBb_SetupAction(this, EnBb_Damage); } @@ -1083,14 +1083,14 @@ void EnBb_SetupStunned(EnBb* this) { } switch (this->dmgEffect) { case 8: - Actor_SetColorFilter(&this->actor, -0x8000, 0xC8, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 200, COLORFILTER_BUFFLAG_OPA, 80); break; case 9: this->fireIceTimer = 0x30; FALLTHROUGH; case 15: Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); - Actor_SetColorFilter(&this->actor, 0, 0xB4, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 180, COLORFILTER_BUFFLAG_OPA, 80); break; } this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; @@ -1205,7 +1205,7 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) { //! the bug in EnBb_Draw below to crash the game. } else if ((this->actor.params == ENBB_WHITE) && ((this->action == BB_WHITE) || (this->action == BB_STUNNED))) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0xC); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); this->actor.speedXZ = -8.0f; this->maxSpeed = 0.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 27353c5ed9..a4c003fdc0 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -340,7 +340,7 @@ void func_809BD524(EnBigokuta* this) { this->unk_195 = false; this->unk_196 = 80; } - Actor_SetColorFilter(&this->actor, 0, 255, 0, this->unk_196); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, this->unk_196); this->actionFunc = func_809BE058; } @@ -349,7 +349,7 @@ void func_809BD5E0(EnBigokuta* this) { this->unk_196 = 24; this->unk_19A = 0; this->cylinder[0].base.atFlags &= ~AT_ON; - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 24); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 24); this->actionFunc = func_809BE180; } void func_809BD658(EnBigokuta* this) { diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 8055fe8843..0ffa806244 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -221,7 +221,7 @@ void EnBili_SetupBurnt(EnBili* this) { this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= ACTOR_FLAG_4; this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0x2000, 0x14); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_XLU, 20); this->actionFunc = EnBili_Burnt; } @@ -240,7 +240,7 @@ void EnBili_SetupStunned(EnBili* this) { this->collider.info.bumper.effect = 0; this->actor.gravity = -1.0f; this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 0x96, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 80); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->collider.base.atFlags &= ~AT_ON; this->actionFunc = EnBili_Stunned; @@ -268,7 +268,7 @@ void EnBili_SetupFrozen(EnBili* this, PlayState* play) { } this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 0x96, 0x2000, 0xA); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 10); this->collider.base.atFlags &= ~AT_ON; this->collider.base.acFlags &= ~AC_ON; this->timer = 300; @@ -566,7 +566,7 @@ void EnBili_UpdateDamage(EnBili* this, PlayState* play) { } } else if (damageEffect == BIRI_DMGEFF_SWORD) { if (this->actionFunc != EnBili_Stunned) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0x2000, 0xA); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_XLU, 10); if (this->actor.colChkInfo.health == 0) { this->actor.params = EN_BILI_TYPE_DYING; diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 37c5bfdd09..1f400d7433 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -150,7 +150,7 @@ void EnBom_Move(EnBom* this, PlayState* play) { this->actor.velocity.y *= -0.3f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; } else if (this->timer >= 4) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 984313ca6c..f18ca60829 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -186,7 +186,7 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_29; this->actor.parent = NULL; - func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); player->stateFlags1 |= PLAYER_STATE1_29; this->actionFunc = EnBomBowlPit_WaitTillPrizeGiven; } @@ -195,7 +195,7 @@ void EnBomBowlPit_WaitTillPrizeGiven(EnBomBowlPit* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = EnBomBowlPit_Reset; } else { - func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); } } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 0a23ef7ca0..8659d34a24 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -191,7 +191,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) { } } else { if (!Actor_HasParent(&this->actor, play)) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } else { player->actor.child = NULL; player->heldActor = NULL; @@ -241,7 +241,7 @@ void EnBombf_Move(EnBombf* this, PlayState* play) { func_8002F850(play, &this->actor); this->actor.velocity.y *= -0.5f; } else if (this->timer >= 4) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } } } diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index f4afaae883..f1c5efcc32 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -267,7 +267,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { s32 treasureFlag = this->dyna.actor.params & 0x1F; if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { - func_8002F5F0(&this->dyna.actor, play); + Actor_SetClosestSecretDistance(&this->dyna.actor, play); } if (this->unk_1A8 >= 0) { @@ -287,7 +287,7 @@ void func_809C9700(EnBox* this, PlayState* play) { Player* player = GET_PLAYER(play); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { - func_8002F5F0(&this->dyna.actor, play); + Actor_SetClosestSecretDistance(&this->dyna.actor, play); } if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) { @@ -323,7 +323,7 @@ void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { s32 treasureFlag = this->dyna.actor.params & 0x1F; if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { - func_8002F5F0(&this->dyna.actor, play); + Actor_SetClosestSecretDistance(&this->dyna.actor, play); } if (Flags_GetSwitch(play, this->switchFlag)) { @@ -337,7 +337,7 @@ void EnBox_AppearOnRoomClear(EnBox* this, PlayState* play) { s32 treasureFlag = this->dyna.actor.params & 0x1F; if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { - func_8002F5F0(&this->dyna.actor, play); + Actor_SetClosestSecretDistance(&this->dyna.actor, play); } if (Flags_GetTempClear(play, this->dyna.actor.room) && !Player_InCsMode(play)) { @@ -424,7 +424,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) { - func_8002F554(&this->dyna.actor, play, 0 - (this->dyna.actor.params >> 5 & 0x7F)); + Actor_OfferGetItemNearby(&this->dyna.actor, play, 0 - (this->dyna.actor.params >> 5 & 0x7F)); } if (Flags_GetTreasure(play, this->dyna.actor.params & 0x1F)) { EnBox_SetupAction(this, EnBox_Open); diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index f103efec90..7715352300 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -127,7 +127,7 @@ void func_809CAEA0(EnBrob* this) { void func_809CAEF4(EnBrob* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_brob_Anim_000290, -5.0f); this->unk_1AE -= 125.0f; - Actor_SetColorFilter(&this->dyna.actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EN_GOMA_JR_FREEZE); this->actionFunc = func_809CB2B8; } diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 3a9ef8bd52..89a043ac4d 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -694,7 +694,7 @@ void func_809D0584(EnBw* this, PlayState* play) { if ((this->damageEffect == 1) || (this->damageEffect == 0xE)) { if (this->unk_23C == 0) { Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); func_809D03CC(this); this->unk_248 = 0.0f; } @@ -705,7 +705,7 @@ void func_809D0584(EnBw* this, PlayState* play) { } if (((this->unk_221 == 1) || (this->unk_221 == 4)) && (this->actor.colChkInfo.health == 0)) { if (this->unk_220 != 0) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (func_800355E4(play, &this->collider2.base)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; @@ -719,7 +719,7 @@ void func_809D0584(EnBw* this, PlayState* play) { } } else if ((this->unk_220 != 1) && (this->unk_220 != 6)) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_BUBLEWALK_DAMAGE); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (this->unk_220 != 5) { func_809D01CC(this); } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 49d18232ef..ced50c7e65 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -348,7 +348,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { this->collider.base.acFlags &= ~AC_HIT; this->crashingTimer = 20; - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 5); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 5); this->acceleration.x = Rand_CenteredFloat(15.0f); this->acceleration.y = Rand_CenteredFloat(15.0f); this->acceleration.z = Rand_CenteredFloat(15.0f); diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 397f2137a3..7ba17cf4f6 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -213,7 +213,7 @@ void func_809DF778(EnCow* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_809DF730; } else { - func_8002F434(&this->actor, play, GI_MILK, 10000.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 100.0f); } } @@ -222,7 +222,7 @@ void func_809DF7D8(EnCow* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_16; Message_CloseTextbox(play); this->actionFunc = func_809DF778; - func_8002F434(&this->actor, play, GI_MILK, 10000.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 100.0f); } } diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 6a15e9f9aa..9631bf3943 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -157,7 +157,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_KAICHO_DEAD); if (this->actor.colChkInfo.damageEffect == 3) { // Ice arrows - Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 40); for (i = 0; i < 8; i++) { iceParticlePos.x = ((i & 1 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.x; iceParticlePos.y = ((i & 2 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.y; @@ -166,13 +166,13 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { ((Rand_ZeroOne() * 0.15f) + 0.85f) * scale); } } else if (this->actor.colChkInfo.damageEffect == 2) { // Fire arrows and Din's Fire - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40); for (i = 0; i < 4; i++) { EffectSsEnFire_SpawnVec3f(play, &this->actor, &this->actor.world.pos, 50.0f * scale, 0, 0, i); } } else { - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40); } if (this->actor.flags & ACTOR_FLAG_15) { @@ -196,7 +196,7 @@ void EnCrow_SetupTurnAway(EnCrow* this) { this->aimRotX = -0x1000; this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; this->skelAnime.playSpeed = 2.0f; - Actor_SetColorFilter(&this->actor, 0, 255, 0, 5); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 5); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->actionFunc = EnCrow_TurnAway; } diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 5df26055bc..84bff0c578 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -386,9 +386,9 @@ void EnDekubaba_SetupHit(EnDekubaba* this, s32 arg1) { Actor_SetScale(&this->actor, this->size * 0.01f); if (arg1 == 2) { - Actor_SetColorFilter(&this->actor, 0, 155, 0, 62); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 155, COLORFILTER_BUFFLAG_OPA, 62); } else { - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 42); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 42); } this->actionFunc = EnDekubaba_Hit; @@ -442,7 +442,7 @@ void EnDekubaba_SetupSway(EnDekubaba* this) { this->stemSectionAngle[1] = -0x4800; EnDekubaba_DisableHitboxes(this); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 35); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 35); this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnDekubaba_Sway; } @@ -1020,7 +1020,7 @@ void EnDekubaba_DeadStickDrop(EnDekubaba* this, PlayState* play) { return; } - func_8002F554(&this->actor, play, GI_DEKU_STICKS_1); + Actor_OfferGetItemNearby(&this->actor, play, GI_DEKU_STICKS_1); } // Update and associated functions diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index b1cd689707..e0865a0fd8 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -214,7 +214,8 @@ void EnDekunuts_SetupBeDamaged(EnDekunuts* this) { this->actor.speedXZ = 10.0f; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_NUTS_DAMAGE); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_NUTS_CUTBODY); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gDekuNutsDamageAnim)); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, + Animation_GetLastFrame(&gDekuNutsDamageAnim)); } void EnDekunuts_SetupBeStunned(EnDekunuts* this) { @@ -223,7 +224,7 @@ void EnDekunuts_SetupBeStunned(EnDekunuts* this) { this->actionFunc = EnDekunuts_BeStunned; this->actor.speedXZ = 0.0f; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, Animation_GetLastFrame(&gDekuNutsDamageAnim) * this->animFlagAndTimer); } diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index a0cfc3680f..b2786eeee5 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -482,7 +482,7 @@ void EnDh_CollisionCheck(EnDh* this, PlayState* play) { if (player->unk_844 != 0) { this->unk_258 = player->unk_845; } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); lastHealth = this->actor.colChkInfo.health; if (Actor_ApplyDamage(&this->actor) == 0) { EnDh_SetupDeath(this); diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 451f226022..d0156367b0 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -383,7 +383,7 @@ void EnDha_UpdateHealth(EnDha* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 0 || this->actor.colChkInfo.damageEffect == 6) { return; } else { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (Actor_ApplyDamage(&this->actor) == 0) { EnDha_SetupDeath(this); this->actor.colChkInfo.health = 8; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index 8b55fabd94..fd1c73cebd 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -459,7 +459,7 @@ void func_809EEA00(EnDivingGame* this, PlayState* play) { if ((this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play))) { Message_CloseTextbox(play); this->actor.parent = NULL; - func_8002F434(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); this->actionFunc = func_809EEA90; } } @@ -469,7 +469,7 @@ void func_809EEA90(EnDivingGame* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_809EEAF8; } else { - func_8002F434(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); } } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 660013685b..a4f0511674 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -370,18 +370,18 @@ void EnDns_Talk(EnDns* this, PlayState* play) { void func_809EFDD0(EnDns* this, PlayState* play) { if (this->actor.params == 0x9) { if (CUR_UPG_VALUE(UPG_DEKU_STICKS) < 2) { - func_8002F434(&this->actor, play, GI_DEKU_STICK_UPGRADE_20, 130.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_DEKU_STICK_UPGRADE_20, 130.0f, 100.0f); } else { - func_8002F434(&this->actor, play, GI_DEKU_STICK_UPGRADE_30, 130.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_DEKU_STICK_UPGRADE_30, 130.0f, 100.0f); } } else if (this->actor.params == 0xA) { if (CUR_UPG_VALUE(UPG_DEKU_NUTS) < 2) { - func_8002F434(&this->actor, play, GI_DEKU_NUT_UPGRADE_30, 130.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_DEKU_NUT_UPGRADE_30, 130.0f, 100.0f); } else { - func_8002F434(&this->actor, play, GI_DEKU_NUT_UPGRADE_40, 130.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_DEKU_NUT_UPGRADE_40, 130.0f, 100.0f); } } else { - func_8002F434(&this->actor, play, this->dnsItemEntry->getItemId, 130.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, this->dnsItemEntry->getItemId, 130.0f, 100.0f); } } diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index fc53b8c7ba..dc96c2300f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -255,7 +255,7 @@ void EnDntJiji_Talk(EnDntJiji* this, PlayState* play) { Message_CloseTextbox(play); func_8002DF54(play, NULL, 7); this->actor.parent = NULL; - func_8002F434(&this->actor, play, this->getItemId, 400.0f, 200.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 400.0f, 200.0f); this->actionFunc = EnDntJiji_SetupGivePrize; } } @@ -265,7 +265,7 @@ void EnDntJiji_SetupGivePrize(EnDntJiji* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = EnDntJiji_GivePrize; } else { - func_8002F434(&this->actor, play, this->getItemId, 400.0f, 200.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 400.0f, 200.0f); } } diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 2b8c90902c..50fe79a3f0 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -91,7 +91,7 @@ void EnDodojr_Destroy(Actor* thisx, PlayState* play) { void EnDodojr_DoSwallowedBombEffects(EnDodojr* this) { Audio_PlayActorSfx2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 8); } void EnDodojr_SpawnLargeDust(EnDodojr* this, PlayState* play, s32 count) { @@ -359,7 +359,7 @@ s32 EnDodojr_CheckDamaged(EnDodojr* this, PlayState* play) { (this->actionFunc != EnDodojr_StunnedBounce)) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->stunTimer = 120; - Actor_SetColorFilter(&this->actor, 0, 200, 0, 120); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 120); EnDodojr_SetupFlipBounce(this); this->actionFunc = EnDodojr_StunnedBounce; } @@ -577,7 +577,7 @@ void EnDodojr_DeathSequence(EnDodojr* this, PlayState* play) { if (this->counter != 0) { if (this->actor.colorFilterTimer == 0) { - Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->counter); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, this->counter); this->counter--; } } else { diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 56195d57b3..8ef077c145 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -497,7 +497,7 @@ void EnDodongo_SwallowBomb(EnDodongo* this, PlayState* play) { &this->bombSmokeEnvColor, 400, 10, 10); } Audio_PlayActorSfx2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_SetColorFilter(&this->actor, 0x4000, 0x78, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 120, COLORFILTER_BUFFLAG_OPA, 8); } } } @@ -676,7 +676,7 @@ void EnDodongo_Death(EnDodongo* this, PlayState* play) { EnDodongo_SpawnBombSmoke(this, play); } } else if (this->actor.colorFilterTimer == 0) { - Actor_SetColorFilter(&this->actor, 0x4000, 0x78, 0, 4); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 120, COLORFILTER_BUFFLAG_OPA, 4); } if (SkelAnime_Update(&this->skelAnime)) { if (this->timer == 0) { @@ -721,12 +721,12 @@ void EnDodongo_CollisionCheck(EnDodongo* this, PlayState* play) { this->damageEffect = this->actor.colChkInfo.damageEffect; if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 0xF)) { if (this->actionState != DODONGO_STUNNED) { - Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(&this->actor); EnDodongo_SetupStunned(this); } } else { - Actor_SetColorFilter(&this->actor, 0x4000, 0x78, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 120, COLORFILTER_BUFFLAG_OPA, 8); if (Actor_ApplyDamage(&this->actor) == 0) { EnDodongo_SetupDeath(this, play); } else { diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 528e915bfa..6817b084ca 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -90,7 +90,7 @@ void EnDs_GiveOddPotion(EnDs* this, PlayState* play) { this->actionFunc = EnDs_DisplayOddPotionText; gSaveContext.subTimerState = SUBTIMER_STATE_OFF; } else { - func_8002F434(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f); } } @@ -98,7 +98,7 @@ void EnDs_TalkAfterBrewOddPotion(EnDs* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); this->actionFunc = EnDs_GiveOddPotion; - func_8002F434(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f); } } @@ -170,7 +170,7 @@ void EnDs_GiveBluePotion(EnDs* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnDs_Talk; } else { - func_8002F434(&this->actor, play, GI_BOTTLE_POTION_BLUE, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_POTION_BLUE, 10000.0f, 50.0f); } } @@ -189,7 +189,7 @@ void EnDs_OfferBluePotion(EnDs* this, PlayState* play) { case 2: // have 100 rupees and empty bottle Rupees_ChangeBy(-100); this->actor.flags &= ~ACTOR_FLAG_16; - func_8002F434(&this->actor, play, GI_BOTTLE_POTION_BLUE, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_POTION_BLUE, 10000.0f, 50.0f); this->actionFunc = EnDs_GiveBluePotion; return; } diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index ec6be4b346..cc0c96fa1c 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -522,7 +522,7 @@ void func_809FEC70(EnDu* this, PlayState* play) { } else { f32 xzRange = this->actor.xzDistToPlayer + 1.0f; - func_8002F434(&this->actor, play, GI_GORONS_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, GI_GORONS_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); } } diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index dc3fe964e0..0e1eaf4d59 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -281,14 +281,14 @@ void EnEiyer_SetupHurt(EnEiyer* this) { this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; this->actor.speedXZ = 5.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, 40); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40); this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnEiyer_Hurt; } void EnEiyer_SetupDie(EnEiyer* this) { this->timer = 20; - Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, 40); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40); if (this->collider.info.bumper.dmgFlags != (DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT)) { this->actor.speedXZ = 6.0f; @@ -317,7 +317,7 @@ void EnEiyer_SetupStunned(EnEiyer* this) { this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; this->collider.dim.height = sColCylInit.dim.height + 8; - Actor_SetColorFilter(&this->actor, 0, 200, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); this->collider.base.atFlags &= ~AT_ON; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->actionFunc = EnEiyer_Stunned; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index bb331f79db..21570236f9 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -661,7 +661,7 @@ void func_80A0329C(EnElf* this, PlayState* play) { if (!(this->fairyFlags & FAIRY_FLAG_BIG)) { // GI_MAX in this case allows the player to catch the actor in a bottle - func_8002F434(&this->actor, play, GI_MAX, 80.0f, 60.0f); + Actor_OfferGetItem(&this->actor, play, GI_MAX, 80.0f, 60.0f); } } } diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 3a39b09044..f934b8838b 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -393,7 +393,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play) { } else { getItemId = GI_BULLET_BAG_50; } - func_8002F434(&this->actor, play, getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f); this->actionFunc = EnExItem_TargetPrizeGive; } } @@ -406,7 +406,7 @@ void EnExItem_TargetPrizeGive(EnExItem* this, PlayState* play) { } else { getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40; - func_8002F434(&this->actor, play, getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f); } } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 3a581c0106..c60cd51a3a 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -214,7 +214,7 @@ void EnFirefly_SetupFall(EnFirefly* this) { Animation_Change(&this->skelAnime, &gKeeseFlyAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FFLY_DEAD); this->actor.flags |= ACTOR_FLAG_4; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 40); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40); this->actionFunc = EnFirefly_Fall; } @@ -248,7 +248,7 @@ void EnFirefly_SetupFlyAway(EnFirefly* this) { void EnFirefly_SetupStunned(EnFirefly* this) { this->timer = 80; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); this->auraType = KEESE_AURA_NONE; this->actor.velocity.y = 0.0f; this->skelAnime.playSpeed = 3.0f; @@ -263,7 +263,7 @@ void EnFirefly_SetupFrozenFall(EnFirefly* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_4; this->auraType = KEESE_AURA_NONE; this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0xFF); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 255); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FFLY_DEAD); for (i = 0; i <= 7; i++) { diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 29e3c7cdc0..1ca061050a 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -710,7 +710,7 @@ void EnFish_OrdinaryUpdate(EnFish* this, PlayState* play) { EnFish_BeginRespawn(this); } else if (EnFish_InBottleRange(this, play)) { // GI_MAX in this case allows the player to catch the actor in a bottle - func_8002F434(&this->actor, play, GI_MAX, 80.0f, 20.0f); + Actor_OfferGetItem(&this->actor, play, GI_MAX, 80.0f, 20.0f); } } } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 6fd4c71473..885508c8d2 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -395,7 +395,7 @@ void EnFloormas_SetupTakeDamage(EnFloormas* this) { } else { this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x14); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 20); this->actionFunc = EnFloormas_TakeDamage; this->actor.speedXZ = 5.0f; this->actor.velocity.y = 5.5f; @@ -412,9 +412,9 @@ void EnFloormas_SetupFreeze(EnFloormas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.5f, 0, 20.0f, ANIMMODE_ONCE, -3.0f); this->actor.speedXZ = 0.0f; if (this->actor.colChkInfo.damageEffect == 4) { - Actor_SetColorFilter(&this->actor, -0x8000, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 80); } else { - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); if (this->actor.scale.x > 0.004f) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); } else { diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 2fccca7516..58146734d0 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -1013,7 +1013,7 @@ void EnFr_Deactivate(EnFr* this, PlayState* play) { this->actionFunc = EnFr_Idle; } else { this->actionFunc = EnFr_GiveReward; - func_8002F434(&this->actor, play, this->reward, 30.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, this->reward, 30.0f, 100.0f); } } @@ -1022,7 +1022,7 @@ void EnFr_GiveReward(EnFr* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnFr_SetIdle; } else { - func_8002F434(&this->actor, play, this->reward, 30.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, this->reward, 30.0f, 100.0f); } } diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index b3910657a9..8259d53417 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -247,7 +247,8 @@ void EnFw_Run(EnFw* this, PlayState* play) { Math_SmoothStepToF(&this->actor.scale.x, 0.024999999f, 0.08f, 0.6f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); if (this->actor.colorFilterTimer == 0) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, this->explosionTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, + this->explosionTimer); this->explosionTimer--; } @@ -265,7 +266,8 @@ void EnFw_Run(EnFw* this, PlayState* play) { } } else { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.velocity.y > 0.0f) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, this->damageTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, + this->damageTimer); return; } DECR(this->damageTimer); diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 6eb9fc6908..6ca86bbb3e 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -344,7 +344,7 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) { switch (this->actor.colChkInfo.damageEffect) { case 0xF: Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 8); if (this->actor.colChkInfo.health != 0) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); vec.x = this->actor.world.pos.x; @@ -365,7 +365,7 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) { case 2: Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 8); if (this->actor.colChkInfo.health == 0) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD); EnFz_SetupMelt(this); diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 6ac46c8c31..e83cc9459e 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -350,7 +350,7 @@ void func_80A2FA50(EnGb* this, PlayState* play) { void func_80A2FB40(EnGb* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { - func_8002F434(&this->dyna.actor, play, GI_BOTTLE_EMPTY, 100.0f, 10.0f); + Actor_OfferGetItem(&this->dyna.actor, play, GI_BOTTLE_EMPTY, 100.0f, 10.0f); this->actionFunc = func_80A2FBB0; } } @@ -360,7 +360,7 @@ void func_80A2FBB0(EnGb* this, PlayState* play) { this->dyna.actor.parent = NULL; this->actionFunc = func_80A2FC0C; } else { - func_8002F434(&this->dyna.actor, play, GI_BOTTLE_EMPTY, 100.0f, 10.0f); + Actor_OfferGetItem(&this->dyna.actor, play, GI_BOTTLE_EMPTY, 100.0f, 10.0f); } } diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index dbf45e4c9d..1c17860b83 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -512,7 +512,7 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { } else { getItemId = GI_HEART_PIECE; } - func_8002F434(&this->actor, play, getItemId, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f); } } @@ -541,7 +541,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) { getItemId = GI_HEART_PIECE; } - func_8002F434(&this->actor, play, getItemId, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f); } void EnGe1_TalkWinPrize_Archery(EnGe1* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index ef70210b83..a685b42ae5 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -451,7 +451,7 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnGe2_SetActionAfterTalk; } else { - func_8002F434(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); } } @@ -460,7 +460,7 @@ void EnGe2_GiveCard(EnGe2* this, PlayState* play) { Message_CloseTextbox(play); this->actor.flags &= ~ACTOR_FLAG_16; this->actionFunc = EnGe2_WaitTillCardGiven; - func_8002F434(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); } } @@ -556,7 +556,9 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } else if (this->collider.base.acFlags & AC_HIT) { if ((this->collider.info.acHitInfo != NULL) && (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT)) { - Actor_SetColorFilter(&this->actor, 0, 120, 0, 400); + //! @bug duration parameter is larger than 255 which messes with the internal bitpacking of the colorfilter. + //! Because of the duration being tracked as an unsigned byte it ends up being truncated to 144 + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 400); this->actor.update = EnGe2_UpdateStunned; return; } diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 57d203ec8f..ca7d13e4c6 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -141,7 +141,7 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnGe3_Wait; } else { - func_8002F434(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); } } @@ -150,7 +150,7 @@ void EnGe3_GiveCard(EnGe3* this, PlayState* play) { Message_CloseTextbox(play); this->actor.flags &= ~ACTOR_FLAG_16; this->actionFunc = EnGe3_WaitTillCardGiven; - func_8002F434(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f); } } diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 16ba688c5a..ead941860a 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1373,12 +1373,12 @@ void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) { if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) || (this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) { if (this->action != GELDB_STUNNED) { - Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(&this->actor); EnGeldB_SetupStunned(this); } } else { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (Actor_ApplyDamage(&this->actor) == 0) { if (this->keyFlag != 0) { key = Item_DropCollectible(play, &this->actor.world.pos, this->keyFlag | ITEM00_SMALL_KEY); diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 282c257e9c..d518af7f38 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -245,7 +245,7 @@ void EnGm_ProcessChoiceIndex(EnGm* this, PlayState* play) { Message_ContinueTextbox(play, 0xC8); this->actionFunc = func_80A3DD7C; } else { - func_8002F434(&this->actor, play, GI_SWORD_KNIFE, 415.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_SWORD_KNIFE, 415.0f, 10.0f); this->actionFunc = func_80A3DF00; } break; @@ -262,7 +262,7 @@ void func_80A3DF00(EnGm* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80A3DF60; } else { - func_8002F434(&this->actor, play, GI_SWORD_KNIFE, 415.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_SWORD_KNIFE, 415.0f, 10.0f); } } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 48fbc67bef..94facaac4f 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -226,7 +226,7 @@ s16 EnGo_UpdateTalkState(PlayState* play, Actor* thisx) { unkState = NPC_TALK_STATE_IDLE; break; case 0x3036: - func_8002F434(thisx, play, GI_TUNIC_GORON, xzRange, yRange); + Actor_OfferGetItem(thisx, play, GI_TUNIC_GORON, xzRange, yRange); SET_INFTABLE(INFTABLE_10D); // EnGo exclusive flag unkState = NPC_TALK_STATE_ACTION; break; @@ -972,7 +972,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { yDist = fabsf(this->actor.yDistToPlayer) + 1.0f; xzDist = this->actor.xzDistToPlayer + 1.0f; - func_8002F434(&this->actor, play, getItemId, xzDist, yDist); + Actor_OfferGetItem(&this->actor, play, getItemId, xzDist, yDist); } } diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index ee86e3a0ef..a1f1ff8526 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -278,8 +278,8 @@ s32 EnGo2_SpawnDust(EnGo2* this, u8 initialTimer, f32 scale, f32 scaleStep, s32 void EnGo2_GetItem(EnGo2* this, PlayState* play, s32 getItemId) { this->getItemId = getItemId; - func_8002F434(&this->actor, play, getItemId, this->actor.xzDistToPlayer + 1.0f, - fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, this->actor.xzDistToPlayer + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); } s32 EnGo2_GetDialogState(EnGo2* this, PlayState* play) { @@ -1791,8 +1791,8 @@ void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnGo2_SetGetItem; } else { - func_8002F434(&this->actor, play, this->getItemId, this->actor.xzDistToPlayer + 1.0f, - fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, this->actor.xzDistToPlayer + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); } } diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 7ba22f6644..6fd3b53935 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -561,7 +561,7 @@ void EnGoma_SetupStunned(EnGoma* this, PlayState* play) { } void EnGoma_Stunned(EnGoma* this, PlayState* play) { - Actor_SetColorFilter(&this->actor, 0, 180, 0, 2); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 180, COLORFILTER_BUFFLAG_OPA, 2); this->visualState = 2; if (this->actionTimer != 0) { @@ -652,7 +652,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) { this->actor.colChkInfo.health -= swordDamage; EnGoma_SetupHurt(this, play); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 5); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 5); this->hurtTimer = 13; } } else { diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 85e3191c2f..5b8f32b397 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -205,7 +205,7 @@ void EnHintnuts_SetupLeave(EnHintnuts* this, PlayState* play) { void EnHintnuts_SetupFreeze(EnHintnuts* this) { Animation_PlayLoop(&this->skelAnime, &gHintNutsFreezeAnim); this->actor.flags &= ~ACTOR_FLAG_0; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 100); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 100); this->actor.colorFilterTimer = 1; this->animFlagAndTimer = 0; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_NUTS_FAINT); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index e323d35c2c..832634b2d4 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -246,7 +246,7 @@ void EnHonotrap_EyeIdle(EnHonotrap* this, PlayState* play) { void EnHonotrap_SetupEyeOpen(EnHonotrap* this) { this->actionFunc = EnHonotrap_EyeOpen; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x28); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40); this->timer = 30; Audio_PlayActorSfx2(&this->actor, NA_SE_EV_RED_EYE); } diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index ff457b1cf9..fb99cf00fd 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -155,7 +155,7 @@ void func_80A6E740(EnHs* this, PlayState* play) { this->actor.parent = NULL; func_80A6E3A0(this, func_80A6E630); } else { - func_8002F434(&this->actor, play, GI_ODD_MUSHROOM, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_ODD_MUSHROOM, 10000.0f, 50.0f); } this->unk_2A8 |= 1; @@ -166,7 +166,7 @@ void func_80A6E7BC(EnHs* this, PlayState* play) { switch (play->msgCtx.choiceIndex) { case 0: func_80A6E3A0(this, func_80A6E740); - func_8002F434(&this->actor, play, GI_ODD_MUSHROOM, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_ODD_MUSHROOM, 10000.0f, 50.0f); break; case 1: Message_ContinueTextbox(play, 0x10B4); diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 6f02528360..38cd4fdbec 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -410,8 +410,8 @@ s32 EnHy_IsOsAnimeObjectLoaded(EnHy* this, PlayState* play) { void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) { this->unkGetItemId = getItemId; - func_8002F434(&this->actor, play, getItemId, this->actor.xzDistToPlayer + 1.0f, - fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, this->actor.xzDistToPlayer + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); } u16 func_80A6F810(PlayState* play, Actor* thisx) { @@ -1054,8 +1054,8 @@ void func_80A714C4(EnHy* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_80A71530; } else { - func_8002F434(&this->actor, play, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f, - fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); } } diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index c5b4ed946e..b842f984fa 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -215,7 +215,7 @@ void EnIceHono_CapturableFlame(EnIceHono* this, PlayState* play) { this->actor.parent = NULL; } else if (EnIceHono_InBottleRange(this, play)) { // GI_MAX in this case allows the player to catch the actor in a bottle - func_8002F434(&this->actor, play, GI_MAX, 60.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_MAX, 60.0f, 100.0f); } if (this->actor.xzDistToPlayer < 200.0f) { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 2b0de16bd1..6b06c0cfa0 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -745,7 +745,7 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { return; } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0xC); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); prevHealth = this->actor.colChkInfo.health; Actor_ApplyDamage(&this->actor); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 3fb7b1ca59..7f0877df97 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -779,7 +779,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { if (!(this->insectFlags & INSECT_FLAG_UNCATCHABLE) && sCaughtCount < 4 && EnInsect_InBottleRange(this, play) && // GI_MAX in this case allows the player to catch the actor in a bottle - func_8002F434(&this->actor, play, GI_MAX, 60.0f, 30.0f)) { + Actor_OfferGetItem(&this->actor, play, GI_MAX, 60.0f, 30.0f)) { sCaughtCount++; } } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 38a42f0af8..b57ab1a29a 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -371,9 +371,9 @@ void EnIshi_Wait(EnIshi* this, PlayState* play) { if (this->actor.xzDistToPlayer < 90.0f) { // GI_NONE in these cases allows the player to lift the actor if (type == ROCK_LARGE) { - func_8002F434(&this->actor, play, GI_NONE, 80.0f, 20.0f); + Actor_OfferGetItem(&this->actor, play, GI_NONE, 80.0f, 20.0f); } else { - func_8002F434(&this->actor, play, GI_NONE, 50.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_NONE, 50.0f, 10.0f); } } } diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 29e60e1e10..ecbf0d1f50 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -128,7 +128,7 @@ void func_80A89160(EnJs* this, PlayState* play) { this->actor.parent = NULL; En_Js_SetupAction(this, func_80A8910C); } else { - func_8002F434(&this->actor, play, GI_BOMBCHUS_10, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_BOMBCHUS_10, 10000.0f, 50.0f); } } diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 5d9414cf78..ea15989bea 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -362,7 +362,7 @@ void EnKarebaba_DeadItemDrop(EnKarebaba* this, PlayState* play) { if (Actor_HasParent(&this->actor, play) || this->actor.params == 0) { EnKarebaba_SetupDead(this); } else { - func_8002F554(&this->actor, play, GI_DEKU_STICKS_1); + Actor_OfferGetItemNearby(&this->actor, play, GI_DEKU_STICKS_1); } } diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 77201956cd..676cbfb94c 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1224,7 +1224,7 @@ void func_80A99504(EnKo* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80A99560; } else { - func_8002F434(&this->actor, play, GI_POACHERS_SAW, 120.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_POACHERS_SAW, 120.0f, 10.0f); } } diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index c6e67a816b..ec864edfa7 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -330,7 +330,7 @@ void EnKusa_Main(EnKusa* this, PlayState* play) { if (this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (this->actor.xzDistToPlayer < 100.0f) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 71ef568c50..234207e196 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -434,7 +434,7 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { getItemId = this->isTrading == true ? GI_EYEBALL_FROG : GI_TUNIC_ZORA; yRange = fabsf(this->actor.yDistToPlayer) + 1.0f; xzRange = this->actor.xzDistToPlayer + 1.0f; - func_8002F434(&this->actor, play, getItemId, xzRange, yRange); + Actor_OfferGetItem(&this->actor, play, getItemId, xzRange, yRange); } } diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index 8acd12bb51..22795def00 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -96,7 +96,7 @@ void EnLightbox_Update(Actor* thisx, PlayState* play) { thisx->velocity.y *= IREG(60) / 100.0f; thisx->bgCheckFlags &= ~BGCHECKFLAG_GROUND; } else { - func_8002F580(thisx, play); + Actor_OfferCarry(thisx, play); } } } diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 815b02fcf0..3178dc0b97 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -326,7 +326,7 @@ void func_80AA0EA0(EnMa1* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80AA0EFC; } else { - func_8002F434(&this->actor, play, GI_WEIRD_EGG, 120.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_WEIRD_EGG, 120.0f, 10.0f); } } diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 6d038625a2..6555044df6 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -586,7 +586,7 @@ void EnMb_SetupClubDead(EnMb* this) { void EnMb_SetupStunned(EnMb* this) { this->state = ENMB_STATE_STUNNED; this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); if (this->damageEffect == ENMB_DMGEFF_STUN_ICE) { this->iceEffectTimer = 40; } else { @@ -1395,7 +1395,7 @@ void EnMb_CheckColliding(EnMb* this, PlayState* play) { } } else { Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFA, 0, 0xC); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 250, COLORFILTER_BUFFLAG_OPA, 12); if (this->actor.params == ENMB_TYPE_CLUB) { if (this->actor.colChkInfo.health == 0) { EnMb_SetupClubDead(this); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 1165e06b30..ae9e4b380b 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -95,14 +95,14 @@ void func_80AACA94(EnMk* this, PlayState* play) { Interface_SetSubTimer(240); CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE); } else { - func_8002F434(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f); } } void func_80AACB14(EnMk* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actionFunc = func_80AACA94; - func_8002F434(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f); } } @@ -196,14 +196,14 @@ void func_80AACFA0(EnMk* this, PlayState* play) { this->actionFunc = func_80AACA40; SET_ITEMGETINF(ITEMGETINF_10); } else { - func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); } } void func_80AAD014(EnMk* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actionFunc = func_80AACFA0; - func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); } this->flags |= 1; diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 8a0b941bb8..32352a75e6 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -128,7 +128,7 @@ void EnMs_Talk(EnMs* this, PlayState* play) { Message_ContinueTextbox(play, 0x4069); // not enough rupees text return; } - func_8002F434(&this->actor, play, GI_MAGIC_BEAN, 90.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_MAGIC_BEAN, 90.0f, 10.0f); this->actionFunc = EnMs_Sell; return; case 1: // no @@ -145,7 +145,7 @@ void EnMs_Sell(EnMs* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnMs_TalkAfterPurchase; } else { - func_8002F434(&this->actor, play, GI_MAGIC_BEAN, 90.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_MAGIC_BEAN, 90.0f, 10.0f); } } diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 80a97ee2fa..42ccd0fea7 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -465,7 +465,7 @@ void func_80AB6450(EnNiw* this, PlayState* play) { this->actionFunc = func_80AB6BF8; } else { // GI_NONE in this case allows the player to lift the actor - func_8002F434(&this->actor, play, GI_NONE, 25.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_NONE, 25.0f, 10.0f); func_80AB5BF8(this, play, 1); } } @@ -487,7 +487,7 @@ void func_80AB6570(EnNiw* this, PlayState* play) { this->actionFunc = func_80AB6BF8; return; } - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } else { if (this->path != 0) { this->unk_2A6 = 1; @@ -696,7 +696,7 @@ void func_80AB6D08(EnNiw* this, PlayState* play) { this->actionFunc = func_80AB6BF8; } else { if (this->timer5 >= 6) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } func_80AB5BF8(this, play, 2); } diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index ead8bc9d8e..82dcbe918d 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -309,13 +309,13 @@ void func_80ABA654(EnNiwLady* this, PlayState* play) { if (!GET_ITEMGETINF(ITEMGETINF_0C)) { this->actor.parent = NULL; this->getItemId = GI_BOTTLE_EMPTY; - func_8002F434(&this->actor, play, GI_BOTTLE_EMPTY, 100.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_EMPTY, 100.0f, 50.0f); this->actionFunc = func_80ABAC00; return; } if (this->unk_26C == 1) { this->getItemId = GI_RUPEE_PURPLE; - func_8002F434(&this->actor, play, GI_RUPEE_PURPLE, 100.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_RUPEE_PURPLE, 100.0f, 50.0f); this->actionFunc = func_80ABAC00; } this->actionFunc = func_80ABA244; @@ -390,7 +390,7 @@ void func_80ABA9B8(EnNiwLady* this, PlayState* play) { case 0: Message_CloseTextbox(play); this->actor.parent = NULL; - func_8002F434(&this->actor, play, GI_POCKET_EGG, 200.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_POCKET_EGG, 200.0f, 100.0f); this->actionFunc = func_80ABAC00; break; case 1: @@ -418,7 +418,7 @@ void func_80ABAB08(EnNiwLady* this, PlayState* play) { case 0: Message_CloseTextbox(play); this->actor.parent = NULL; - func_8002F434(&this->actor, play, GI_COJIRO, 200.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, GI_COJIRO, 200.0f, 100.0f); this->actionFunc = func_80ABAC00; break; case 1: @@ -444,7 +444,7 @@ void func_80ABAC00(EnNiwLady* this, PlayState* play) { if (LINK_IS_ADULT) { getItemId = !GET_ITEMGETINF(ITEMGETINF_2C) ? GI_POCKET_EGG : GI_COJIRO; } - func_8002F434(&this->actor, play, getItemId, 200.0f, 100.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 200.0f, 100.0f); } } diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 6f7369698b..b79a3062a4 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -315,16 +315,16 @@ s32 EnNy_CollisionCheck(EnNy* this, PlayState* play) { FALLTHROUGH; case 0xF: Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); break; case 1: Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); break; case 2: this->unk_1CA = 4; Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); break; } } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index a858d7be26..f504310bb6 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -240,7 +240,7 @@ void EnOkuta_SetupShoot(EnOkuta* this, PlayState* play) { void EnOkuta_SetupWaitToDie(EnOkuta* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gOctorokHitAnim, -5.0f); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0xB); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 11); this->collider.base.acFlags &= ~AC_HIT; Actor_SetScale(&this->actor, 0.01f); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_OCTAROCK_DEAD1); @@ -255,7 +255,7 @@ void EnOkuta_SetupDie(EnOkuta* this) { void EnOkuta_SetupFreeze(EnOkuta* this) { this->timer = 80; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); this->actionFunc = EnOkuta_Freeze; } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index c587270062..a8a24c7d91 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1318,7 +1318,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) { Player* player = GET_PLAYER(play); osSyncPrintf("\n" VT_FGCOL(YELLOW) "初めて手にいれた!!" VT_RST "\n\n"); - func_8002F434(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); + Actor_OfferGetItem(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.stateTimer = 4; player->stateFlags2 &= ~PLAYER_STATE2_29; @@ -1649,7 +1649,7 @@ void EnOssan_State_GiveItemWithFanfare(EnOssan* this, PlayState* play, Player* p this->stateFlag = OSSAN_STATE_ITEM_PURCHASED; return; } - func_8002F434(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); + Actor_OfferGetItem(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); } void EnOssan_State_ItemPurchased(EnOssan* this, PlayState* play, Player* player) { diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 39db464655..2fd1696e9b 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -772,7 +772,7 @@ void EnPeehat_SetStateBoomerangStunned(EnPeehat* this) { } this->bladeRotVel = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_SetColorFilter(&this->actor, 0, 200, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); EnPeehat_SetupAction(this, EnPeehat_StateBoomerangStunned); } @@ -789,7 +789,7 @@ void EnPeehat_Adult_SetStateDie(EnPeehat* this) { this->bladeRotVel = 0; this->isStateDieFirstUpdate = 1; this->actor.speedXZ = 0.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); this->state = PEAHAT_STATE_DYING; this->scaleShift = 0.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -894,7 +894,7 @@ void EnPeehat_Adult_CollisionCheck(EnPeehat* this, PlayState* play) { return; } else { Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_PIHAT_DAMAGE); } @@ -907,7 +907,7 @@ void EnPeehat_Adult_CollisionCheck(EnPeehat* this, PlayState* play) { pos.z = Rand_CenteredFloat(20.0f) + this->actor.world.pos.z; EffectSsEnFire_SpawnVec3f(play, &this->actor, &pos, 70, 0, 0, -1); } - Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, 100); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 100); } if (this->actor.colChkInfo.health == 0) { EnPeehat_Adult_SetStateDie(this); diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 46f118b95e..3c879deda6 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -270,7 +270,7 @@ void EnPoField_SetupDamage(EnPoField* this) { } this->collider.base.acFlags &= ~(AC_HIT | AC_ON); this->actor.speedXZ = 5.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 16); this->actionFunc = EnPoField_Damage; } diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 3e56568ed9..0880704528 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -309,7 +309,7 @@ void func_80AD95D8(EnPoSisters* this) { this->actor.speedXZ = 10.0f; } this->unk_199 &= ~0xB; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x10); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 16); this->actionFunc = func_80ADAAA4; } diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 135126ca92..1b77a42ff5 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -300,7 +300,7 @@ void func_80ADE28C(EnPoh* this) { } this->colliderCyl.base.acFlags &= ~AC_ON; this->actor.speedXZ = 5.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x10); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 16); this->actionFunc = func_80ADEECC; } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 0541e94678..8c11e31b73 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -729,12 +729,13 @@ void EnRd_SetupStunned(EnRd* this) { this->stunnedBySunsSong = true; this->sunsSongStunTimer = 600; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); - Actor_SetColorFilter(&this->actor, -0x8000, -0x7F38, 0, 0xFF); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, COLORFILTER_INTENSITY_FLAG | 200, + COLORFILTER_BUFFLAG_OPA, 255); } else if (this->damageEffect == REDEAD_DMGEFF_HOOKSHOT) { - Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); } else { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); - Actor_SetColorFilter(&this->actor, -0x8000, 0xC8, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 200, COLORFILTER_BUFFLAG_OPA, 80); } EnRd_SetupAction(this, EnRd_Stunned); @@ -744,7 +745,7 @@ void EnRd_Stunned(EnRd* this, PlayState* play) { if (this->stunnedBySunsSong && (this->sunsSongStunTimer != 0)) { this->sunsSongStunTimer--; if (this->sunsSongStunTimer >= 255) { - Actor_SetColorFilter(&this->actor, -0x8000, 0xC8, 0, 0xFF); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 200, COLORFILTER_BUFFLAG_OPA, 255); } if (this->sunsSongStunTimer == 0) { @@ -818,10 +819,10 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { this->sunsSongStunTimer = 0; if (this->damageEffect == REDEAD_DMGEFF_FIRE_MAGIC) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 80); this->fireTimer = 40; } else { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); } Actor_ApplyDamage(&this->actor); diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 1e30b627b2..8c35650ac0 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -355,7 +355,7 @@ void func_80AE57F0(EnReeba* this, PlayState* play) { this->unk_276 = 14; this->actor.speedXZ = -8.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); this->actionfunc = func_80AE5854; } @@ -446,7 +446,7 @@ void func_80AE5A9C(EnReeba* this, PlayState* play) { void func_80AE5BC4(EnReeba* this, PlayState* play) { this->actor.speedXZ = -8.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); this->unk_278 = 14; this->actor.flags &= ~ACTOR_FLAG_0; this->actionfunc = func_80AE5C38; @@ -528,7 +528,8 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) { if ((this->actor.colChkInfo.health > 1) && (this->unk_27E != 4)) { this->unk_27E = 4; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + 80); this->actionfunc = func_80AE58EC; break; } @@ -536,7 +537,8 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) { case 13: // hookshot/longshot if ((this->actor.colChkInfo.health > 2) && (this->unk_27E != 4)) { this->unk_27E = 4; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + 80); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->actionfunc = func_80AE58EC; break; @@ -561,13 +563,14 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) { Actor_ApplyDamage(&this->actor); this->unk_27C = 2; this->unk_27E = 2; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); this->actionfunc = func_80AE58EC; break; case 1: // unknown if (this->unk_27E != 4) { this->unk_27E = 4; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + 80); this->actionfunc = func_80AE58EC; } break; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 4d762f8474..5018c82a29 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -453,7 +453,8 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { this->stopScroll = false; Actor_ApplyDamage(&this->actor); this->invincibilityTimer = 40; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, this->invincibilityTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, + this->invincibilityTimer); if (this->hasPlayer) { EnRr_SetupReleasePlayer(this, play); } else if (this->actor.colChkInfo.health != 0) { @@ -468,7 +469,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); this->effectTimer = 20; EnRr_SetupStunned(this); return; @@ -479,7 +480,8 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { } if (this->actor.colorFilterTimer == 0) { this->effectTimer = 20; - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, + 80); } EnRr_SetupStunned(this); return; @@ -488,12 +490,12 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RUPEE_RED; } - Actor_SetColorFilter(&this->actor, -0x8000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_XLU, 80); EnRr_SetupStunned(this); return; case RR_DMG_STUN: // Boomerang and Hookshot Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); EnRr_SetupStunned(this); return; } diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index e10a3efaf5..af08b7f943 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -1574,7 +1574,7 @@ void func_80AEE568(EnRu1* this, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speedXZ == 0.0f) && (this->actor.minVelocityY == 0.0f)) { func_80AEE02C(this); - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); this->action = 27; func_80AEADD8(this); } else if (this->actor.yDistToWater > 0.0f) { @@ -1675,7 +1675,7 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) { s32 func_80AEEAC8(EnRu1* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80AEE02C(this); - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); this->action = 27; func_80AEADD8(this); return true; @@ -1693,7 +1693,7 @@ void func_80AEEB24(EnRu1* this, PlayState* play) { } void func_80AEEBB4(EnRu1* this, PlayState* play) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } void func_80AEEBD4(EnRu1* this, PlayState* play) { @@ -1845,7 +1845,7 @@ void func_80AEF1F0(EnRu1* this, PlayState* play, UNK_TYPE arg2) { Message_CloseTextbox(play); SET_INFTABLE(INFTABLE_143); func_80AED6DC(this, play); - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); this->action = 27; func_80AEADD8(this); } diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 12444af28d..61a47d1574 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -392,7 +392,7 @@ s32 EnSb_UpdateDamage(EnSb* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); tookDamage = true; } } @@ -400,7 +400,7 @@ s32 EnSb_UpdateDamage(EnSb* this, PlayState* play) { case 2: // fire arrow, dins fire this->fire = 4; Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); tookDamage = true; break; case 1: // hookshot/longshot @@ -410,7 +410,7 @@ s32 EnSb_UpdateDamage(EnSb* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 80); tookDamage = true; EnSb_SetupCooldown(this, 0); } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 6c33e545cf..bf5ebbb12e 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -463,7 +463,8 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { this->setColliderAT = false; if (this->actor.colChkInfo.damageEffect == 1) { if (this->actionState != SKB_BEHAVIOR_STUNNED) { - Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, + 80); Actor_ApplyDamage(&this->actor); EnSkb_SetupStunned(this); } @@ -480,7 +481,8 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { } colorFilterDuration = 25; } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, colorFilterDuration); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, + colorFilterDuration); if (!Actor_ApplyDamage(&this->actor)) { EnSkb_SetupDeath(this, play); return; diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 9f236e43d4..1286eeef67 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -591,14 +591,14 @@ s32 EnSkj_CollisionCheck(EnSkj* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if ((this->action == 2) || (this->action == 6)) { if ((yawDiff > 0x6000) || (yawDiff < -0x6000)) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); EnSkj_SetupDie(this); return 1; } } Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (this->actor.colChkInfo.health != 0) { if (this->hitsUntilDodge != 0) { @@ -1036,7 +1036,8 @@ void EnSkj_SariaSongTalk(EnSkj* this, PlayState* play) { EnSkj_SetupWaitInRange(this); } else { func_80AFFE24(this); - func_8002F434(&this->actor, play, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); + Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), + EnSkj_GetItemYRange(this)); } } } @@ -1050,7 +1051,7 @@ void func_80AFFE44(EnSkj* this, PlayState* play) { this->actor.parent = NULL; EnSkj_SetupPostSariasSong(this); } else { - func_8002F434(&this->actor, play, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); + Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); } } @@ -1528,7 +1529,7 @@ void EnSkj_WonOcarinaMiniGame(EnSkj* this, PlayState* play) { void EnSkj_WaitToGiveReward(EnSkj* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - func_8002F434(&this->actor, play, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f); + Actor_OfferGetItem(&this->actor, play, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f); this->actionFunc = EnSkj_GiveOcarinaGameReward; } } @@ -1538,7 +1539,7 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnSkj_FinishOcarinaGameRound; } else { - func_8002F434(&this->actor, play, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f); + Actor_OfferGetItem(&this->actor, play, sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f); } } diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index d7f924e295..328a818701 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -291,7 +291,7 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 scale, f32 radiusMod) { s32 EnSsh_Damaged(EnSsh* this) { if ((this->stunTimer == 120) && (this->stateFlags & SSH_STATE_STUNNED)) { - Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, this->stunTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, this->stunTimer); } if (DECR(this->stunTimer) != 0) { Math_SmoothStepToS(&this->maxTurnRate, 0x2710, 0xA, 0x3E8, 1); diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 779acf551f..a28b7a4af4 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -450,7 +450,8 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { if (this->stunTimer == 0) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->stunTimer = 120; - Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, this->stunTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, + this->stunTimer); } return false; } @@ -459,7 +460,8 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { this->gaveDamageSpinTimer = 1; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENST_ANIM_3); this->takeDamageSpinTimer = this->skelAnime.animLength; - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, this->takeDamageSpinTimer); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, + this->takeDamageSpinTimer); if (Actor_ApplyDamage(&this->actor)) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_STALTU_DAMAGE); return false; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index d25459f90a..c84643eec4 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -250,7 +250,7 @@ void EnSth_GivePlayerItem(EnSth* this, PlayState* play) { break; } - func_8002F434(&this->actor, play, getItemId, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f); } void EnSth_GiveReward(EnSth* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index dbdff8d381..97ad08045d 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -329,7 +329,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { if ((this->collider.base.acFlags & AC_HIT) || phi_v1) { this->collider.base.acFlags &= ~AC_HIT; this->unk_392 = 0x10; - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, this->unk_392); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, this->unk_392); if (Actor_ApplyDamage(&this->actor) != 0) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_STALTU_DAMAGE); return true; diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 85a95a216b..288ea4bb76 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -365,7 +365,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { this->getItemId = GI_RUPEE_PURPLE; } } - func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); this->actionFunc = EnSyatekiMan_GivePrize; break; case SYATEKI_RESULT_ALMOST: @@ -394,7 +394,7 @@ void EnSyatekiMan_GivePrize(EnSyatekiMan* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = EnSyatekiMan_FinishPrize; } else { - func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); } } diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 9d15dfba08..8b0ea6e0df 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -945,9 +945,9 @@ void EnTa_GiveItemInLonLonHouse(EnTa* this, PlayState* play) { } this->stateFlags &= ~TALON_STATE_FLAG_GIVING_MILK_REFILL; } else if (this->stateFlags & TALON_STATE_FLAG_GIVING_MILK_REFILL) { - func_8002F434(&this->actor, play, GI_MILK, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 50.0f); } else { - func_8002F434(&this->actor, play, GI_BOTTLE_MILK_FULL, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_MILK_FULL, 10000.0f, 50.0f); } this->stateFlags |= TALON_STATE_FLAG_TRACKING_PLAYER; } @@ -957,7 +957,7 @@ void EnTa_TalkAfterCuccoGameFirstWon(EnTa* this, PlayState* play) { Message_CloseTextbox(play); this->stateFlags &= ~TALON_STATE_FLAG_GIVING_MILK_REFILL; EnTa_SetupAction(this, EnTa_GiveItemInLonLonHouse, EnTa_AnimRunToEnd); - func_8002F434(&this->actor, play, GI_BOTTLE_MILK_FULL, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_MILK_FULL, 10000.0f, 50.0f); } } @@ -980,7 +980,7 @@ void EnTa_WaitBuyMilkOrPlayCuccoGameResponse(EnTa* this, PlayState* play) { this->stateFlags |= TALON_STATE_FLAG_GIVING_MILK_REFILL; EnTa_SetupAction(this, EnTa_GiveItemInLonLonHouse, EnTa_AnimRunToEnd); Rupees_ChangeBy(-30); - func_8002F434(&this->actor, play, GI_MILK, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 50.0f); break; } break; @@ -1077,7 +1077,7 @@ void EnTa_TalkAfterCuccoGameWon(EnTa* this, PlayState* play) { Message_CloseTextbox(play); this->stateFlags |= TALON_STATE_FLAG_GIVING_MILK_REFILL; EnTa_SetupAction(this, EnTa_GiveItemInLonLonHouse, EnTa_AnimRunToEnd); - func_8002F434(&this->actor, play, GI_MILK, 10000.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 50.0f); } else { Message_ContinueTextbox(play, 0x208A); EnTa_SetupAction(this, EnTa_TalkGeneralInLonLonHouse, EnTa_AnimRunToEnd); diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index 6655382313..b5ed0c59fb 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -135,7 +135,7 @@ void func_80B17934(EnTakaraMan* this, PlayState* play) { Rupees_ChangeBy(-10); this->unk_214 = 1; this->actor.parent = NULL; - func_8002F434(&this->actor, play, GI_DOOR_KEY, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, GI_DOOR_KEY, 2000.0f, 1000.0f); this->actionFunc = func_80B17A6C; } else { Message_CloseTextbox(play); @@ -160,7 +160,7 @@ void func_80B17A6C(EnTakaraMan* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_80B17AC4; } else { - func_8002F434(&this->actor, play, GI_DOOR_KEY, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, GI_DOOR_KEY, 2000.0f, 1000.0f); } } diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 815a5479a7..3a1b45b420 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -1211,7 +1211,7 @@ void func_80862154(EnTest* this) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_STAL_DAMAGE); this->unk_7C8 = 8; this->actor.speedXZ = -2.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); EnTest_SetupAction(this, func_808621D4); } @@ -1255,7 +1255,7 @@ void func_80862398(EnTest* this) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_STAL_DAMAGE); this->unk_7C8 = 9; this->actor.speedXZ = -2.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); EnTest_SetupAction(this, func_80862418); } @@ -1298,9 +1298,9 @@ void EnTest_SetupStunned(EnTest* this) { this->actor.speedXZ = -4.0f; if (this->lastDamageEffect == STALFOS_DMGEFF_LIGHT) { - Actor_SetColorFilter(&this->actor, -0x8000, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 120, COLORFILTER_BUFFLAG_OPA, 80); } else { - Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); if (this->lastDamageEffect == STALFOS_DMGEFF_FREEZE) { this->iceTimer = 36; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 625982c6bc..13c80a9759 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -856,14 +856,14 @@ void EnTite_CheckDamage(Actor* thisx, PlayState* play) { // 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) { - Actor_SetColorFilter(thisx, 0, 0x78, 0, 0x50); + Actor_SetColorFilter(thisx, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(thisx); EnTite_SetupStunned(this); } // Otherwise apply damage and handle death where necessary } else { if ((thisx->colorFilterTimer == 0) || ((thisx->colorFilterParams & 0x4000) == 0)) { - Actor_SetColorFilter(thisx, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(thisx, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); Actor_ApplyDamage(thisx); } if (thisx->colChkInfo.health == 0) { diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index e00d4a861e..5822795723 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -588,9 +588,9 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { func_800F5ACC(NA_BGM_MINI_BOSS); if (this->actor.colChkInfo.damageEffect == 1) { if (sAlpha == 255) { - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); } else { - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); } } else { this->actor.flags &= ~ACTOR_FLAG_0; @@ -604,9 +604,9 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->stateFlags3 |= PLAYER_STATE3_0; sActionState = ENTORCH2_DAMAGE; if (sAlpha == 255) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0xC); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); } else { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0xC); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 12); } } } diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index e263094710..2856fb0268 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -311,7 +311,7 @@ void func_80B20768(EnToryo* this, PlayState* play) { this->actor.parent = NULL; this->unk_1E4 = 5; } else { - func_8002F434(&this->actor, play, GI_BROKEN_GORONS_SWORD, 100.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_BROKEN_GORONS_SWORD, 100.0f, 10.0f); } return; } diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 8e79324941..d397612653 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -607,9 +607,11 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { this->actor.freezeTimer = 80; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); if (phi_s2 != 0) { - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + 80); } else { - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, + 80); } } @@ -621,9 +623,11 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); if (phi_s2 != 0) { - Actor_SetColorFilter(&now->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&now->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + 80); } else { - Actor_SetColorFilter(&now->actor, 0, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&now->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, + 80); } } } @@ -634,9 +638,11 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { now->actor.freezeTimer = 80; if (phi_s2 != 0) { - Actor_SetColorFilter(&now->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&now->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, + 80); } else { - Actor_SetColorFilter(&now->actor, 0, 0xFF, 0x2000, 0x50); + Actor_SetColorFilter(&now->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, + 80); } } } diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index e742cdba10..d37849c6b7 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -150,7 +150,7 @@ void EnTrap_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { icePos = thisx->world.pos; this->collider.base.acFlags &= ~AC_HIT; - Actor_SetColorFilter(thisx, 0, 250, 0, 250); + Actor_SetColorFilter(thisx, COLORFILTER_COLORFLAG_BLUE, 250, COLORFILTER_BUFFLAG_OPA, 250); icePos.y += 10.0f; icePos.z += 10.0f; EffectSsEnIce_SpawnFlyingVec3f(play, thisx, &icePos, 150, 150, 150, 250, 235, 245, 255, 1.8f); diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index bd05ffcea6..89028c7d59 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -216,7 +216,7 @@ void EnVali_SetupAttacked(EnVali* this) { void EnVali_SetupRetaliate(EnVali* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBariRetaliatingAnim, -5.0f); - Actor_SetColorFilter(&this->actor, 0x4000, 150, 0x2000, 30); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 150, COLORFILTER_BUFFLAG_XLU, 30); this->actor.params = BARI_TYPE_NORMAL; this->bodyCollider.base.acFlags &= ~AC_ON; this->actionFunc = EnVali_Retaliate; @@ -230,7 +230,7 @@ void EnVali_SetupMoveArmsDown(EnVali* this) { void EnVali_SetupBurnt(EnVali* this) { this->timer = 2; this->bodyCollider.base.acFlags &= ~AC_ON; - Actor_SetColorFilter(&this->actor, 0x4000, 150, 0x2000, 30); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 150, COLORFILTER_BUFFLAG_XLU, 30); this->actionFunc = EnVali_Burnt; } @@ -257,7 +257,7 @@ void EnVali_SetupStunned(EnVali* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBariWaitingAnim, 10.0f); this->timer = 80; this->actor.velocity.y = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 255, 0x2000, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); this->bodyCollider.info.bumper.effect = 0; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->actor.velocity.y = 1.0f; @@ -266,7 +266,7 @@ void EnVali_SetupStunned(EnVali* this) { void EnVali_SetupFrozen(EnVali* this) { this->actor.velocity.y = 0.0f; - Actor_SetColorFilter(&this->actor, 0, 255, 0x2000, 36); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 36); this->bodyCollider.base.acFlags &= ~AC_ON; this->timer = 36; this->actionFunc = EnVali_Frozen; @@ -514,7 +514,7 @@ void EnVali_UpdateDamage(EnVali* this, PlayState* play) { } } else if (this->actor.colChkInfo.damageEffect == BARI_DMGEFF_SWORD) { if (this->actionFunc != EnVali_Stunned) { - Actor_SetColorFilter(&this->actor, 0x4000, 150, 0x2000, 30); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 150, COLORFILTER_BUFFLAG_XLU, 30); this->actor.params = BARI_TYPE_SWORD_DAMAGE; EnVali_SetupAttacked(this); } else { diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index feab3aeea8..bb3ebf5d63 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -401,7 +401,7 @@ void EnVm_CheckHealth(EnVm* this, PlayState* play) { } if (this->actor.colChkInfo.health != 0) { - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); EnVm_SetupStun(this); } else { bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index dfa64dc373..8feba5a8fd 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -225,7 +225,7 @@ void EnWallmas_SetupTakeDamage(EnWallmas* this) { this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x14); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 20); this->actionFunc = EnWallmas_TakeDamage; this->actor.speedXZ = 5.0f; this->actor.velocity.y = 10.0f; @@ -279,9 +279,9 @@ void EnWallmas_SetupStun(EnWallmas* this) { this->actor.speedXZ = 0.0f; if (this->actor.colChkInfo.damageEffect == 4) { - Actor_SetColorFilter(&this->actor, -0x8000, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 80); } else { - Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); } diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 9a1bb00d89..09e12c7a28 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -170,7 +170,7 @@ void func_80B325A0(EnWeiyer* this) { this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; this->actor.speedXZ = 3.0f; - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, 0x28); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40); this->collider.dim.height = sCylinderInit.dim.height; this->actionFunc = func_80B331CC; } @@ -182,7 +182,7 @@ void func_80B32660(EnWeiyer* this) { this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; this->collider.dim.height = sCylinderInit.dim.height + 15; - Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x50); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); this->collider.base.atFlags &= ~AT_ON; Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->actionFunc = func_80B333B8; @@ -191,7 +191,7 @@ void func_80B32660(EnWeiyer* this) { void func_80B32724(EnWeiyer* this) { Animation_MorphToLoop(&this->skelAnime, &gStingerHitAnim, -5.0f); this->unk_194 = 20; - Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, 0x28); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_OPA, 40); this->collider.base.atFlags &= ~AT_ON; this->collider.base.acFlags &= ~AC_ON; this->actor.speedXZ = 3.0f; diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index edc24f4b82..2e399cd07e 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1272,12 +1272,13 @@ void EnWf_UpdateDamage(EnWf* this, PlayState* play) { if ((this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_STUN) || (this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_UNDEF)) { if (this->action != WOLFOS_ACTION_STUNNED) { - Actor_SetColorFilter(&this->actor, 0, 120, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, + 80); Actor_ApplyDamage(&this->actor); EnWf_SetupStunned(this); } } else { // LIGHT_MAGIC, FIRE, NONE - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (this->damageEffect == ENWF_DMGEFF_FIRE) { this->fireTimer = 40; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index a9508bdd89..08c4c0e579 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -2005,13 +2005,13 @@ void EnZf_UpdateDamage(EnZf* this, PlayState* play) { if ((this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_STUN) || (this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_ICE)) { if (this->action != ENZF_ACTION_STUNNED) { - Actor_SetColorFilter(&this->actor, 0, 120, 0, 80); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(&this->actor); EnZf_SetupStunned(this); } } else { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_RIZA_CRY); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); if (Actor_ApplyDamage(&this->actor) == 0) { dropParams = 0x40; diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index f4d3b90467..46e750b420 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -511,7 +511,7 @@ void func_80B4BF2C(EnZl1* this, PlayState* play) { if ((Message_GetState(msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { this->actor.textId = 0xFFFF; play->talkWithPlayer(play, &this->actor); - func_8002F434(&this->actor, play, GI_ZELDAS_LETTER, 120.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_ZELDAS_LETTER, 120.0f, 10.0f); play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.stateTimer = 4; this->unk_1E2++; @@ -526,7 +526,7 @@ void func_80B4BF2C(EnZl1* this, PlayState* play) { this->actor.parent = NULL; this->unk_1E2++; } else { - func_8002F434(&this->actor, play, GI_ZELDAS_LETTER, 120.0f, 10.0f); + Actor_OfferGetItem(&this->actor, play, GI_ZELDAS_LETTER, 120.0f, 10.0f); } break; case 3: diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 3211b21769..44c2a0dbbc 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -1114,8 +1114,8 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { Camera_ChangeSetting(GET_ACTIVE_CAM(play), CAM_SET_NORMAL0); this->talkState = 7; play->talkWithPlayer(play, &this->actor); - func_8002F434(&this->actor, play, GI_ZELDAS_LETTER, fabsf(this->actor.xzDistToPlayer) + 1.0f, - fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, GI_ZELDAS_LETTER, fabsf(this->actor.xzDistToPlayer) + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); play->msgCtx.stateTimer = 4; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; } @@ -1125,8 +1125,8 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0); this->talkState++; } else { - func_8002F434(&this->actor, play, GI_ZELDAS_LETTER, fabsf(this->actor.xzDistToPlayer) + 1.0f, - fabsf(this->actor.yDistToPlayer) + 1.0f); + Actor_OfferGetItem(&this->actor, play, GI_ZELDAS_LETTER, fabsf(this->actor.xzDistToPlayer) + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); } // no break here is required for matching } diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index e15e3cdd24..987a69241d 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -4992,7 +4992,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { } this->actor.parent = NULL; - func_8002F434(&this->actor, play, getItemId, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f); this->unk_15C = 23; } break; @@ -5043,7 +5043,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->unk_15C = 24; } else { - func_8002F434(&this->actor, play, GI_SCALE_GOLDEN, 2000.0f, 1000.0f); + Actor_OfferGetItem(&this->actor, play, GI_SCALE_GOLDEN, 2000.0f, 1000.0f); } break; diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 0965d9fb0d..0f214b4ba3 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -58,7 +58,7 @@ void ItemBHeart_Update(Actor* thisx, PlayState* play) { Flags_SetCollectible(play, 0x1F); Actor_Kill(&this->actor); } else { - func_8002F434(&this->actor, play, GI_HEART_CONTAINER_2, 30.0f, 40.0f); + Actor_OfferGetItem(&this->actor, play, GI_HEART_CONTAINER_2, 30.0f, 40.0f); } } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index d9db53806c..2850184c78 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -158,7 +158,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { } Actor_Kill(&this->actor); } else { - func_8002F434(&this->actor, play, this->getItemId, 30.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 30.0f, 50.0f); } } @@ -171,7 +171,7 @@ void func_80B858B4(ItemEtcetera* this, PlayState* play) { Actor_Kill(&this->actor); } else { if (0) {} // Necessary to match - func_8002F434(&this->actor, play, this->getItemId, 30.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, this->getItemId, 30.0f, 50.0f); if ((play->gameplayFrames & 0xD) == 0) { EffectSsBubble_Spawn(play, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f); } diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 112d4aee90..7c92b3fdaf 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -180,7 +180,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, PlayState* play) { this->actionFunc = ItemOcarina_StartSoTCutscene; this->actor.draw = NULL; } else { - func_8002F434(&this->actor, play, GI_OCARINA_OF_TIME, 30.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_OCARINA_OF_TIME, 30.0f, 50.0f); if ((play->gameplayFrames & 13) == 0) { EffectSsBubble_Spawn(play, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f); diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index c6accb49a2..434bfcc716 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -102,7 +102,7 @@ void func_80B86AC8(ItemShield* this, PlayState* play) { Actor_Kill(&this->actor); return; } - func_8002F434(&this->actor, play, GI_SHIELD_DEKU, 30.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_SHIELD_DEKU, 30.0f, 50.0f); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->timer--; @@ -124,7 +124,7 @@ void func_80B86BC8(ItemShield* this, PlayState* play) { Actor_Kill(&this->actor); return; } - func_8002F434(&this->actor, play, GI_SHIELD_DEKU, 30.0f, 50.0f); + Actor_OfferGetItem(&this->actor, play, GI_SHIELD_DEKU, 30.0f, 50.0f); if (this->collider.base.acFlags & AC_HIT) { ItemShield_SetupAction(this, func_80B86AC8); this->actor.velocity.y = 4.0f; diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index e16b606c42..5ce78a5dcc 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -211,7 +211,7 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { } } if (this->actor.xzDistToPlayer < 100.0f) { - func_8002F580(&this->actor, play); + Actor_OfferCarry(&this->actor, play); } } } diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 18b972df2c..7f343a15e5 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -266,7 +266,7 @@ void ObjTsubo_Idle(ObjTsubo* this, PlayState* play) { phi_v1 = ABS(temp_v0); if (phi_v1 >= 0x5556) { // GI_NONE in this case allows the player to lift the actor - func_8002F434(&this->actor, play, GI_NONE, 30.0f, 30.0f); + Actor_OfferGetItem(&this->actor, play, GI_NONE, 30.0f, 30.0f); } } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index c0ca4c7acf..9d153a8b6a 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -10431,7 +10431,7 @@ void func_80848C74(PlayState* play, Player* this) { void func_80848EF8(Player* this) { if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)) { - f32 temp = 200000.0f - (this->unk_6A4 * 5.0f); + f32 temp = 200000.0f - (this->closestSecretDistSq * 5.0f); if (temp < 0.0f) { temp = 0.0f; @@ -10799,7 +10799,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { } this->stateFlags2 &= ~PLAYER_STATE2_23; - this->unk_6A4 = FLT_MAX; + this->closestSecretDistSq = FLT_MAX; temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y; diff --git a/tools/namefixer.py b/tools/namefixer.py index 859ee14899..150d094c44 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -238,6 +238,9 @@ wordReplace = { "func_8002E0D0": "Actor_ActorAIsFacingActorB", "func_8002E12C": "Actor_IsFacingAndNearPlayer", "func_8002E1A8": "Actor_ActorAIsFacingAndNearActorB", + "func_8002F434": "Actor_OfferGetItem", + "func_8002F554": "Actor_OfferGetItemNearby", + "func_8002F580": "Actor_OfferCarry", "func_80033A84": "Actor_IsTargeted", "func_80033AB8": "Actor_OtherIsTargeted", "func_80035650": "Actor_SetDropFlag",