Document Arrow Related Actor Flags (#1737)

* arrow flags

* rm comment

* cleanup func
This commit is contained in:
engineer124 2024-11-08 15:34:13 +11:00 committed by GitHub
parent fcc5cf828d
commit 4337c2a4f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 47 additions and 48 deletions

View File

@ -504,10 +504,12 @@ typedef enum DoorLockType {
#define ACTOR_FLAG_IGNORE_QUAKE (1 << 12)
//
#define ACTOR_FLAG_2000 (1 << 13)
//
#define ACTOR_FLAG_4000 (1 << 14)
//! Carried by arrow
#define ACTOR_FLAG_8000 (1 << 15)
// When hit by an arrow, the actor will be able to attach to the arrow and fly with it in the air
#define ACTOR_FLAG_CAN_ATTACH_TO_ARROW (1 << 14)
// Actor is currently attached to an arrow and flying with it in the air
#define ACTOR_FLAG_ATTACHED_TO_ARROW (1 << 15)
// Player automatically accepts a Talk Offer without needing to press the A button.
// Player still has to meet all conditions to be able to receive a talk offer (for example, being in range).

View File

@ -181,7 +181,7 @@ void EnArrow_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyQuad(play, &this->collider);
if ((this->unk_264 != NULL) && (this->unk_264->update != NULL)) {
this->unk_264->flags &= ~ACTOR_FLAG_8000;
this->unk_264->flags &= ~ACTOR_FLAG_ATTACHED_TO_ARROW;
}
if (ARROW_IS_MAGICAL(this->actor.params) && (this->actor.child == NULL)) {
@ -439,11 +439,11 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
sp7C = this->collider.base.at;
if ((sp7C->update != NULL) && !(this->collider.base.atFlags & AT_BOUNCED) &&
(sp7C->flags & ACTOR_FLAG_4000)) {
(sp7C->flags & ACTOR_FLAG_CAN_ATTACH_TO_ARROW)) {
this->unk_264 = sp7C;
func_8088A894(this, play);
Math_Vec3f_Diff(&sp7C->world.pos, &this->actor.world.pos, &this->unk_268);
sp7C->flags |= ACTOR_FLAG_8000;
sp7C->flags |= ACTOR_FLAG_ATTACHED_TO_ARROW;
this->collider.base.atFlags &= ~AT_HIT;
this->actor.speed *= 0.5f;
this->actor.velocity.y *= 0.5f;
@ -542,14 +542,14 @@ void func_8088ACE0(EnArrow* this, PlayState* play) {
this->unk_264->world.pos.z = ((sp54.z <= sp9C.z) ? 1.0f : -1.0f) + sp9C.z;
Math_Vec3f_Diff(&this->unk_264->world.pos, &this->actor.world.pos, &this->unk_268);
this->unk_264->flags &= ~ACTOR_FLAG_8000;
this->unk_264->flags &= ~ACTOR_FLAG_ATTACHED_TO_ARROW;
this->unk_264 = NULL;
} else {
Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_268, &this->unk_264->world.pos);
}
if ((this->unk_262 != 0) && (this->unk_264 != NULL)) {
this->unk_264->flags &= ~ACTOR_FLAG_8000;
this->unk_264->flags &= ~ACTOR_FLAG_ATTACHED_TO_ARROW;
this->unk_264 = NULL;
}
} else {

View File

@ -8,7 +8,8 @@
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "assets/objects/object_bat/object_bat.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnBat*)thisx)
@ -342,7 +343,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40);
if (this->actor.flags & ACTOR_FLAG_8000) {
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
this->actor.speed = 0.0f;
}
@ -355,7 +356,7 @@ void EnBat_Die(EnBat* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
this->actor.colorFilterTimer = 40;
if (!(this->actor.flags & ACTOR_FLAG_8000)) { // Carried by arrow
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200);
this->actor.shape.rot.z += 0x1780;

View File

@ -7,7 +7,8 @@
#include "z_en_crow.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnCrow*)thisx)
@ -327,7 +328,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) {
}
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40);
if (this->actor.flags & ACTOR_FLAG_8000) {
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
this->actor.speed = 0.0f;
}
@ -341,7 +342,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
this->actor.colorFilterTimer = 40;
if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200);
this->actor.shape.rot.z += 0x1780;

View File

