mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-24 16:01:26 +00:00
Generic actor params getters (#1359)
* Initial PARAMS_GET macros * NOSHIFT macro * Use number of bits rather than raw mask values * Add descriptions for each generic macro * Reformat * Adjust comment * format * edit en_door macro names * edit redead macro name * edit bdan switch macro name, and remove unneeded comments in go2 * mizushutter macro names * remove PARAMS_GET_S, rework ishi switch flag handling * actually remove PARAMS_GET_S * remove PARAMS_GET2_S * PARAMS_GET_U and PARAMS_GET_S * format * fix merge * format --------- Co-authored-by: fig02 <fig02srl@gmail.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
137e0d2a10
commit
eaf955ad22
200 changed files with 1113 additions and 1045 deletions
|
@ -53,21 +53,21 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) {
|
|||
if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) &&
|
||||
Flags_GetSwitch(play, this->actor.world.rot.y - 1)) {
|
||||
LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction"
|
||||
if (((this->actor.params >> 8) & 0x3F) != 0x3F) {
|
||||
Flags_SetSwitch(play, ((this->actor.params >> 8) & 0x3F));
|
||||
if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) {
|
||||
Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6));
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
return 1;
|
||||
} else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) {
|
||||
LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2"
|
||||
if (((this->actor.params >> 8) & 0x3F) != 0x3F) {
|
||||
Flags_SetSwitch(play, ((this->actor.params >> 8) & 0x3F));
|
||||
if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) {
|
||||
Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6));
|
||||
}
|
||||
Actor_Kill(&this->actor);
|
||||
return 1;
|
||||
} else if (((this->actor.params >> 8) & 0x3F) == 0x3F) {
|
||||
} else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) {
|
||||
return 0;
|
||||
} else if (Flags_GetSwitch(play, ((this->actor.params >> 8) & 0x3F))) {
|
||||
} else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) {
|
||||
LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction"
|
||||
Actor_Kill(&this->actor);
|
||||
return 1;
|
||||
|
@ -99,7 +99,7 @@ void ElfMsg2_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 ElfMsg2_GetMessageId(ElfMsg2* this) {
|
||||
return (this->actor.params & 0xFF) + 0x100;
|
||||
return PARAMS_GET_U(this->actor.params, 0, 8) + 0x100;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, PlayState* play) {
|
|||
if (Actor_TextboxIsClosing(&this->actor, play)) {
|
||||
if (this->actor.world.rot.z != 1) {
|
||||
Actor_Kill(&this->actor);
|
||||
switchFlag = (this->actor.params >> 8) & 0x3F;
|
||||
switchFlag = PARAMS_GET_U(this->actor.params, 8, 6);
|
||||
if (switchFlag != 0x3F) {
|
||||
Flags_SetSwitch(play, switchFlag);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue