1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Rename acDmgInfo.effect -> hitBacklash (#2555)

* CollisionCheckInfo.atHitEffect -> atHitBacklash

* ColliderElementDamageInfoAC.effect -> hitBacklash

* add HIT_BACKLASH_ enum

* bss

* bss

* bss

* bss

* bss

* Update comments
This commit is contained in:
Dragorn421 2025-06-17 11:23:49 +02:00 committed by GitHub
parent fc2992abf6
commit e8c59385bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 23 additions and 18 deletions

View file

@ -86,9 +86,14 @@ typedef struct ColliderElementDamageInfoAT {
/* 0x05 */ u8 damage; // Damage /* 0x05 */ u8 damage; // Damage
} ColliderElementDamageInfoAT; // size = 0x08 } ColliderElementDamageInfoAT; // size = 0x08
typedef enum HitBacklash {
HIT_BACKLASH_0,
HIT_BACKLASH_1 // Shock?
} HitBacklash;
typedef struct ColliderElementDamageInfoAC { typedef struct ColliderElementDamageInfoAC {
/* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC. /* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x04 */ u8 hitBacklash; // The hit backlash type applied to any attacker hurting this AC collider.
/* 0x05 */ u8 defense; // Damage Resistance /* 0x05 */ u8 defense; // Damage Resistance
/* 0x06 */ Vec3s hitPos; // Point of contact /* 0x06 */ Vec3s hitPos; // Point of contact
} ColliderElementDamageInfoAC; // size = 0x0C } ColliderElementDamageInfoAC; // size = 0x0C
@ -465,7 +470,7 @@ typedef struct CollisionCheckInfo {
/* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one /* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one
/* 0x18 */ u8 damage; // Amount to decrement health by /* 0x18 */ u8 damage; // Amount to decrement health by
/* 0x19 */ u8 damageReaction; // Stores what reaction should occur after being hit /* 0x19 */ u8 damageReaction; // Stores what reaction should occur after being hit
/* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC /* 0x1A */ u8 atHitBacklash; // Stores the hit backlash type received from attacking an AC collider
/* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT
} CollisionCheckInfo; // size = 0x1C } CollisionCheckInfo; // size = 0x1C

View file

@ -3661,7 +3661,7 @@ s32 Camera_KeepOn3(Camera* camera) {
} }
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:79 ntsc-1.1:79 ntsc-1.2:79 pal-1.0:79 pal-1.1:79" "ique-cn:128 ntsc-1.0:76 ntsc-1.1:76 ntsc-1.2:76 pal-1.0:76 pal-1.1:76"
s32 Camera_KeepOn4(Camera* camera) { s32 Camera_KeepOn4(Camera* camera) {
static Vec3f sAtTarget; static Vec3f sAtTarget;

View file

@ -194,7 +194,7 @@ s32 Collider_DestroyElementDamageInfoAC(PlayState* play, ColliderElementDamageIn
s32 Collider_SetElementDamageInfoAC(PlayState* play, ColliderElementDamageInfoAC* acDmgInfo, s32 Collider_SetElementDamageInfoAC(PlayState* play, ColliderElementDamageInfoAC* acDmgInfo,
ColliderElementDamageInfoACInit* init) { ColliderElementDamageInfoACInit* init) {
acDmgInfo->dmgFlags = init->dmgFlags; acDmgInfo->dmgFlags = init->dmgFlags;
acDmgInfo->effect = init->effect; acDmgInfo->hitBacklash = init->effect;
acDmgInfo->defense = init->defense; acDmgInfo->defense = init->defense;
return true; return true;
} }
@ -1726,7 +1726,7 @@ s32 CollisionCheck_SetATvsAC(PlayState* play, Collider* atCol, ColliderElement*
atElem->atHitElem = acElem; atElem->atHitElem = acElem;
atElem->atElemFlags |= ATELEM_HIT; atElem->atElemFlags |= ATELEM_HIT;
if (atCol->actor != NULL) { if (atCol->actor != NULL) {
atCol->actor->colChkInfo.atHitEffect = acElem->acDmgInfo.effect; atCol->actor->colChkInfo.atHitBacklash = acElem->acDmgInfo.hitBacklash;
} }
} }
acCol->acFlags |= AC_HIT; acCol->acFlags |= AC_HIT;
@ -3015,7 +3015,7 @@ void CollisionCheck_InitInfo(CollisionCheckInfo* info) {
void CollisionCheck_ResetDamage(CollisionCheckInfo* info) { void CollisionCheck_ResetDamage(CollisionCheckInfo* info) {
info->damage = 0; info->damage = 0;
info->damageReaction = 0; info->damageReaction = 0;
info->atHitEffect = 0; info->atHitBacklash = HIT_BACKLASH_0;
info->acHitEffect = 0; info->acHitEffect = 0;
info->displacement.x = info->displacement.y = info->displacement.z = 0.0f; info->displacement.x = info->displacement.y = info->displacement.z = 0.0f;
} }

View file

@ -1,5 +1,5 @@
#pragma increment_block_number "gc-eu:80 gc-eu-mq:80 gc-jp:80 gc-jp-ce:80 gc-jp-mq:80 gc-us:80 gc-us-mq:80 ique-cn:64" \ #pragma increment_block_number "gc-eu:80 gc-eu-mq:80 gc-jp:80 gc-jp-ce:80 gc-jp-mq:80 gc-us:80 gc-us-mq:80 ique-cn:64" \
"ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96" "ntsc-1.0:80 ntsc-1.1:80 ntsc-1.2:80 pal-1.0:80 pal-1.1:80"
#include "libu64/debug.h" #include "libu64/debug.h"
#include "kaleido_manager.h" #include "kaleido_manager.h"

View file

@ -26,8 +26,8 @@
#include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/parameter_static/parameter_static.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:32" \ #pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:16" \
"ntsc-1.1:32 ntsc-1.2:32 pal-1.0:0 pal-1.1:0" "ntsc-1.1:16 ntsc-1.2:16 pal-1.0:0 pal-1.1:0"
#if !PLATFORM_IQUE #if !PLATFORM_IQUE
#define MSG_BUF_DECODED (msgCtx->msgBufDecoded) #define MSG_BUF_DECODED (msgCtx->msgBufDecoded)

View file

@ -47,8 +47,8 @@
#include "save.h" #include "save.h"
#include "vis.h" #include "vis.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:224" \ #pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
"ntsc-1.0:240 ntsc-1.1:240 ntsc-1.2:240 pal-1.0:240 pal-1.1:240" "ique-cn:224 ntsc-1.0:240 ntsc-1.1:240 ntsc-1.2:240 pal-1.0:240 pal-1.1:240"
TransitionTile gTransitionTile; TransitionTile gTransitionTile;
s32 gTransitionTileState; s32 gTransitionTileState;

View file

@ -27,7 +27,7 @@
#include "assets/objects/object_tw/object_tw.h" #include "assets/objects/object_tw/object_tw.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" "ique-cn:0 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
#define FLAGS \ #define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \

View file

@ -157,7 +157,7 @@ void EnBili_Destroy(Actor* thisx, PlayState* play) {
void EnBili_SetupFloatIdle(EnBili* this) { void EnBili_SetupFloatIdle(EnBili* this) {
this->actor.speed = 0.7f; this->actor.speed = 0.7f;
this->collider.elem.acDmgInfo.effect = 1; // Shock? this->collider.elem.acDmgInfo.hitBacklash = HIT_BACKLASH_1;
this->timer = 32; this->timer = 32;
this->actor.home.pos.y = this->actor.world.pos.y; this->actor.home.pos.y = this->actor.world.pos.y;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
@ -253,7 +253,7 @@ void EnBili_SetupDie(EnBili* this) {
*/ */
void EnBili_SetupStunned(EnBili* this) { void EnBili_SetupStunned(EnBili* this) {
this->timer = 80; this->timer = 80;
this->collider.elem.acDmgInfo.effect = 0; this->collider.elem.acDmgInfo.hitBacklash = HIT_BACKLASH_0;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 80); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 150, COLORFILTER_BUFFLAG_XLU, 80);

View file

@ -272,7 +272,7 @@ void EnVali_SetupStunned(EnVali* this) {
this->timer = 80; this->timer = 80;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80);
this->bodyCollider.elem.acDmgInfo.effect = 0; this->bodyCollider.elem.acDmgInfo.hitBacklash = HIT_BACKLASH_0;
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actor.velocity.y = 1.0f; this->actor.velocity.y = 1.0f;
this->actionFunc = EnVali_Stunned; this->actionFunc = EnVali_Stunned;
@ -462,7 +462,7 @@ void EnVali_Stunned(EnVali* this, PlayState* play) {
} }
if (this->timer == 0) { if (this->timer == 0) {
this->bodyCollider.elem.acDmgInfo.effect = 1; // Shock? this->bodyCollider.elem.acDmgInfo.hitBacklash = HIT_BACKLASH_1;
EnVali_SetupFloatIdle(this); EnVali_SetupFloatIdle(this);
} }
} }

View file

@ -369,7 +369,7 @@ static s32 D_80858AA0;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving // TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug. // data around. It would be easier if we had more options for controlling BSS ordering in debug.
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ #pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
"ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192" "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
static s32 sSavedCurrentMask; static s32 sSavedCurrentMask;
@ -9145,7 +9145,7 @@ s32 func_80842DF4(PlayState* play, Player* this) {
if ((func_80842AC4(play, this) == 0) && (this->heldItemAction != PLAYER_IA_HAMMER)) { if ((func_80842AC4(play, this) == 0) && (this->heldItemAction != PLAYER_IA_HAMMER)) {
func_80842B7C(play, this); func_80842B7C(play, this);
if (this->actor.colChkInfo.atHitEffect == 1) { if (this->actor.colChkInfo.atHitBacklash == HIT_BACKLASH_1) {
this->actor.colChkInfo.damage = 8; this->actor.colChkInfo.damage = 8;
func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK, 0.0f, 0.0f, this->actor.shape.rot.y, func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK, 0.0f, 0.0f, this->actor.shape.rot.y,
20); 20);