Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last actors #1118

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions include/effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ typedef struct DebuffFXData {
/* 0x30 */ f32 unk_30;
/* 0x34 */ s32 alpha;
/* 0x38 */ Color_RGB8 primCol;
/* 0x38 */ Color_RGB8 envCol;
/* 0x3B */ Color_RGB8 envCol;
/* 0x3E */ char unk_3E[2];
} DebuffFXData; // size = 0x40

Expand Down Expand Up @@ -1024,12 +1024,12 @@ typedef struct AuraFXData {
} AuraFXData; // size = 0x70

typedef struct BulbGlowFXData {
/* 0x00 */ s32 unk_00;
/* 0x00 */ s32 type;
/* 0x04 */ Vec3f pos;
/* 0x10 */ s32 unk_10;
/* 0x14 */ s32 unk_14;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s32 unk_1C;
/* 0x10 */ s32 brightness;
/* 0x14 */ s32 timeLeft;
/* 0x18 */ s32 lifetime;
/* 0x1C */ s32 depthQueryID;
/* 0x20 */ s32 unk_20;
} BulbGlowFXData; // size = 0x24

Expand Down
8 changes: 4 additions & 4 deletions include/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ enum TargetFlags {
TARGET_FLAG_200000 = 0x00200000,
TARGET_FLAG_400000 = 0x00400000,
TARGET_FLAG_800000 = 0x00800000,
TARGET_FLAG_80000000 = 0x80000000,
TARGET_FLAG_OVERRIDE = 0x80000000, // skip choosing a target
};

