Add gLevelValues.fixCollisionBugsGroundPoundBonks

This commit is contained in:
MysterD 2023-06-22 11:40:59 -07:00
parent 0b43be462f
commit 4479b60b98
6 changed files with 57 additions and 48 deletions

View File

@ -652,6 +652,7 @@
--- @field public extendedPauseDisplay integer
--- @field public fixCollisionBugs integer
--- @field public fixCollisionBugsFalseLedgeGrab integer
--- @field public fixCollisionBugsGroundPoundBonks integer
--- @field public fixCollisionBugsRoundedCorners integer
--- @field public fixVanishFloors integer
--- @field public floatingStarDance integer

View File

@ -958,6 +958,7 @@
| extendedPauseDisplay | `integer` | |
| fixCollisionBugs | `integer` | |
| fixCollisionBugsFalseLedgeGrab | `integer` | |
| fixCollisionBugsGroundPoundBonks | `integer` | |
| fixCollisionBugsRoundedCorners | `integer` | |
| fixVanishFloors | `integer` | |
| floatingStarDance | `integer` | |

View File

@ -45,6 +45,7 @@ struct LevelValues gDefaultLevelValues = {
.fixCollisionBugs = 0,
.fixCollisionBugsRoundedCorners = 1,
.fixCollisionBugsFalseLedgeGrab = 1,
.fixCollisionBugsGroundPoundBonks = 1,
.fixVanishFloors = 0,
.hudCapTimer = 0,
.hudRedCoinsRadar = 0,

View File

@ -43,6 +43,7 @@ struct LevelValues {
u8 fixCollisionBugs;
u8 fixCollisionBugsRoundedCorners;
u8 fixCollisionBugsFalseLedgeGrab;
u8 fixCollisionBugsGroundPoundBonks;
u8 wingCapLookUpReq;
u8 fixVanishFloors;
u8 hudCapTimer;

View File

@ -1009,14 +1009,18 @@ s32 act_ground_pound(struct MarioState *m) {
}
}
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_GROUND_POUND); }
} else if (stepResult == AIR_STEP_HIT_WALL && !gLevelValues.fixCollisionBugs) {
mario_set_forward_vel(m, -16.0f);
if (m->vel[1] > 0.0f) {
m->vel[1] = 0.0f;
}
} else if (stepResult == AIR_STEP_HIT_WALL) {
if (gLevelValues.fixCollisionBugs && gLevelValues.fixCollisionBugsGroundPoundBonks) {
// do nothing
} else {
mario_set_forward_vel(m, -16.0f);
if (m->vel[1] > 0.0f) {
m->vel[1] = 0.0f;
}
set_mario_particle_flags(m, PARTICLE_VERTICAL_STAR, FALSE);
set_mario_action(m, ACT_BACKWARD_AIR_KB, 0);
set_mario_particle_flags(m, PARTICLE_VERTICAL_STAR, FALSE);
set_mario_action(m, ACT_BACKWARD_AIR_KB, 0);
}
}
}

View File

