Unhardcoded more bowling ball values

This commit is contained in:
MysterD 2022-06-02 19:45:01 -07:00
parent 091437c430
commit e40fe57860
6 changed files with 84 additions and 66 deletions

View file

@ -139,6 +139,8 @@
--- @class BehaviorTrajectories
--- @field public BowlingBallBob2Trajectory Pointer_Trajectory
--- @field public BowlingBallBobTrajectory Pointer_Trajectory
--- @field public BowlingBallThiLargeTrajectory Pointer_Trajectory
--- @field public BowlingBallThiSmallTrajectory Pointer_Trajectory
--- @field public BowlingBallTtmTrajectory Pointer_Trajectory
--- @field public KoopaBobTrajectory Pointer_Trajectory
--- @field public KoopaThiTrajectory Pointer_Trajectory

View file

@ -251,6 +251,8 @@
| ----- | ---- | ------ |
| BowlingBallBob2Trajectory | `Pointer` <`Trajectory`> | |
| BowlingBallBobTrajectory | `Pointer` <`Trajectory`> | |
| BowlingBallThiLargeTrajectory | `Pointer` <`Trajectory`> | |
| BowlingBallThiSmallTrajectory | `Pointer` <`Trajectory`> | |
| BowlingBallTtmTrajectory | `Pointer` <`Trajectory`> | |
| KoopaBobTrajectory | `Pointer` <`Trajectory`> | |
| KoopaThiTrajectory | `Pointer` <`Trajectory`> | |

View file

