Add gLevelValues.bubbleOnDeathBarrierInCapStages (#449)

Also add a few smaller fixes with bubbles
This commit is contained in:
Sunk 2023-07-18 18:01:05 -04:00 committed by GitHub
parent 3242c4e7c8
commit d1aa4aee1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 6 deletions

View file

@ -642,6 +642,7 @@
--- @field public yaw integer
--- @class LevelValues
--- @field public bubbleOnDeathBarrierInCapStages boolean
--- @field public cellHeightLimit integer
--- @field public coinsRequiredForCoinStar integer
--- @field public disableActs boolean

View file

@ -948,6 +948,7 @@
| Field | Type | Access |
| ----- | ---- | ------ |
| bubbleOnDeathBarrierInCapStages | `boolean` | |
| cellHeightLimit | `integer` | |
| coinsRequiredForCoinStar | `integer` | |
| disableActs | `boolean` | |

View file

@ -117,7 +117,8 @@ struct LevelValues gDefaultLevelValues = {
.wingCapLookUpReq = 10,
.maxLives = 100,
.maxCoins = 999,
.numCoinsToLife = 50
.numCoinsToLife = 50,
.bubbleOnDeathBarrierInCapStages = false
};
struct LevelValues gLevelValues = { 0 };

View file

@ -85,6 +85,7 @@ struct LevelValues {
u16 maxLives;
u16 maxCoins;
u16 numCoinsToLife;
bool bubbleOnDeathBarrierInCapStages;
};
extern struct LevelValues gLevelValues;

View file

@ -2372,7 +2372,9 @@ void check_death_barrier(struct MarioState *m) {
case COURSE_TOTWC: // (21) Tower of the Wing Cap
case COURSE_VCUTM: // (22) Vanish Cap Under the Moat
case COURSE_WMOTR: // (23) Winged Mario over the Rainbow
if (!gLevelValues.bubbleOnDeathBarrierInCapStages){
break;
}
default:
mario_set_bubbled(m);
return;

View file

@ -446,8 +446,8 @@ void mario_set_bubbled(struct MarioState* m) {
gLocalBubbleCounter = 20;
set_mario_action(m, ACT_BUBBLED, 0);
if (m->numLives != -1) {
drop_and_set_mario_action(m, ACT_BUBBLED, 0);
if (m->numLives > -1) {
m->numLives--;
}
m->healCounter = 0;

View file

@ -743,8 +743,9 @@ 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 45
#define LUA_LEVEL_VALUES_FIELD_COUNT 46
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 },
{ "coinsRequiredForCoinStar", LVT_S16, offsetof(struct LevelValues, coinsRequiredForCoinStar), false, LOT_NONE },
{ "disableActs", LVT_BOOL, offsetof(struct LevelValues, disableActs), false, LOT_NONE },