allow setting poison gas level
also commented out some find_water_level calls
This commit is contained in:
@@ -1321,7 +1321,7 @@ void update_mario_joystick_inputs(struct MarioState *m) {
|
|||||||
* Resolves wall collisions, and updates a variety of inputs.
|
* Resolves wall collisions, and updates a variety of inputs.
|
||||||
*/
|
*/
|
||||||
void update_mario_geometry_inputs(struct MarioState *m) {
|
void update_mario_geometry_inputs(struct MarioState *m) {
|
||||||
f32 gasLevel;
|
//f32 gasLevel;
|
||||||
f32 ceilToFloorDist;
|
f32 ceilToFloorDist;
|
||||||
|
|
||||||
f32_find_wall_collision(&m->pos[0], &m->pos[1], &m->pos[2], 60.0f, 50.0f);
|
f32_find_wall_collision(&m->pos[0], &m->pos[1], &m->pos[2], 60.0f, 50.0f);
|
||||||
@@ -1343,8 +1343,8 @@ void update_mario_geometry_inputs(struct MarioState *m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m->ceilHeight = vec3f_find_ceil(&m->pos[0], m->floorHeight, &m->ceil);
|
m->ceilHeight = vec3f_find_ceil(&m->pos[0], m->floorHeight, &m->ceil);
|
||||||
gasLevel = find_poison_gas_level(m->pos[0], m->pos[2]);
|
//gasLevel = find_poison_gas_level(m->pos[0], m->pos[2]);
|
||||||
m->waterLevel = find_water_level(m->pos[0], m->pos[2]);
|
//m->waterLevel = find_water_level(m->pos[0], m->pos[2]);
|
||||||
|
|
||||||
if (m->floor != NULL) {
|
if (m->floor != NULL) {
|
||||||
m->floorAngle = atan2s(m->floor->normal.z, m->floor->normal.x);
|
m->floorAngle = atan2s(m->floor->normal.z, m->floor->normal.x);
|
||||||
@@ -1371,7 +1371,7 @@ void update_mario_geometry_inputs(struct MarioState *m) {
|
|||||||
m->input |= INPUT_IN_WATER;
|
m->input |= INPUT_IN_WATER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->pos[1] < (gasLevel - 100.0f)) {
|
if (m->pos[1] < (m->gasLevel - 100.0f)) {
|
||||||
m->input |= INPUT_IN_POISON_GAS;
|
m->input |= INPUT_IN_POISON_GAS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1831,6 +1831,8 @@ int init_mario(void) {
|
|||||||
|
|
||||||
gMarioState->waterLevel =
|
gMarioState->waterLevel =
|
||||||
find_water_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]);
|
find_water_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]);
|
||||||
|
gMarioState->gasLevel =
|
||||||
|
find_poison_gas_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]);
|
||||||
|
|
||||||
gMarioState->area = gCurrentArea;
|
gMarioState->area = gCurrentArea;
|
||||||
gMarioState->marioObj = gMarioObject;
|
gMarioState->marioObj = gMarioObject;
|
||||||
|
|||||||
@@ -269,7 +269,8 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
|
|||||||
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||||
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
||||||
|
|
||||||
waterLevel = find_water_level(nextPos[0], nextPos[2]);
|
//waterLevel = find_water_level(nextPos[0], nextPos[2]);
|
||||||
|
waterLevel = m->waterLevel;
|
||||||
|
|
||||||
m->wall = upperWall;
|
m->wall = upperWall;
|
||||||
|
|
||||||
@@ -403,7 +404,8 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
|||||||
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||||
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
||||||
|
|
||||||
waterLevel = find_water_level(nextPos[0], nextPos[2]);
|
//waterLevel = find_water_level(nextPos[0], nextPos[2]);
|
||||||
|
waterLevel = m->waterLevel;
|
||||||
|
|
||||||
m->wall = NULL;
|
m->wall = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ struct MarioState
|
|||||||
/*0xC4*/ f32 unkC4;
|
/*0xC4*/ f32 unkC4;
|
||||||
|
|
||||||
u16 curTerrain; // libsm64: added field
|
u16 curTerrain; // libsm64: added field
|
||||||
|
s32 gasLevel; // libsm64: added field
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TYPES_H
|
#endif // TYPES_H
|
||||||
|
|||||||
@@ -440,6 +440,20 @@ SM64_LIB_FN void sm64_set_mario_water_level(int32_t marioId, signed int level)
|
|||||||
gMarioState->waterLevel = level;
|
gMarioState->waterLevel = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SM64_LIB_FN void sm64_set_mario_gas_level(int32_t marioId, signed int level)
|
||||||
|
{
|
||||||
|
if( marioId >= s_mario_instance_pool.size || s_mario_instance_pool.objects[marioId] == NULL )
|
||||||
|
{
|
||||||
|
DEBUG_PRINT("Tried to use non-existant Mario with ID: %d", marioId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState;
|
||||||
|
global_state_bind( globalState );
|
||||||
|
|
||||||
|
gMarioState->gasLevel = level;
|
||||||
|
}
|
||||||
|
|
||||||
SM64_LIB_FN void sm64_mario_take_damage(int32_t marioId, uint32_t damage, uint32_t subtype, float x, float y, float z)
|
SM64_LIB_FN void sm64_mario_take_damage(int32_t marioId, uint32_t damage, uint32_t subtype, float x, float y, float z)
|
||||||
{
|
{
|
||||||
if( marioId >= s_mario_instance_pool.size || s_mario_instance_pool.objects[marioId] == NULL )
|
if( marioId >= s_mario_instance_pool.size || s_mario_instance_pool.objects[marioId] == NULL )
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ extern SM64_LIB_FN void sm64_set_mario_faceangle(int32_t marioId, float y);
|
|||||||
extern SM64_LIB_FN void sm64_set_mario_velocity(int32_t marioId, float x, float y, float z);
|
extern SM64_LIB_FN void sm64_set_mario_velocity(int32_t marioId, float x, float y, float z);
|
||||||
extern SM64_LIB_FN void sm64_set_mario_forward_velocity(int32_t marioId, float vel);
|
extern SM64_LIB_FN void sm64_set_mario_forward_velocity(int32_t marioId, float vel);
|
||||||
extern SM64_LIB_FN void sm64_set_mario_water_level(int32_t marioId, signed int level);
|
extern SM64_LIB_FN void sm64_set_mario_water_level(int32_t marioId, signed int level);
|
||||||
|
extern SM64_LIB_FN void sm64_set_mario_gas_level(int32_t marioId, signed int level);
|
||||||
extern SM64_LIB_FN void sm64_mario_take_damage(int32_t marioId, uint32_t damage, uint32_t subtype, float x, float y, float z);
|
extern SM64_LIB_FN void sm64_mario_take_damage(int32_t marioId, uint32_t damage, uint32_t subtype, float x, float y, float z);
|
||||||
extern SM64_LIB_FN void sm64_mario_heal(int32_t marioId, uint8_t healCounter);
|
extern SM64_LIB_FN void sm64_mario_heal(int32_t marioId, uint8_t healCounter);
|
||||||
extern SM64_LIB_FN void sm64_mario_kill(int32_t marioId);
|
extern SM64_LIB_FN void sm64_mario_kill(int32_t marioId);
|
||||||
|
|||||||
Reference in New Issue
Block a user