Add gLevelValues.wdwWaterLevelSpeed (#469)

Some romhacks do change the speed of the wdw water level.
I am aware that the water level is an object and should be under gBehaviorValues, but that feels wrong so it's under gLevelValues.
This commit is contained in:
Sunk 2023-09-11 12:42:15 -04:00 committed by GitHub
parent 780ffb8cba
commit 284e02dcb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 3 deletions

View file

@ -687,6 +687,7 @@
--- @field public vanishCapDurationVcutm integer
--- @field public vanishCapSequence integer
--- @field public visibleSecrets integer
--- @field public wdwWaterLevelSpeed number
--- @field public wingCapDuration integer
--- @field public wingCapDurationTotwc integer
--- @field public wingCapLookUpReq integer

View file

@ -1005,6 +1005,7 @@
| vanishCapDurationVcutm | `integer` | |
| vanishCapSequence | `integer` | |
| visibleSecrets | `integer` | |
| wdwWaterLevelSpeed | `number` | |
| wingCapDuration | `integer` | |
| wingCapDurationTotwc | `integer` | |
| wingCapLookUpReq | `integer` | |

View file

@ -72,7 +72,7 @@ void bhv_water_level_diamond_loop(void) {
case WATER_LEVEL_DIAMOND_ACT_CHANGE_WATER_LEVEL:
o->oAngleVelYaw = 0;
*gEnvironmentLevels = (s32) approach_f32_symmetric(
(f32) *gEnvironmentLevels, (f32) o->oWaterLevelTriggerTargetWaterLevel, 10.0f);
(f32) *gEnvironmentLevels, (f32) o->oWaterLevelTriggerTargetWaterLevel, gLevelValues.wdwWaterLevelSpeed);
if (*gEnvironmentLevels == o->oWaterLevelTriggerTargetWaterLevel) {
if ((s16) o->oFaceAngleYaw == 0)
o->oAction++; // Sets to WATER_LEVEL_DIAMOND_ACT_IDLE_SPINNING

View file

@ -118,7 +118,8 @@ struct LevelValues gDefaultLevelValues = {
.maxLives = 100,
.maxCoins = 999,
.numCoinsToLife = 50,
.bubbleOnDeathBarrierInCapStages = false
.bubbleOnDeathBarrierInCapStages = false,
.wdwWaterLevelSpeed = 10.0f,
};
struct LevelValues gLevelValues = { 0 };

View file

@ -86,6 +86,7 @@ struct LevelValues {
u16 maxCoins;
u16 numCoinsToLife;
bool bubbleOnDeathBarrierInCapStages;
f32 wdwWaterLevelSpeed;
};
extern struct LevelValues gLevelValues;

View file

@ -743,7 +743,7 @@ static struct LuaObjectField sLakituStateFields[LUA_LAKITU_STATE_FIELD_COUNT] =
{ "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE },
};
#define LUA_LEVEL_VALUES_FIELD_COUNT 46
#define LUA_LEVEL_VALUES_FIELD_COUNT 47
static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = {
{ "bubbleOnDeathBarrierInCapStages", LVT_BOOL, offsetof(struct LevelValues, bubbleOnDeathBarrierInCapStages), false, LOT_NONE },
{ "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE },
@ -787,6 +787,7 @@ static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] =
{ "vanishCapDurationVcutm", LVT_U16, offsetof(struct LevelValues, vanishCapDurationVcutm), false, LOT_NONE },
{ "vanishCapSequence", LVT_U8, offsetof(struct LevelValues, vanishCapSequence), false, LOT_NONE },
{ "visibleSecrets", LVT_U8, offsetof(struct LevelValues, visibleSecrets), false, LOT_NONE },
{ "wdwWaterLevelSpeed", LVT_F32, offsetof(struct LevelValues, wdwWaterLevelSpeed), false, LOT_NONE },
{ "wingCapDuration", LVT_U16, offsetof(struct LevelValues, wingCapDuration), false, LOT_NONE },
{ "wingCapDurationTotwc", LVT_U16, offsetof(struct LevelValues, wingCapDurationTotwc), false, LOT_NONE },
{ "wingCapLookUpReq", LVT_U8, offsetof(struct LevelValues, wingCapLookUpReq), false, LOT_NONE },