Skip to content

Commit

Permalink
battle file names
Browse files Browse the repository at this point in the history
  • Loading branch information
HailSanta authored and HailSanta committed Oct 9, 2023
1 parent 2209585 commit e034751
Show file tree
Hide file tree
Showing 17 changed files with 784 additions and 763 deletions.
8 changes: 8 additions & 0 deletions include/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -4077,6 +4077,14 @@ enum BattleMessages {
BTL_MSG_CANT_SELECT_NOW_ALT = 0x54,
};

enum BattleMessageStates {
BTL_MSG_STATE_0 = 0,
BTL_MSG_STATE_1 = 1,
BTL_MSG_STATE_2 = 2,
BTL_MSG_STATE_3 = 3,
BTL_MSG_STATE_4 = 4,
};

// BattleMenuState
enum BattleMenuStates {
BTL_MENU_STATE_OPENED_SUBMENU = -1,
Expand Down
2 changes: 1 addition & 1 deletion include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ extern s32 D_800F7B44;
extern f32 D_8010C938;
extern f32 D_8010C990;
extern s32 NpcHitQueryColliderID;
extern Vec3s btl_actorHomePositions[];
extern Vec3s StandardActorHomePositions[];

extern SaveData gCurrentSaveFile;

Expand Down
6 changes: 3 additions & 3 deletions src/190B20.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,9 +1741,9 @@ Actor* create_actor(Formation formation) {
s32 i, j, k;

if (formation->home.index >= EVT_LIMIT) {
x = btl_actorHomePositions[formation->home.index].x;
y = btl_actorHomePositions[formation->home.index].y;
z = btl_actorHomePositions[formation->home.index].z;
x = StandardActorHomePositions[formation->home.index].x;
y = StandardActorHomePositions[formation->home.index].y;
z = StandardActorHomePositions[formation->home.index].z;
} else {
x = formation->home.vec->x;
y = formation->home.vec->y;
Expand Down
6 changes: 3 additions & 3 deletions src/actor_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ ApiStatus SetGoalToIndex(Evt* script, s32 isInitialCall) {
}

actor = get_actor(actorID);
actor->state.goalPos.x = btl_actorHomePositions[index].x;
actor->state.goalPos.y = btl_actorHomePositions[index].y;
actor->state.goalPos.z = btl_actorHomePositions[index].z;
actor->state.goalPos.x = StandardActorHomePositions[index].x;
actor->state.goalPos.y = StandardActorHomePositions[index].y;
actor->state.goalPos.z = StandardActorHomePositions[index].z;

return ApiStatus_DONE2;
}
Expand Down
218 changes: 218 additions & 0 deletions src/battle/actors.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
#include "common.h"
#include "battle/battle.h"
#include "sprite/player.h"

extern IMG_BIN ui_battle_menu_spirits_png[];
extern PAL_BIN ui_battle_menu_spirits_pal[];
extern IMG_BIN ui_battle_solid_star_png[];
extern PAL_BIN ui_battle_solid_star_pal[];

PlayerCelebrationAnimOptions bPlayerCelebrations = {
10, 90,
{
50, ANIM_MarioB1_JumpForJoy,
50, ANIM_Mario1_Chuckle,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
50, ANIM_Mario1_DustOff,
50, ANIM_Mario1_DustOff,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
50, ANIM_Mario1_ThumbsUp,
50, ANIM_Mario1_ThumbsUp,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
50, ANIM_MarioB1_FingerWag,
50, ANIM_MarioB1_FingerWag,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
80, ANIM_MarioB1_FingerWag,
20, ANIM_MarioB1_JumpForJoy,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
}
};

#include "battle/actor_types.inc.c"

u32 bMarioIdleAnims[] = {
STATUS_KEY_NORMAL, ANIM_Mario1_Walk,
STATUS_KEY_DANGER, ANIM_Mario1_TiredIdle,
STATUS_KEY_STONE, ANIM_MarioB3_Petrified,
STATUS_KEY_SLEEP, ANIM_MarioB1_Sleep,
STATUS_KEY_DIZZY, ANIM_MarioB1_Sick,
STATUS_KEY_STOP, ANIM_Mario1_Still,
STATUS_KEY_HUSTLE, ANIM_Mario1_Run,
STATUS_KEY_BERSERK, ANIM_MarioB2_BerserkIdle,
STATUS_KEY_PARALYZE, ANIM_MarioB1_Sleep,
STATUS_KEY_FROZEN, ANIM_Mario1_Frozen,
STATUS_KEY_TRANSPARENT, ANIM_Mario1_Idle,
STATUS_KEY_INACTIVE, ANIM_Mario1_Still,
STATUS_KEY_INACTIVE_BERSERK, ANIM_MarioB2_BerserkStill,
STATUS_KEY_14, ANIM_MarioB2_Inert,
STATUS_KEY_INACTIVE_SLEEP, ANIM_MarioB1_SleepStill,
STATUS_KEY_INACTIVE_DIZZY, ANIM_MarioB1_SickStill,
STATUS_KEY_INACTIVE_WEARY, ANIM_Mario1_TiredStill,
STATUS_KEY_THINKING, ANIM_Mario1_Thinking,
STATUS_KEY_WEARY, ANIM_Mario1_SpinLand,
STATUS_END
};

s32 bMarioDefendAnims[] = {
STATUS_KEY_NORMAL, ANIM_Mario1_Crouch,
STATUS_KEY_DANGER, ANIM_Mario1_TiredIdle,
STATUS_KEY_STONE, ANIM_MarioB3_Petrified,
STATUS_KEY_SLEEP, ANIM_MarioB1_Sleep,
STATUS_KEY_DIZZY, ANIM_MarioB1_Sick,
STATUS_KEY_STOP, ANIM_Mario1_Still,
STATUS_KEY_HUSTLE, ANIM_Mario1_Crouch,
STATUS_KEY_BERSERK, ANIM_Mario1_Crouch,
STATUS_KEY_PARALYZE, ANIM_MarioB1_Sleep,
STATUS_KEY_FROZEN, ANIM_Mario1_Frozen,
STATUS_KEY_TRANSPARENT, ANIM_Mario1_Idle,
STATUS_KEY_INACTIVE, ANIM_Mario1_Still,
STATUS_KEY_INACTIVE_BERSERK, ANIM_MarioB2_BerserkStill,
STATUS_KEY_14, ANIM_MarioB2_Inert,
STATUS_KEY_INACTIVE_SLEEP, ANIM_MarioB1_SleepStill,
STATUS_KEY_INACTIVE_DIZZY, ANIM_MarioB1_SickStill,
STATUS_KEY_INACTIVE_WEARY, ANIM_Mario1_TiredStill,
STATUS_KEY_THINKING, ANIM_Mario1_Thinking,
STATUS_KEY_WEARY, ANIM_Mario1_SpinLand,
STATUS_END
};

s32 bMarioHideAnims[] = {
STATUS_KEY_NORMAL, ANIM_Mario1_Crouch,
STATUS_KEY_DANGER, ANIM_Mario1_TiredIdle,
STATUS_KEY_STONE, ANIM_MarioB3_Petrified,
STATUS_KEY_SLEEP, ANIM_MarioB1_Sleep,
STATUS_KEY_DIZZY, ANIM_MarioB1_Sick,
STATUS_KEY_STOP, ANIM_Mario1_Still,
STATUS_KEY_HUSTLE, ANIM_MarioW2_RideLaki,
STATUS_KEY_BERSERK, ANIM_MarioW2_RideLaki,
STATUS_KEY_PARALYZE, ANIM_MarioB1_Sleep,
STATUS_KEY_FROZEN, ANIM_Mario1_Frozen,
STATUS_KEY_TRANSPARENT, ANIM_Mario1_Idle,
STATUS_KEY_INACTIVE, ANIM_Mario1_Crouch,
STATUS_KEY_INACTIVE_BERSERK, ANIM_MarioB2_BerserkStill,
STATUS_KEY_14, ANIM_MarioB2_Inert,
STATUS_KEY_INACTIVE_SLEEP, ANIM_MarioB1_SleepStill,
STATUS_KEY_INACTIVE_DIZZY, ANIM_MarioB1_SickStill,
STATUS_KEY_INACTIVE_WEARY, ANIM_Mario1_TiredStill,
STATUS_KEY_THINKING, ANIM_Mario1_Thinking,
STATUS_KEY_WEARY, ANIM_Mario1_SpinLand,
STATUS_END
};

s32 bPeachIdleAnims[] = {
STATUS_KEY_NORMAL, ANIM_Peach1_Walk,
STATUS_KEY_INACTIVE, ANIM_Peach2_Inert,
STATUS_END
};

s32 bMarioDefenseTable[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END
};

s32 bPlayerStatusTable[] = {
STATUS_KEY_NORMAL, 100,
STATUS_KEY_DEFAULT, 100,
STATUS_KEY_SLEEP, 100,
STATUS_KEY_POISON, 100,
STATUS_KEY_FROZEN, 100,
STATUS_KEY_DIZZY, 100,
STATUS_KEY_FEAR, 100,
STATUS_KEY_STATIC, 100,
STATUS_KEY_PARALYZE, 100,
STATUS_KEY_SHRINK, 100,
STATUS_KEY_STOP, 100,
STATUS_TURN_MOD_DEFAULT, 0,
STATUS_TURN_MOD_SLEEP, 0,
STATUS_TURN_MOD_POISON, 0,
STATUS_TURN_MOD_FROZEN, 0,
STATUS_TURN_MOD_DIZZY, 0,
STATUS_TURN_MOD_FEAR, 0,
STATUS_TURN_MOD_STATIC, 0,
STATUS_TURN_MOD_PARALYZE, 0,
STATUS_TURN_MOD_SHRINK, 0,
STATUS_TURN_MOD_STOP, 0,
STATUS_END
};

ActorBlueprint bPlayerActorBlueprint = {
.type = ACTOR_TYPE_PLAYER,
.maxHP = 99,
.statusTable = bPlayerStatusTable,

.escapeChance = 0,
.airLiftChance = 0,
.hurricaneChance = 0,
.spookChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 4,
.powerBounceChance = 80,

.size = { 33, 43 },
.healthBarOffset = { 0, 0 },
.statusIconOffset = { -10, 30 },
.statusTextOffset = { 10, 30 },
};

ActorPartBlueprint bMarioParts[] = {
{
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 32 },
.opacity = 255,
.idleAnimations = bMarioIdleAnims,
.defenseTable = bMarioDefenseTable,
},
};

Vec3s StandardActorHomePositions[] = {
[BTL_POS_GROUND_A] { 5, 0, -20 },
[BTL_POS_GROUND_B] { 45, 0, -5 },
[BTL_POS_GROUND_C] { 85, 0, 10 },
[BTL_POS_GROUND_D] { 125, 0, 25 },
[BTL_POS_AIR_A] { 10, 50, -20 },
[BTL_POS_AIR_B] { 50, 45, -5 },
[BTL_POS_AIR_C] { 90, 50, 10 },
[BTL_POS_AIR_D] { 130, 55, 25 },
[BTL_POS_HIGH_A] { 15, 85, -20 },
[BTL_POS_HIGH_B] { 55, 80, -5 },
[BTL_POS_HIGH_C] { 95, 85, 10 },
[BTL_POS_HIGH_D] { 135, 90, 25 },
[BTL_POS_TOP_A] { 15, 125, -20 },
[BTL_POS_TOP_B] { 55, 120, -5 },
[BTL_POS_TOP_C] { 95, 125, 10 },
[BTL_POS_TOP_D] { 135, 130, 25 },
[BTL_POS_CENTER] { 105, 0, 0 },
};

// TODO: what is this, and look into warnings that are silenced via casts
s32* D_8028358C[] = {
(s32*)-1, (s32*)-1, (s32*)-1, (s32*)-1, (s32*)-1, (s32*)-1, (s32*)-1, (s32*)-1,
(s32*)D_8028358C, (s32*)D_8028358C, (s32*)D_8028358C, (s32*)D_8028358C, (s32*)D_8028358C, (s32*)D_8028358C,
(s32*)D_8028358C, (s32*)D_8028358C, 0
};
2 changes: 1 addition & 1 deletion src/battle/area/flo2/actor/huff_n_puff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2987,7 +2987,7 @@ EvtScript N(EVS_Attack_TuffPuffSwarm) = {
EVT_CALL(SetupMashMeter, 1, 25, 0, 0, 0, 0)
EVT_WAIT(10)
EVT_CALL(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
EVT_CALL(action_command_stop_leech_start, 0, 0x7FFF, 3)
EVT_CALL(action_command_stop_leech_start, 0, 32767, 3)
EVT_SET(LVarB, LVarA)
EVT_DIV(LVarB, 2)
EVT_WAIT(LVarB)
Expand Down
2 changes: 1 addition & 1 deletion src/battle/area/tik2/actor/blooper_baby.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ EvtScript N(EVS_TakeTurn) = {
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BabyBlooper_Anim08)
EVT_CALL(ShowMessageBox, BTL_MSG_ACTION_TIP_03, 0x00007FFF)
EVT_CALL(ShowMessageBox, BTL_MSG_ACTION_TIP_03, 32767)
EVT_CALL(ShowActionHud, TRUE)
EVT_CALL(LoadActionCommand, ACTION_COMMAND_STOP_LEECH)
EVT_CALL(action_command_stop_leech_init)
Expand Down
102 changes: 102 additions & 0 deletions src/battle/bonk_icons.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#include "common.h"
#include "entity.h"

extern IMG_BIN ui_battle_menu_spirits_png[];
extern PAL_BIN ui_battle_menu_spirits_pal[];
extern IMG_BIN ui_battle_solid_star_png[];
extern PAL_BIN ui_battle_solid_star_pal[];

#include "ui/battle/cursor_hand.png.inc.c"
#include "ui/battle/cursor_hand.pal.inc.c"

Vtx BtlCursorModelVtx[] = {
{{{ -22, -6, 0 }, 0, { 1024, 1024 }, { 0, 0, 0, 255 }}},
{{{ 9, -6, 0 }, 0, { 0, 1024 }, { 0, 0, 0, 255 }}},
{{{ 9, 25, 0 }, 0, { 0, 0 }, { 0, 0, 0, 255 }}},
{{{ -22, 25, 0 }, 0, { 1024, 0 }, { 0, 0, 0, 255 }}},
};

Gfx BtlCursorModelGfx[] = {
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, ui_battle_cursor_hand_pal),
gsDPLoadTextureTile_4b(ui_battle_cursor_hand_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(BtlCursorModelVtx, 4, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsSPEndDisplayList(),
};

EntityModelScript EMS_CursorIcon = STANDARD_ENTITY_MODEL_SCRIPT(BtlCursorModelGfx, RENDER_MODE_ALPHATEST);

Vtx BtlBonkModelVtx[] = {
{{{ -16, -16, 0 }, 0, { 0, 0 }, { 0, 0, 0, 255 }}},
{{{ 15, -16, 0 }, 0, { 1024, 0 }, { 0, 0, 0, 255 }}},
{{{ 15, 15, 0 }, 0, { 1024, 1024 }, { 0, 0, 0, 255 }}},
{{{ -16, 15, 0 }, 0, { 0, 1024 }, { 0, 0, 0, 255 }}},
};

Gfx BtlBonkModelGfx[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(PM_CC_01, PM_CC_02),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, ui_battle_menu_spirits_pal),
gsDPLoadTextureTile_4b(ui_battle_menu_spirits_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(BtlBonkModelVtx, 4, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};

EntityModelScript EMS_BonkIcon = STANDARD_ENTITY_MODEL_SCRIPT(BtlBonkModelGfx, RENDER_MODE_2D);

Vtx BtlStarModelVtx[] = {
{{{ -16, -16, 0 }, 0, { 0, 1024 }, { 0, 0, 0, 255 }}},
{{{ 15, -16, 0 }, 0, { 1024, 1024 }, { 0, 0, 0, 255 }}},
{{{ 15, 15, 0 }, 0, { 1024, 0 }, { 0, 0, 0, 255 }}},
{{{ -16, 15, 0 }, 0, { 0, 0 }, { 0, 0, 0, 255 }}},
};

Gfx BtlStarModelGfx[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_AVERAGE),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPLoadTLUT_pal16(0, ui_battle_solid_star_pal),
gsDPLoadTextureTile_4b(ui_battle_solid_star_png, G_IM_FMT_CI, 32, 0, 0, 0, 31, 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_LIGHTING),
gsSPClearGeometryMode(G_SHADING_SMOOTH),
gsSPVertex(BtlStarModelVtx, 4, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};

EntityModelScript EMS_StarIcon = STANDARD_ENTITY_MODEL_SCRIPT(BtlStarModelGfx, RENDER_MODE_ALPHATEST);
File renamed without changes.
2 changes: 1 addition & 1 deletion src/battle/common/actor/jungle_fuzzy.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ EvtScript N(EVS_Attack_Leech) = {
EVT_WAIT(30)
EVT_END_LOOP
EVT_ELSE
EVT_CALL(ShowMessageBox, BTL_MSG_ACTION_TIP_03, 0x00007FFF)
EVT_CALL(ShowMessageBox, BTL_MSG_ACTION_TIP_03, 32767)
EVT_CALL(ShowActionHud, TRUE)
EVT_CALL(LoadActionCommand, ACTION_COMMAND_STOP_LEECH)
EVT_CALL(action_command_stop_leech_init)
Expand Down
Loading

0 comments on commit e034751

Please sign in to comment.