enum ActorPartTargetFlags {
Expand Down Expand Up @@ -3310,7 +3310,7 @@ enum ActorPartFlags {
ACTOR_PART_FLAG_200000 = 0x00200000,
ACTOR_PART_FLAG_400000 = 0x00400000,
ACTOR_PART_FLAG_MULTI_TARGET = 0x00800000, ///< Can be targeted with multi-target attacks (e.g. Star Storm).
ACTOR_PART_FLAG_1000000 = 0x01000000,
ACTOR_PART_FLAG_HAS_PAL_EFFECT = 0x01000000,
ACTOR_PART_FLAG_2000000 = 0x02000000,
ACTOR_PART_FLAG_4000000 = 0x04000000,
ACTOR_PART_FLAG_8000000 = 0x08000000,
Expand Down Expand Up @@ -4061,8 +4061,8 @@ enum BattleMessages {
BTL_MSG_STAR_POWER_FILLED = 0x1C,
BTL_MSG_ATTACK_UP = 0x1D,
BTL_MSG_DEFENCE_UP = 0x1E,
BTL_MSG_1F = 0x1F,
BTL_MSG_20 = 0x20,
BTL_MSG_HEAL_ONE = 0x1F,
BTL_MSG_HEAL_ALL = 0x20,
BTL_MSG_ENEMY_TRANSPARENT = 0x21,
BTL_MSG_ENEMY_CHARGED = 0x22,
BTL_MSG_PARTNER_INJURED = 0x23,
Expand Down
4 changes: 2 additions & 2 deletions include/script_api/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ ApiStatus func_8027D434(Evt* script, s32 isInitialCall);
ApiStatus func_8026F1A0(Evt* script, s32 isInitialCall);
ApiStatus PlayLoopingSoundAtActor(Evt* script, s32 isInitialCall);
ApiStatus StopLoopingSoundAtActor(Evt* script, s32 isInitialCall);
ApiStatus func_8026ED20(Evt* script, s32 isInitialCall);
ApiStatus EnableActorPaletteEffects(Evt* script, s32 isInitialCall);
ApiStatus SetActorPaletteSwapParams(Evt* script, s32 isInitialCall);
ApiStatus BattleCamTargetActorPart(Evt* script, s32 isInitialCall);
ApiStatus func_802537C0(Evt* script, s32 isInitialCall);
ApiStatus GetDarknessStatus(Evt* script, s32 isInitialCall);
ApiStatus CancelEnemyTurn(Evt* script, s32 isInitialCall);
ApiStatus GetAnimatedNodeRotation(Evt* script, s32 isInitialCall);
ApiStatus GetAnimatedNodePosition(Evt* script, s32 isInitialCall);
Expand Down
32 changes: 16 additions & 16 deletions src/17D6A0.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ s32 bActorNames[ACTOR_TYPE_COUNT] = {
[ACTOR_TYPE_TOY_TANK] MSG_EnemyName_GeneralGuy,
[ACTOR_TYPE_LIGHT_BULB] MSG_EnemyName_Bulb,
[ACTOR_TYPE_SIGNAL_GUY] MSG_EnemyName_ShyGuy,
[ACTOR_TYPE_SHY_SQUAD_DUP] MSG_EnemyName_ShySquadDup,
[ACTOR_TYPE_SHY_GUY_DUP] MSG_EnemyName_ShyGuy,
[ACTOR_TYPE_SHY_SQUAD_REDUX] MSG_EnemyName_ShySquadRedux,
[ACTOR_TYPE_SHY_SQUAD_STUB] MSG_EnemyName_ShyGuy,
[ACTOR_TYPE_ANTI_GUY_OMO] MSG_EnemyName_AntiGuy,
[ACTOR_TYPE_ANTI_GUY_KPA] MSG_EnemyName_AntiGuy,
[ACTOR_TYPE_BIG_LANTERN_GHOST] MSG_EnemyName_BigLanternGhost,
Expand Down Expand Up @@ -1506,14 +1506,14 @@ ActorSounds bActorSoundTable[ACTOR_TYPE_COUNT] = {
.hurt = SOUND_ACTOR_HURT,
.delay = { 30, 30 }
},
[ACTOR_TYPE_SHY_SQUAD_DUP] = {
[ACTOR_TYPE_SHY_SQUAD_REDUX] = {
.walk = { SOUND_NONE, SOUND_NONE },
.fly = { SOUND_NONE, SOUND_NONE },
.jump = SOUND_NONE,
.hurt = SOUND_ACTOR_HURT,
.delay = { 30, 30 }
},
[ACTOR_TYPE_SHY_GUY_DUP] = {
[ACTOR_TYPE_SHY_SQUAD_STUB] = {
.walk = { SOUND_ACTOR_STEP_A, SOUND_ACTOR_STEP_A },
.fly = { SOUND_NONE, SOUND_NONE },
.jump = SOUND_NONE,
Expand Down Expand Up @@ -1955,8 +1955,8 @@ s32 bActorTattles[ACTOR_TYPE_COUNT] = {
[ACTOR_TYPE_TOY_TANK] MSG_EnemyTattle_GeneralGuy,
[ACTOR_TYPE_LIGHT_BULB] MSG_NONE,
[ACTOR_TYPE_SIGNAL_GUY] MSG_EnemyTattle_ShyGuy,
[ACTOR_TYPE_SHY_SQUAD_DUP] MSG_NONE,
[ACTOR_TYPE_SHY_GUY_DUP] MSG_EnemyTattle_ShyGuy,
[ACTOR_TYPE_SHY_SQUAD_REDUX] MSG_NONE,
[ACTOR_TYPE_SHY_SQUAD_STUB] MSG_EnemyTattle_ShyGuy,
[ACTOR_TYPE_ANTI_GUY_OMO] MSG_EnemyTattle_AntiGuy,
[ACTOR_TYPE_ANTI_GUY_KPA] MSG_EnemyTattle_AntiGuy,
[ACTOR_TYPE_BIG_LANTERN_GHOST] MSG_EnemyTattle_BigLanternGhost,
Expand Down Expand Up @@ -2170,8 +2170,8 @@ ActorOffsets bActorOffsets[ACTOR_TYPE_COUNT] = {
[ACTOR_TYPE_TOY_TANK] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_LIGHT_BULB] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_SIGNAL_GUY] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_SHY_SQUAD_DUP] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_SHY_GUY_DUP] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_SHY_SQUAD_REDUX] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_SHY_SQUAD_STUB] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_ANTI_GUY_OMO] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_ANTI_GUY_KPA] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
[ACTOR_TYPE_BIG_LANTERN_GHOST] = { .tattleCam = { 0, 0, 0 }, .shadow = 0 },
Expand Down Expand Up @@ -2458,8 +2458,8 @@ s32 bMessages[] = {
[BTL_MSG_STAR_POWER_FILLED] MSG_Menus_StarEnergyFilled,
[BTL_MSG_ATTACK_UP] MSG_Menus_AttackUp,
[BTL_MSG_DEFENCE_UP] MSG_Menus_DefenseUp,
[BTL_MSG_1F] MSG_Menus_0084,
[BTL_MSG_20] MSG_Menus_0085,
[BTL_MSG_HEAL_ONE] MSG_Menus_HealOne,
[BTL_MSG_HEAL_ALL] MSG_Menus_HealAll,

[BTL_MSG_ENEMY_TRANSPARENT] MSG_Menus_EnemyTransparent,
[BTL_MSG_ENEMY_CHARGED] MSG_Menus_EnemyElectricCharge,
Expand Down Expand Up @@ -3140,8 +3140,8 @@ void btl_update_message_popup(void* data) {
case BTL_MSG_STAR_POWER_FILLED:
case BTL_MSG_ATTACK_UP:
case BTL_MSG_DEFENCE_UP:
case BTL_MSG_1F:
case BTL_MSG_20:
case BTL_MSG_HEAL_ONE:
case BTL_MSG_HEAL_ALL:
case BTL_MSG_ENEMY_TRANSPARENT:
case BTL_MSG_ENEMY_CHARGED:
case BTL_MSG_PARTNER_INJURED:
Expand Down Expand Up @@ -3673,8 +3673,8 @@ void func_80250818(void* data, s32 x, s32 y) {
case BTL_MSG_CHARGE_JUMP_MORE:
case BTL_MSG_ATTACK_UP:
case BTL_MSG_DEFENCE_UP:
case BTL_MSG_1F:
case BTL_MSG_20:
case BTL_MSG_HEAL_ONE:
case BTL_MSG_HEAL_ALL:
case BTL_MSG_ENEMY_TRANSPARENT:
case BTL_MSG_ENEMY_CHARGED:
messageID = bMessages[popup->messageIndex];
Expand Down Expand Up @@ -3958,8 +3958,8 @@ void btl_show_message_popup(void* data) {
case BTL_MSG_CHARGE_JUMP_MORE:
case BTL_MSG_ATTACK_UP:
case BTL_MSG_DEFENCE_UP:
case BTL_MSG_1F:
case BTL_MSG_20:
case BTL_MSG_HEAL_ONE:
case BTL_MSG_HEAL_ALL:
case BTL_MSG_ENEMY_TRANSPARENT:
case BTL_MSG_ENEMY_CHARGED:
if (popup->needsInit) {
Expand Down
25 changes: 12 additions & 13 deletions src/181810.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ ApiStatus EnableBattleFloorReflections(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}


ApiStatus SetDarknessMode(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Bytecode* args = script->ptrReadPos;
Expand All @@ -366,25 +365,25 @@ ApiStatus SetDarknessMode(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}

ApiStatus func_802537C0(Evt* script, s32 isInitialCall) {
ApiStatus GetDarknessStatus(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 a0 = *args++;
s32 a1 = *args++;
u8 t1;
f32 t2;
s32 t3;
s32 out1 = *args++;
s32 out2 = *args++;
u8 type;
f32 amt;
s32 isLight;

// While loop may not be necessary in the future
do { get_screen_overlay_params(SCREEN_LAYER_BACK, &t1, &t2); } while (0);
do { get_screen_overlay_params(SCREEN_LAYER_BACK, &type, &amt); } while (0);

if (t2 < 128.0f) {
t3 = 0;
if (amt < 128.0f) {
isLight = FALSE;
} else {
t3 = 1;
isLight = TRUE;
}

evt_set_variable(script, a0, 1);
evt_set_variable(script, a1, t3);
evt_set_variable(script, out1, SCREEN_LAYER_BACK);
evt_set_variable(script, out2, isLight);

return ApiStatus_DONE2;
}
Expand Down
4 changes: 2 additions & 2 deletions src/182B30.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,10 +1056,10 @@ void appendGfx_npc_actor(b32 isPartner, s32 actorIndex) {
}
palChanged = TRUE;
}
if ((!palChanged) && !(part->flags & ACTOR_PART_FLAG_1000000)) {
if (!palChanged && !(part->flags & ACTOR_PART_FLAG_HAS_PAL_EFFECT)) {
set_actor_pal_adjustment(actor, PAL_ADJUST_NONE);
}
if ((!decorChanged) && !(part->flags & ACTOR_PART_FLAG_1000000)) {
if (!decorChanged && !(part->flags & ACTOR_PART_FLAG_HAS_PAL_EFFECT)) {
func_80266EE8(actor, UNK_PAL_EFFECT_0);
}
if (actor->flags & ACTOR_FLAG_4000000) {
Expand Down
4 changes: 2 additions & 2 deletions src/190B20.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void create_target_list(Actor* actor, s32 arg1) {
s32 row;
s32 skip;

if (battleStatus->curTargetListFlags & TARGET_FLAG_80000000) {
if (battleStatus->curTargetListFlags & TARGET_FLAG_OVERRIDE) {
actor->targetListLength = -1;
return;
}
Expand Down Expand Up @@ -247,7 +247,7 @@ void create_target_list(Actor* actor, s32 arg1) {
if (targetData->actorID == ACTOR_PLAYER || targetData->actorID == ACTOR_PARTNER) {
continue;
}
if (battleStatus->curTargetListFlags & TARGET_FLAG_80000000) {
if (battleStatus->curTargetListFlags & TARGET_FLAG_OVERRIDE) {
skip = TRUE;
goto END2;
}
Expand Down
16 changes: 8 additions & 8 deletions src/415D90.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ BSS s32 D_802ACC60;
BSS s32 D_802ACC64;
BSS s32 D_802ACC68;
BSS s32 D_802ACC6C;
BSS s32 D_802ACC70[24];
BSS s32 BattleMenu_TargetHudElems[24];
BSS PopupMenu D_802ACCD0;
BSS s8 BattleMenuState;
BSS s8 D_802AD001;
Expand Down Expand Up @@ -4911,7 +4911,7 @@ void btl_state_update_select_target(void) {
}
}

if (battleStatus->curTargetListFlags & TARGET_FLAG_80000000) {
if (battleStatus->curTargetListFlags & TARGET_FLAG_OVERRIDE) {
if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) {
gBattleSubState = battleStatus->acceptTargetMenuSubstate;
if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
Expand Down Expand Up @@ -4955,7 +4955,7 @@ void btl_state_update_select_target(void) {

for (i = 0; i < targetListLength; i++) {
id = hud_element_create(&HES_HandPointDownLoop);
D_802ACC70[i] = id;
BattleMenu_TargetHudElems[i] = id;
hud_element_set_render_depth(id, 0);
hud_element_set_render_pos(id, 0, -100);
}
Expand Down Expand Up @@ -5009,7 +5009,7 @@ void btl_state_update_select_target(void) {

target = &actor->targetData[targetIndexList[selectedTargetIndex]];
actorFlags = get_actor(target->actorID)->flags;
id = D_802ACC70[0];
id = BattleMenu_TargetHudElems[0];

if (actorFlags & ACTOR_FLAG_UPSIDE_DOWN) {
hud_element_set_script(id, &HES_HandPointLeftLoop);
Expand All @@ -5027,7 +5027,7 @@ void btl_state_update_select_target(void) {
actor->targetActorID = target->actorID;
actor->targetPartIndex = target->partID;
for (i = 0; i < targetListLength; i++) {
hud_element_free(D_802ACC70[i]);
hud_element_free(BattleMenu_TargetHudElems[i]);
}

if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) {
Expand All @@ -5050,7 +5050,7 @@ void btl_state_update_select_target(void) {
break;
case BTL_SUBSTATE_SELECT_TARGET_CANCEL:
for (i = 0; i < targetListLength; i++) {
hud_element_free(D_802ACC70[i]);
hud_element_free(BattleMenu_TargetHudElems[i]);
}
gBattleStatus.flags1 |= BS_FLAGS1_10000 | BS_FLAGS1_MENU_OPEN;
actor->flags |= ACTOR_FLAG_8000000;
Expand Down Expand Up @@ -5122,7 +5122,7 @@ void btl_state_draw_select_target(void) {
if (battleStatus->curTargetListFlags & TARGET_FLAG_ENEMY) {
target = &actor->targetData[targetIndexList[selectedTargetIndex]];
anotherActor = get_actor(target->actorID);
id = D_802ACC70[0];
id = BattleMenu_TargetHudElems[0];
targetX = target->posA.x;
targetY = target->posA.y;
targetZ = target->posA.z;
Expand Down Expand Up @@ -5150,7 +5150,7 @@ void btl_state_draw_select_target(void) {
for (i = 0; i < targetListLength; i++) {
target = &actor->targetData[targetIndexList[i]];
anotherActor = get_actor(target->actorID);
id = D_802ACC70[i];
id = BattleMenu_TargetHudElems[i];
targetX = target->posA.x;
targetY = target->posA.y;
targetZ = target->posA.z;
Expand Down
Loading
Loading