@ -7,7 +7,7 @@
#include "z_en_fg.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_200 | ACTOR_FLAG_4000)
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_200 | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnFg*)thisx)
@ -348,7 +348,7 @@ void EnFg_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
this->actor.flags |= ACTOR_FLAG_4000;
this->actor.flags |= ACTOR_FLAG_CAN_ATTACH_TO_ARROW;
Actor_SetScale(&this->actor, 0.01f);
this->actor.gravity = -1.6f;
this->actionFunc = EnFg_Idle;
@ -362,20 +362,12 @@ void EnFg_Destroy(Actor* thisx, PlayState* play) {
void EnFg_Update(Actor* thisx, PlayState* play) {
EnFg* this = THIS;
s32 flag;
s32 flagSet;
flag = this->actor.flags;
flagSet = CHECK_FLAG_ALL(flag, ACTOR_FLAG_2000);
if (1) {}
if (!flagSet) {
flagSet = CHECK_FLAG_ALL(flag, ACTOR_FLAG_8000);
if (1) {}
if (!flagSet) {
this->actionFunc(this, play);
Actor_UpdateBgCheckInfo(play, &this->actor, sREG(0), sREG(1), 0.0f,
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4);
}
if ((CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_2000) == 0) &&
(CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_ATTACHED_TO_ARROW) == 0)) {
this->actionFunc(this, play);
Actor_UpdateBgCheckInfo(play, &this->actor, sREG(0), sREG(1), 0.0f,
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4);
}
EnFg_UpdateSkelAnime(this, play);

View File

@ -8,7 +8,8 @@
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnFirefly*)thisx)
@ -372,7 +373,7 @@ void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) {
this->auraType = KEESE_AURA_NONE;
}
if (this->actor.flags & ACTOR_FLAG_8000) {
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
this->actor.speed = 0.0f;
}
@ -384,7 +385,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
this->actor.colorFilterTimer = 40;
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200);
this->actor.shape.rot.y -= 0x300;
@ -691,7 +692,7 @@ void EnFirefly_Update(Actor* thisx, PlayState* play2) {
EnFirefly_UpdateDamage(this, play);
this->actionFunc(this, play);
if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
if ((this->actor.colChkInfo.health == 0) || (this->actionFunc == EnFirefly_Stunned)) {
Actor_MoveWithGravity(&this->actor);
} else {

View File

@ -6,8 +6,9 @@
#include "z_en_firefly2.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | \
ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnFirefly2*)thisx)

View File

@ -7,7 +7,7 @@
#include "z_en_jc_mato.h"
#include "assets/objects/object_tru/object_tru.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000)
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnJcMato*)thisx)

View File

@ -8,8 +8,9 @@
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | \
ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnPoSisters*)thisx)
@ -198,7 +199,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) {
EnPoSisters_SpawnMegClones(this, play);
EnPoSisters_SetupSpawnPo(this);
} else {
this->actor.flags &= ~(ACTOR_FLAG_200 | ACTOR_FLAG_4000);
this->actor.flags &= ~(ACTOR_FLAG_200 | ACTOR_FLAG_CAN_ATTACH_TO_ARROW);
this->collider.elem.elemMaterial = ELEM_MATERIAL_UNK4;
this->collider.elem.acDmgInfo.dmgFlags |= (0x40000 | 0x1);
this->collider.base.ocFlags1 = OC1_NONE;
@ -529,7 +530,7 @@ void EnPoSisters_SetupDamageFlinch(EnPoSisters* this) {
}
void EnPoSisters_DamageFlinch(EnPoSisters* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & ACTOR_FLAG_8000)) {
if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
if (this->actor.colChkInfo.health != 0) {
if (this->type != POE_SISTERS_TYPE_MEG) {
EnPoSisters_SetupFlee(this);

View File

@ -7,7 +7,7 @@
#include "z_en_ruppecrow.h"
#include "assets/objects/object_crow/object_crow.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000)
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
#define THIS ((EnRuppecrow*)thisx)
@ -464,7 +464,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) {
}
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40);
if (this->actor.flags & ACTOR_FLAG_8000) {
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
this->actor.speed = 0.0f;
}
@ -602,7 +602,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) {
}
this->actor.colorFilterTimer = 40;
if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
if (this->currentEffect != ENRUPPECROW_EFFECT_ICE) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200);
this->actor.shape.rot.z += 0x1780;

View File

@ -8,9 +8,9 @@
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000 | \
ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_20 | \
ACTOR_FLAG_CAN_ATTACH_TO_ARROW | ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT)
#define THIS ((EnSt*)thisx)
@ -877,7 +877,7 @@ void EnSt_Destroy(Actor* thisx, PlayState* play) {
void EnSt_Update(Actor* thisx, PlayState* play) {
EnSt* this = THIS;
if (this->actor.flags & ACTOR_FLAG_8000) {
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
SkelAnime_Update(&this->skelAnime);
this->unk_18C |= 0x80;
return;