mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Document Arrow Related Actor Flags (#2284)
* name arrow actor flags * fix flag check
This commit is contained in:
parent
e50581b9fb
commit
0d04f51e8e
8 changed files with 31 additions and 28 deletions
|
@ -156,11 +156,11 @@ typedef struct ActorShape {
|
|||
//
|
||||
#define ACTOR_FLAG_13 (1 << 13)
|
||||
|
||||
//
|
||||
#define ACTOR_FLAG_14 (1 << 14)
|
||||
// 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)
|
||||
|
||||
//
|
||||
#define ACTOR_FLAG_15 (1 << 15)
|
||||
// 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).
|
||||
|
|
|
@ -149,7 +149,7 @@ void EnArrow_Destroy(Actor* thisx, PlayState* play) {
|
|||
Collider_DestroyQuad(play, &this->collider);
|
||||
|
||||
if ((this->hitActor != NULL) && (this->hitActor->update != NULL)) {
|
||||
this->hitActor->flags &= ~ACTOR_FLAG_15;
|
||||
this->hitActor->flags &= ~ACTOR_FLAG_ATTACHED_TO_ARROW;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,11 +287,11 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
|
|||
hitActor = this->collider.base.at;
|
||||
|
||||
if ((hitActor->update != NULL) && !(this->collider.base.atFlags & AT_BOUNCED) &&
|
||||
(hitActor->flags & ACTOR_FLAG_14)) {
|
||||
(hitActor->flags & ACTOR_FLAG_CAN_ATTACH_TO_ARROW)) {
|
||||
this->hitActor = hitActor;
|
||||
EnArrow_CarryActor(this, play);
|
||||
Math_Vec3f_Diff(&hitActor->world.pos, &this->actor.world.pos, &this->unk_250);
|
||||
hitActor->flags |= ACTOR_FLAG_15;
|
||||
hitActor->flags |= ACTOR_FLAG_ATTACHED_TO_ARROW;
|
||||
this->collider.base.atFlags &= ~AT_HIT;
|
||||
this->actor.speed /= 2.0f;
|
||||
this->actor.velocity.y /= 2.0f;
|
||||
|
@ -353,14 +353,14 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
|
|||
this->hitActor->world.pos.y = hitPoint.y + ((sp54.y <= hitPoint.y) ? 1.0f : -1.0f);
|
||||
this->hitActor->world.pos.z = hitPoint.z + ((sp54.z <= hitPoint.z) ? 1.0f : -1.0f);
|
||||
Math_Vec3f_Diff(&this->hitActor->world.pos, &this->actor.world.pos, &this->unk_250);
|
||||
this->hitActor->flags &= ~ACTOR_FLAG_15;
|
||||
this->hitActor->flags &= ~ACTOR_FLAG_ATTACHED_TO_ARROW;
|
||||
this->hitActor = NULL;
|
||||
} else {
|
||||
Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &this->hitActor->world.pos);
|
||||
}
|
||||
|
||||
if (this->touchedPoly && (this->hitActor != NULL)) {
|
||||
this->hitActor->flags &= ~ACTOR_FLAG_15;
|
||||
this->hitActor->flags &= ~ACTOR_FLAG_ATTACHED_TO_ARROW;
|
||||
this->hitActor = NULL;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -345,7 +345,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) {
|
|||
this->flamePrimBlue = this->flameEnvColor.b = 255;
|
||||
thisx->world.pos.y += 50.0f;
|
||||
EnBb_SetupBlue(this);
|
||||
thisx->flags |= ACTOR_FLAG_14;
|
||||
thisx->flags |= ACTOR_FLAG_CAN_ATTACH_TO_ARROW;
|
||||
break;
|
||||
case ENBB_RED:
|
||||
thisx->naviEnemyId = NAVI_ENEMY_RED_BUBBLE;
|
||||
|
@ -374,7 +374,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) {
|
|||
EnBb_SetupWhite(play, this);
|
||||
EnBb_SetWaypoint(this, play);
|
||||
EnBb_FaceWaypoint(this);
|
||||
thisx->flags |= ACTOR_FLAG_14;
|
||||
thisx->flags |= ACTOR_FLAG_CAN_ATTACH_TO_ARROW;
|
||||
break;
|
||||
case ENBB_GREEN_BIG:
|
||||
this->path = this->actionState >> 4;
|
||||
|
@ -1237,7 +1237,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) {
|
|||
if (this->actor.colChkInfo.damageEffect != 0xD) {
|
||||
this->actionFunc(this, play);
|
||||
if ((this->actor.params <= ENBB_BLUE) && (this->actor.speed >= -6.0f) &&
|
||||
((this->actor.flags & ACTOR_FLAG_15) == 0)) {
|
||||
!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
|
||||
Actor_MoveXZGravity(&this->actor);
|
||||
}
|
||||
if (this->moveMode == BBMOVE_NORMAL) {
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#include "versions.h"
|
||||
#include "assets/objects/object_bl/object_bl.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14)
|
||||
#define FLAGS \
|
||||
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
|
||||
|
||||
void EnBili_Init(Actor* thisx, PlayState* play);
|
||||
void EnBili_Destroy(Actor* thisx, PlayState* play);
|
||||
|
@ -251,7 +252,7 @@ void EnBili_SetupFrozen(EnBili* this, PlayState* play) {
|
|||
s32 i;
|
||||
Vec3f effectPos;
|
||||
|
||||
if (!(this->actor.flags & ACTOR_FLAG_15)) {
|
||||
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
|
||||
this->actor.gravity = -1.0f;
|
||||
}
|
||||
|
||||
|
@ -456,7 +457,7 @@ void EnBili_Recoil(EnBili* this, PlayState* play) {
|
|||
void EnBili_Burnt(EnBili* this, PlayState* play) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->actor.flags & ACTOR_FLAG_15) {
|
||||
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
|
||||
this->actor.colorFilterTimer = 20;
|
||||
} else {
|
||||
if (this->timer != 0) {
|
||||
|
@ -477,7 +478,7 @@ void EnBili_Die(EnBili* this, PlayState* play) {
|
|||
s32 i;
|
||||
|
||||
if (this->actor.draw != NULL) {
|
||||
if (this->actor.flags & ACTOR_FLAG_15) {
|
||||
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
|
||||
return;
|
||||
}
|
||||
this->actor.draw = NULL;
|
||||
|
@ -533,7 +534,7 @@ void EnBili_Frozen(EnBili* this, PlayState* play) {
|
|||
this->timer--;
|
||||
}
|
||||
|
||||
if (!(this->actor.flags & ACTOR_FLAG_15)) {
|
||||
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
|
||||
this->actor.gravity = -1.0f;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include "z_en_crow.h"
|
||||
#include "assets/objects/object_crow/object_crow.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14)
|
||||
#define FLAGS \
|
||||
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
|
||||
|
||||
void EnCrow_Init(Actor* thisx, PlayState* play);
|
||||
void EnCrow_Destroy(Actor* thisx, PlayState* play);
|
||||
|
@ -175,7 +176,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_15) {
|
||||
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
|
||||
this->actor.speed = 0.0f;
|
||||
}
|
||||
|
||||
|
@ -329,7 +330,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_15)) {
|
||||
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
|
||||
if (this->actor.colorFilterParams & 0x4000) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200);
|
||||
this->actor.shape.rot.z += 0x1780;
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
#include "assets/objects/object_firefly/object_firefly.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_14)
|
||||
#define FLAGS \
|
||||
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
|
||||
|
||||
void EnFirefly_Init(Actor* thisx, PlayState* play);
|
||||
void EnFirefly_Destroy(Actor* thisx, PlayState* play);
|
||||
|
@ -423,7 +424,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
|
|||
this->actor.colorFilterTimer = 40;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
|
||||
if (this->actor.flags & ACTOR_FLAG_15) {
|
||||
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
|
||||
this->actor.colorFilterTimer = 40;
|
||||
} else {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200);
|
||||
|
@ -687,7 +688,7 @@ void EnFirefly_Update(Actor* thisx, PlayState* play2) {
|
|||
|
||||
this->actionFunc(this, play);
|
||||
|
||||
if (!(this->actor.flags & ACTOR_FLAG_15)) {
|
||||
if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
|
||||
if ((this->actor.colChkInfo.health == 0) || (this->actionFunc == EnFirefly_Stunned)) {
|
||||
Actor_MoveXZGravity(&this->actor);
|
||||
} else {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#define FLAGS \
|
||||
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_9 | ACTOR_FLAG_IGNORE_QUAKE | \
|
||||
ACTOR_FLAG_14)
|
||||
ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
|
||||
|
||||
void EnPoSisters_Init(Actor* thisx, PlayState* play);
|
||||
void EnPoSisters_Destroy(Actor* thisx, PlayState* play);
|
||||
|
@ -210,7 +210,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) {
|
|||
this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER;
|
||||
func_80AD9AA8(this, play);
|
||||
} else {
|
||||
this->actor.flags &= ~(ACTOR_FLAG_9 | ACTOR_FLAG_14);
|
||||
this->actor.flags &= ~(ACTOR_FLAG_9 | ACTOR_FLAG_CAN_ATTACH_TO_ARROW);
|
||||
this->collider.elem.elemMaterial = ELEM_MATERIAL_UNK4;
|
||||
this->collider.elem.acDmgInfo.dmgFlags |= DMG_DEKU_NUT;
|
||||
this->collider.base.ocFlags1 = OC1_NONE;
|
||||
|
@ -701,7 +701,7 @@ void func_80ADA9E8(EnPoSisters* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80ADAAA4(EnPoSisters* this, PlayState* play) {
|
||||
if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & ACTOR_FLAG_15)) {
|
||||
if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) {
|
||||
if (this->actor.colChkInfo.health != 0) {
|
||||
if (this->unk_194 != 0) {
|
||||
func_80AD96A4(this);
|
||||
|
|
|
@ -798,7 +798,7 @@ void EnSt_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.naviEnemyId = NAVI_ENEMY_SKULLTULA;
|
||||
}
|
||||
EnSt_CheckCeilingPos(this, play);
|
||||
this->actor.flags |= ACTOR_FLAG_14;
|
||||
this->actor.flags |= ACTOR_FLAG_CAN_ATTACH_TO_ARROW;
|
||||
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
|
||||
EnSt_SetColliderScale(this);
|
||||
this->actor.gravity = 0.0f;
|
||||
|
@ -1013,7 +1013,7 @@ void EnSt_Update(Actor* thisx, PlayState* play) {
|
|||
s32 pad;
|
||||
Color_RGBA8 color = { 0, 0, 0, 0 };
|
||||
|
||||
if (this->actor.flags & ACTOR_FLAG_15) {
|
||||
if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
} else if (!EnSt_CheckColliders(this, play)) {
|
||||
// no collision has been detected.
|
||||
|
|
Loading…
Reference in a new issue