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 vanishCapDurationVcutm integer
--- @field public vanishCapSequence integer --- @field public vanishCapSequence integer
--- @field public visibleSecrets integer --- @field public visibleSecrets integer
--- @field public wdwWaterLevelSpeed number
--- @field public wingCapDuration integer --- @field public wingCapDuration integer
--- @field public wingCapDurationTotwc integer --- @field public wingCapDurationTotwc integer
--- @field public wingCapLookUpReq integer --- @field public wingCapLookUpReq integer

View file

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

View file

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

View file

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

View file

@ -86,6 +86,7 @@ struct LevelValues {
u16 maxCoins; u16 maxCoins;
u16 numCoinsToLife; u16 numCoinsToLife;
bool bubbleOnDeathBarrierInCapStages; bool bubbleOnDeathBarrierInCapStages;
f32 wdwWaterLevelSpeed;
}; };
extern struct LevelValues gLevelValues; 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 }, { "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] = { static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = {
{ "bubbleOnDeathBarrierInCapStages", LVT_BOOL, offsetof(struct LevelValues, bubbleOnDeathBarrierInCapStages), false, LOT_NONE }, { "bubbleOnDeathBarrierInCapStages", LVT_BOOL, offsetof(struct LevelValues, bubbleOnDeathBarrierInCapStages), false, LOT_NONE },
{ "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), 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 }, { "vanishCapDurationVcutm", LVT_U16, offsetof(struct LevelValues, vanishCapDurationVcutm), false, LOT_NONE },
{ "vanishCapSequence", LVT_U8, offsetof(struct LevelValues, vanishCapSequence), false, LOT_NONE }, { "vanishCapSequence", LVT_U8, offsetof(struct LevelValues, vanishCapSequence), false, LOT_NONE },
{ "visibleSecrets", LVT_U8, offsetof(struct LevelValues, visibleSecrets), 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 }, { "wingCapDuration", LVT_U16, offsetof(struct LevelValues, wingCapDuration), false, LOT_NONE },
{ "wingCapDurationTotwc", LVT_U16, offsetof(struct LevelValues, wingCapDurationTotwc), false, LOT_NONE }, { "wingCapDurationTotwc", LVT_U16, offsetof(struct LevelValues, wingCapDurationTotwc), false, LOT_NONE },
{ "wingCapLookUpReq", LVT_U8, offsetof(struct LevelValues, wingCapLookUpReq), false, LOT_NONE }, { "wingCapLookUpReq", LVT_U8, offsetof(struct LevelValues, wingCapLookUpReq), false, LOT_NONE },