@ -12,7 +12,7 @@ static struct ObjectHitbox sBowlingBallHitbox = {
/* hurtboxHeight: */ 0,
};
static Trajectory sThiHugeMetalBallTraj[] = {
Trajectory sThiHugeMetalBallTraj[] = {
TRAJECTORY_POS(0, /*pos*/ -4786, 101, -2166),
TRAJECTORY_POS(1, /*pos*/ -5000, 81, -2753),
TRAJECTORY_POS(2, /*pos*/ -5040, 33, -3846),
@ -26,7 +26,7 @@ static Trajectory sThiHugeMetalBallTraj[] = {
TRAJECTORY_END(),
};
static Trajectory sThiTinyMetalBallTraj[] = {
Trajectory sThiTinyMetalBallTraj[] = {
TRAJECTORY_POS(0, /*pos*/ -1476, 29, -680),
TRAJECTORY_POS(1, /*pos*/ -1492, 14, -1072),
TRAJECTORY_POS(2, /*pos*/ -1500, 3, -1331),
@ -67,11 +67,11 @@ void bowling_ball_set_waypoints(void) {
break;
case BBALL_BP_STYPE_THI_LARGE:
o->oPathedStartWaypoint = (struct Waypoint *) sThiHugeMetalBallTraj;
o->oPathedStartWaypoint = segmented_to_virtual(gBehaviorValues.trajectories.BowlingBallThiLargeTrajectory);
break;
case BBALL_BP_STYPE_THI_SMALL:
o->oPathedStartWaypoint = (struct Waypoint *) sThiTinyMetalBallTraj;
o->oPathedStartWaypoint = segmented_to_virtual(gBehaviorValues.trajectories.BowlingBallThiSmallTrajectory);
break;
}
}
@ -117,23 +117,23 @@ void bhv_bowling_ball_initializeLoop(void) {
switch (o->oBehParams2ndByte) {
case BBALL_BP_STYPE_BOB_UPPER:
o->oForwardVel = 20.0f;
o->oForwardVel = gBehaviorValues.BowlingBallBobSpeed;
break;
case BBALL_BP_STYPE_TTM:
o->oForwardVel = 10.0f;
o->oForwardVel = gBehaviorValues.BowlingBallTtmSpeed;
break;
case BBALL_BP_STYPE_BOB_LOWER:
o->oForwardVel = 20.0f;
o->oForwardVel = gBehaviorValues.BowlingBallBob2Speed;
break;
case BBALL_BP_STYPE_THI_LARGE:
o->oForwardVel = 25.0f;
o->oForwardVel = gBehaviorValues.BowlingBallThiLargeSpeed;
break;
case BBALL_BP_STYPE_THI_SMALL:
o->oForwardVel = 10.0f;
o->oForwardVel = gBehaviorValues.BowlingBallThiSmallSpeed;
cur_obj_scale(0.3f);
o->oGraphYOffset = 39.0f;
break;

View file

@ -33,6 +33,9 @@
#include "levels/wf/header.h"
#include "levels/wmotr/header.h"
extern Trajectory sThiHugeMetalBallTraj[];
extern Trajectory sThiTinyMetalBallTraj[];
////////////
// Levels //
////////////
@ -109,6 +112,11 @@ struct BehaviorValues gDefaultBehaviorValues = {
.KingWhompHealth = 3,
.MipsStar1Requirement = 15,
.MipsStar2Requirement = 50,
.BowlingBallBobSpeed = 20.0f,
.BowlingBallBob2Speed = 10.0f,
.BowlingBallTtmSpeed = 20.0f,
.BowlingBallThiLargeSpeed = 25.0f,
.BowlingBallThiSmallSpeed = 10.0f,
.ShowStarMilestones = TRUE,
.starsNeededForDialog = { 1, 3, 8, 30, 50, 70 },
.dialogs = {
@ -198,34 +206,36 @@ struct BehaviorValues gDefaultBehaviorValues = {
.YoshiDialog = DIALOG_161,
},
.trajectories = {
.KoopaBobTrajectory = (Trajectory*) bob_seg7_trajectory_koopa,
.KoopaThiTrajectory = (Trajectory*) thi_seg7_trajectory_koopa,
.UnagiTrajectory = (Trajectory*) jrb_seg7_trajectory_unagi_1,
.Unagi2Trajectory = (Trajectory*) jrb_seg7_trajectory_unagi_2,
.SnowmanHeadTrajectory = (Trajectory*) ccm_seg7_trajectory_snowman,
.RacingPenguinTrajectory = (Trajectory*) ccm_seg7_trajectory_penguin_race,
.BowlingBallBobTrajectory = (Trajectory*) bob_seg7_metal_ball_path0,
.BowlingBallBob2Trajectory = (Trajectory*) bob_seg7_metal_ball_path1,
.BowlingBallTtmTrajectory = (Trajectory*) ttm_seg7_trajectory_070170A0,
.MipsTrajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_0,
.Mips2Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_1,
.Mips3Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_2,
.Mips4Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_3,
.Mips5Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_4,
.Mips6Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_5,
.Mips7Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_6,
.Mips8Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_7,
.Mips9Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_8,
.Mips10Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_9,
.PlatformRrTrajectory = (Trajectory*) rr_seg7_trajectory_0702EC3C,
.PlatformRr2Trajectory = (Trajectory*) rr_seg7_trajectory_0702ECC0,
.PlatformRr3Trajectory = (Trajectory*) rr_seg7_trajectory_0702ED9C,
.PlatformRr4Trajectory = (Trajectory*) rr_seg7_trajectory_0702EEE0,
.PlatformCcmTrajectory = (Trajectory*) ccm_seg7_trajectory_0701669C,
.PlatformBitfsTrajectory = (Trajectory*) bitfs_seg7_trajectory_070159AC,
.PlatformHmcTrajectory = (Trajectory*) hmc_seg7_trajectory_0702B86C,
.PlatformLllTrajectory = (Trajectory*) lll_seg7_trajectory_0702856C,
.PlatformLll2Trajectory = (Trajectory*) lll_seg7_trajectory_07028660,
.KoopaBobTrajectory = (Trajectory*) bob_seg7_trajectory_koopa,
.KoopaThiTrajectory = (Trajectory*) thi_seg7_trajectory_koopa,
.UnagiTrajectory = (Trajectory*) jrb_seg7_trajectory_unagi_1,
.Unagi2Trajectory = (Trajectory*) jrb_seg7_trajectory_unagi_2,
.SnowmanHeadTrajectory = (Trajectory*) ccm_seg7_trajectory_snowman,
.RacingPenguinTrajectory = (Trajectory*) ccm_seg7_trajectory_penguin_race,
.BowlingBallBobTrajectory = (Trajectory*) bob_seg7_metal_ball_path0,
.BowlingBallBob2Trajectory = (Trajectory*) bob_seg7_metal_ball_path1,
.BowlingBallTtmTrajectory = (Trajectory*) ttm_seg7_trajectory_070170A0,
.BowlingBallThiLargeTrajectory = (Trajectory*) sThiHugeMetalBallTraj,
.BowlingBallThiSmallTrajectory = (Trajectory*) sThiTinyMetalBallTraj,
.MipsTrajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_0,
.Mips2Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_1,
.Mips3Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_2,
.Mips4Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_3,
.Mips5Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_4,
.Mips6Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_5,
.Mips7Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_6,
.Mips8Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_7,
.Mips9Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_8,
.Mips10Trajectory = (Trajectory*) inside_castle_seg7_trajectory_mips_9,
.PlatformRrTrajectory = (Trajectory*) rr_seg7_trajectory_0702EC3C,
.PlatformRr2Trajectory = (Trajectory*) rr_seg7_trajectory_0702ECC0,
.PlatformRr3Trajectory = (Trajectory*) rr_seg7_trajectory_0702ED9C,
.PlatformRr4Trajectory = (Trajectory*) rr_seg7_trajectory_0702EEE0,
.PlatformCcmTrajectory = (Trajectory*) ccm_seg7_trajectory_0701669C,
.PlatformBitfsTrajectory = (Trajectory*) bitfs_seg7_trajectory_070159AC,
.PlatformHmcTrajectory = (Trajectory*) hmc_seg7_trajectory_0702B86C,
.PlatformLllTrajectory = (Trajectory*) lll_seg7_trajectory_0702856C,
.PlatformLll2Trajectory = (Trajectory*) lll_seg7_trajectory_07028660,
},
};

View file

@ -70,6 +70,8 @@ struct BehaviorTrajectories {
Trajectory* BowlingBallBobTrajectory;
Trajectory* BowlingBallBob2Trajectory;
Trajectory* BowlingBallTtmTrajectory;
Trajectory* BowlingBallThiLargeTrajectory;
Trajectory* BowlingBallThiSmallTrajectory;
Trajectory* MipsTrajectory;
Trajectory* Mips2Trajectory;
Trajectory* Mips3Trajectory;

View file

@ -173,36 +173,38 @@ static struct LuaObjectField sBehaviorDialogsFields[LUA_BEHAVIOR_DIALOGS_FIELD_C
{ "YoshiDialog", LVT_S32, offsetof(struct BehaviorDialogs, YoshiDialog), false, LOT_NONE },
};
#define LUA_BEHAVIOR_TRAJECTORIES_FIELD_COUNT 28
#define LUA_BEHAVIOR_TRAJECTORIES_FIELD_COUNT 30
static struct LuaObjectField sBehaviorTrajectoriesFields[LUA_BEHAVIOR_TRAJECTORIES_FIELD_COUNT] = {
{ "BowlingBallBob2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallBob2Trajectory), false, LOT_POINTER },
{ "BowlingBallBobTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallBobTrajectory), false, LOT_POINTER },
{ "BowlingBallTtmTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallTtmTrajectory), false, LOT_POINTER },
{ "KoopaBobTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, KoopaBobTrajectory), false, LOT_POINTER },
{ "KoopaThiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, KoopaThiTrajectory), false, LOT_POINTER },
{ "Mips10Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips10Trajectory), false, LOT_POINTER },
{ "Mips2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips2Trajectory), false, LOT_POINTER },
{ "Mips3Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips3Trajectory), false, LOT_POINTER },
{ "Mips4Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips4Trajectory), false, LOT_POINTER },
{ "Mips5Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips5Trajectory), false, LOT_POINTER },
{ "Mips6Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips6Trajectory), false, LOT_POINTER },
{ "Mips7Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips7Trajectory), false, LOT_POINTER },
{ "Mips8Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips8Trajectory), false, LOT_POINTER },
{ "Mips9Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips9Trajectory), false, LOT_POINTER },
{ "MipsTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, MipsTrajectory), false, LOT_POINTER },
{ "PlatformBitfsTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformBitfsTrajectory), false, LOT_POINTER },
{ "PlatformCcmTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformCcmTrajectory), false, LOT_POINTER },
{ "PlatformHmcTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformHmcTrajectory), false, LOT_POINTER },
{ "PlatformLll2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformLll2Trajectory), false, LOT_POINTER },
{ "PlatformLllTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformLllTrajectory), false, LOT_POINTER },
{ "PlatformRr2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRr2Trajectory), false, LOT_POINTER },
{ "PlatformRr3Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRr3Trajectory), false, LOT_POINTER },
{ "PlatformRr4Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRr4Trajectory), false, LOT_POINTER },
{ "PlatformRrTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRrTrajectory), false, LOT_POINTER },
{ "RacingPenguinTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, RacingPenguinTrajectory), false, LOT_POINTER },
{ "SnowmanHeadTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, SnowmanHeadTrajectory), false, LOT_POINTER },
{ "Unagi2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Unagi2Trajectory), false, LOT_POINTER },
{ "UnagiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, UnagiTrajectory), false, LOT_POINTER },
{ "BowlingBallBob2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallBob2Trajectory), false, LOT_POINTER },
{ "BowlingBallBobTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallBobTrajectory), false, LOT_POINTER },
{ "BowlingBallThiLargeTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallThiLargeTrajectory), false, LOT_POINTER },
{ "BowlingBallThiSmallTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallThiSmallTrajectory), false, LOT_POINTER },
{ "BowlingBallTtmTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, BowlingBallTtmTrajectory), false, LOT_POINTER },
{ "KoopaBobTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, KoopaBobTrajectory), false, LOT_POINTER },
{ "KoopaThiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, KoopaThiTrajectory), false, LOT_POINTER },
{ "Mips10Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips10Trajectory), false, LOT_POINTER },
{ "Mips2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips2Trajectory), false, LOT_POINTER },
{ "Mips3Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips3Trajectory), false, LOT_POINTER },
{ "Mips4Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips4Trajectory), false, LOT_POINTER },
{ "Mips5Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips5Trajectory), false, LOT_POINTER },
{ "Mips6Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips6Trajectory), false, LOT_POINTER },
{ "Mips7Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips7Trajectory), false, LOT_POINTER },
{ "Mips8Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips8Trajectory), false, LOT_POINTER },
{ "Mips9Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Mips9Trajectory), false, LOT_POINTER },
{ "MipsTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, MipsTrajectory), false, LOT_POINTER },
{ "PlatformBitfsTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformBitfsTrajectory), false, LOT_POINTER },
{ "PlatformCcmTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformCcmTrajectory), false, LOT_POINTER },
{ "PlatformHmcTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformHmcTrajectory), false, LOT_POINTER },
{ "PlatformLll2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformLll2Trajectory), false, LOT_POINTER },
{ "PlatformLllTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformLllTrajectory), false, LOT_POINTER },
{ "PlatformRr2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRr2Trajectory), false, LOT_POINTER },
{ "PlatformRr3Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRr3Trajectory), false, LOT_POINTER },
{ "PlatformRr4Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRr4Trajectory), false, LOT_POINTER },
{ "PlatformRrTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, PlatformRrTrajectory), false, LOT_POINTER },
{ "RacingPenguinTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, RacingPenguinTrajectory), false, LOT_POINTER },
{ "SnowmanHeadTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, SnowmanHeadTrajectory), false, LOT_POINTER },
{ "Unagi2Trajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, Unagi2Trajectory), false, LOT_POINTER },
{ "UnagiTrajectory", LVT_TRAJECTORY_P, offsetof(struct BehaviorTrajectories, UnagiTrajectory), false, LOT_POINTER },
};
#define LUA_BEHAVIOR_VALUES_FIELD_COUNT 20