@ -743,48 +743,49 @@ 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 40
#define LUA_LEVEL_VALUES_FIELD_COUNT 41
static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = {
{ "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE },
{ "coinsRequiredForCoinStar", LVT_S16, offsetof(struct LevelValues, coinsRequiredForCoinStar), false, LOT_NONE },
{ "disableActs", LVT_BOOL, offsetof(struct LevelValues, disableActs), false, LOT_NONE },
{ "entryLevel", LVT_S32, offsetof(struct LevelValues, entryLevel), false, LOT_NONE },
{ "exitCastleArea", LVT_S16, offsetof(struct LevelValues, exitCastleArea), false, LOT_NONE },
{ "exitCastleLevel", LVT_S32, offsetof(struct LevelValues, exitCastleLevel), false, LOT_NONE },
{ "exitCastleWarpNode", LVT_U8, offsetof(struct LevelValues, exitCastleWarpNode), false, LOT_NONE },
{ "extendedPauseDisplay", LVT_U8, offsetof(struct LevelValues, extendedPauseDisplay), false, LOT_NONE },
{ "fixCollisionBugs", LVT_U8, offsetof(struct LevelValues, fixCollisionBugs), false, LOT_NONE },
{ "fixCollisionBugsFalseLedgeGrab", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsFalseLedgeGrab), false, LOT_NONE },
{ "fixCollisionBugsRoundedCorners", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsRoundedCorners), false, LOT_NONE },
{ "fixVanishFloors", LVT_U8, offsetof(struct LevelValues, fixVanishFloors), false, LOT_NONE },
{ "floatingStarDance", LVT_U8, offsetof(struct LevelValues, floatingStarDance), false, LOT_NONE },
{ "floorLowerLimit", LVT_S16, offsetof(struct LevelValues, floorLowerLimit), false, LOT_NONE },
{ "floorLowerLimitMisc", LVT_S16, offsetof(struct LevelValues, floorLowerLimitMisc), false, LOT_NONE },
{ "floorLowerLimitShadow", LVT_S16, offsetof(struct LevelValues, floorLowerLimitShadow), false, LOT_NONE },
{ "hudCapTimer", LVT_U8, offsetof(struct LevelValues, hudCapTimer), false, LOT_NONE },
{ "hudRedCoinsRadar", LVT_U8, offsetof(struct LevelValues, hudRedCoinsRadar), false, LOT_NONE },
{ "hudSecretsRadar", LVT_U8, offsetof(struct LevelValues, hudSecretsRadar), false, LOT_NONE },
{ "metalCapDuration", LVT_U16, offsetof(struct LevelValues, metalCapDuration), false, LOT_NONE },
{ "metalCapDurationCotmc", LVT_U16, offsetof(struct LevelValues, metalCapDurationCotmc), false, LOT_NONE },
{ "metalCapSequence", LVT_U8, offsetof(struct LevelValues, metalCapSequence), false, LOT_NONE },
{ "mushroom1UpHeal", LVT_U8, offsetof(struct LevelValues, mushroom1UpHeal), false, LOT_NONE },
{ "pauseExitAnywhere", LVT_BOOL, offsetof(struct LevelValues, pauseExitAnywhere), false, LOT_NONE },
{ "previewBlueCoins", LVT_U8, offsetof(struct LevelValues, previewBlueCoins), false, LOT_NONE },
{ "pssSlideStarIndex", LVT_U8, offsetof(struct LevelValues, pssSlideStarIndex), false, LOT_NONE },
{ "pssSlideStarTime", LVT_U16, offsetof(struct LevelValues, pssSlideStarTime), false, LOT_NONE },
{ "respawnBlueCoinsSwitch", LVT_U8, offsetof(struct LevelValues, respawnBlueCoinsSwitch), false, LOT_NONE },
{ "showStarNumber", LVT_U8, offsetof(struct LevelValues, showStarNumber), false, LOT_NONE },
{ "skipCreditsAt", LVT_S32, offsetof(struct LevelValues, skipCreditsAt), false, LOT_NONE },
{ "starHeal", LVT_U8, offsetof(struct LevelValues, starHeal), false, LOT_NONE },
{ "starPositions", LVT_COBJECT, offsetof(struct LevelValues, starPositions), true, LOT_STARPOSITIONS },
{ "vanishCapDuration", LVT_U16, offsetof(struct LevelValues, vanishCapDuration), false, LOT_NONE },
{ "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 },
{ "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 },
{ "wingCapSequence", LVT_U8, offsetof(struct LevelValues, wingCapSequence), false, LOT_NONE },
{ "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE },
{ "coinsRequiredForCoinStar", LVT_S16, offsetof(struct LevelValues, coinsRequiredForCoinStar), false, LOT_NONE },
{ "disableActs", LVT_BOOL, offsetof(struct LevelValues, disableActs), false, LOT_NONE },
{ "entryLevel", LVT_S32, offsetof(struct LevelValues, entryLevel), false, LOT_NONE },
{ "exitCastleArea", LVT_S16, offsetof(struct LevelValues, exitCastleArea), false, LOT_NONE },
{ "exitCastleLevel", LVT_S32, offsetof(struct LevelValues, exitCastleLevel), false, LOT_NONE },
{ "exitCastleWarpNode", LVT_U8, offsetof(struct LevelValues, exitCastleWarpNode), false, LOT_NONE },
{ "extendedPauseDisplay", LVT_U8, offsetof(struct LevelValues, extendedPauseDisplay), false, LOT_NONE },
{ "fixCollisionBugs", LVT_U8, offsetof(struct LevelValues, fixCollisionBugs), false, LOT_NONE },
{ "fixCollisionBugsFalseLedgeGrab", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsFalseLedgeGrab), false, LOT_NONE },
{ "fixCollisionBugsGroundPoundBonks", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsGroundPoundBonks), false, LOT_NONE },
{ "fixCollisionBugsRoundedCorners", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsRoundedCorners), false, LOT_NONE },
{ "fixVanishFloors", LVT_U8, offsetof(struct LevelValues, fixVanishFloors), false, LOT_NONE },
{ "floatingStarDance", LVT_U8, offsetof(struct LevelValues, floatingStarDance), false, LOT_NONE },
{ "floorLowerLimit", LVT_S16, offsetof(struct LevelValues, floorLowerLimit), false, LOT_NONE },
{ "floorLowerLimitMisc", LVT_S16, offsetof(struct LevelValues, floorLowerLimitMisc), false, LOT_NONE },
{ "floorLowerLimitShadow", LVT_S16, offsetof(struct LevelValues, floorLowerLimitShadow), false, LOT_NONE },
{ "hudCapTimer", LVT_U8, offsetof(struct LevelValues, hudCapTimer), false, LOT_NONE },
{ "hudRedCoinsRadar", LVT_U8, offsetof(struct LevelValues, hudRedCoinsRadar), false, LOT_NONE },
{ "hudSecretsRadar", LVT_U8, offsetof(struct LevelValues, hudSecretsRadar), false, LOT_NONE },
{ "metalCapDuration", LVT_U16, offsetof(struct LevelValues, metalCapDuration), false, LOT_NONE },
{ "metalCapDurationCotmc", LVT_U16, offsetof(struct LevelValues, metalCapDurationCotmc), false, LOT_NONE },
{ "metalCapSequence", LVT_U8, offsetof(struct LevelValues, metalCapSequence), false, LOT_NONE },
{ "mushroom1UpHeal", LVT_U8, offsetof(struct LevelValues, mushroom1UpHeal), false, LOT_NONE },
{ "pauseExitAnywhere", LVT_BOOL, offsetof(struct LevelValues, pauseExitAnywhere), false, LOT_NONE },
{ "previewBlueCoins", LVT_U8, offsetof(struct LevelValues, previewBlueCoins), false, LOT_NONE },
{ "pssSlideStarIndex", LVT_U8, offsetof(struct LevelValues, pssSlideStarIndex), false, LOT_NONE },
{ "pssSlideStarTime", LVT_U16, offsetof(struct LevelValues, pssSlideStarTime), false, LOT_NONE },
{ "respawnBlueCoinsSwitch", LVT_U8, offsetof(struct LevelValues, respawnBlueCoinsSwitch), false, LOT_NONE },
{ "showStarNumber", LVT_U8, offsetof(struct LevelValues, showStarNumber), false, LOT_NONE },
{ "skipCreditsAt", LVT_S32, offsetof(struct LevelValues, skipCreditsAt), false, LOT_NONE },
{ "starHeal", LVT_U8, offsetof(struct LevelValues, starHeal), false, LOT_NONE },
{ "starPositions", LVT_COBJECT, offsetof(struct LevelValues, starPositions), true, LOT_STARPOSITIONS },
{ "vanishCapDuration", LVT_U16, offsetof(struct LevelValues, vanishCapDuration), false, LOT_NONE },
{ "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 },
{ "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 },
{ "wingCapSequence", LVT_U8, offsetof(struct LevelValues, wingCapSequence), false, LOT_NONE },
};
#define LUA_LINEAR_TRANSITION_POINT_FIELD_COUNT 5