Implement FakeObjects (Just poles for now)
This commit is contained in:
@@ -123,8 +123,7 @@ s32 set_pole_position(struct MarioState *m, f32 offsetY)
|
||||
}
|
||||
|
||||
vec3f_copy(m->marioObj->header.gfx.pos, m->pos);
|
||||
vec3s_set(m->marioObj->header.gfx.angle, m->usedObj->oMoveAnglePitch, m->faceAngle[1],
|
||||
m->usedObj->oMoveAngleRoll);
|
||||
vec3s_set(m->marioObj->header.gfx.angle, m->usedObj->oMoveAnglePitch, m->faceAngle[1], m->usedObj->oMoveAngleRoll);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -132,6 +131,7 @@ s32 set_pole_position(struct MarioState *m, f32 offsetY)
|
||||
s32 act_holding_pole(struct MarioState *m)
|
||||
{
|
||||
struct Object *marioObj = m->marioObj;
|
||||
f32 poleStickY = -m->controller->stickY;
|
||||
|
||||
#ifdef VERSION_JP
|
||||
if (m->input & INPUT_A_PRESSED)
|
||||
@@ -163,7 +163,7 @@ s32 act_holding_pole(struct MarioState *m)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m->controller->stickY > 16.0f)
|
||||
if (poleStickY > 16.0f)
|
||||
{
|
||||
f32 poleTop = m->usedObj->hitboxHeight - 100.0f;
|
||||
// const BehaviorScript *poleBehavior = virtual_to_segmented(0x13, m->usedObj->behavior);
|
||||
@@ -174,15 +174,15 @@ s32 act_holding_pole(struct MarioState *m)
|
||||
}
|
||||
|
||||
// if (poleBehavior != bhvGiantPole && m->controller->stickY > 50.0f) {
|
||||
if (m->controller->stickY > 50.0f)
|
||||
if (poleStickY > 50.0f)
|
||||
{
|
||||
return set_mario_action(m, ACT_TOP_OF_POLE_TRANSITION, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (m->controller->stickY < -16.0f)
|
||||
if (poleStickY < -16.0f)
|
||||
{
|
||||
marioObj->oMarioPoleYawVel -= m->controller->stickY * 2;
|
||||
marioObj->oMarioPoleYawVel -= poleStickY * 2;
|
||||
if (marioObj->oMarioPoleYawVel > 0x1000)
|
||||
{
|
||||
marioObj->oMarioPoleYawVel = 0x1000;
|
||||
@@ -223,6 +223,7 @@ s32 act_climbing_pole(struct MarioState *m)
|
||||
s32 sp24;
|
||||
struct Object *marioObj = m->marioObj;
|
||||
s16 cameraAngle = m->area->camera->yaw;
|
||||
f32 poleStickY = -m->controller->stickY;
|
||||
|
||||
#ifndef VERSION_JP
|
||||
if (m->health < 0x100)
|
||||
@@ -240,18 +241,18 @@ s32 act_climbing_pole(struct MarioState *m)
|
||||
return set_mario_action(m, ACT_WALL_KICK_AIR, 0);
|
||||
}
|
||||
|
||||
if (m->controller->stickY < 8.0f)
|
||||
if (poleStickY < 8.0f)
|
||||
{
|
||||
return set_mario_action(m, ACT_HOLDING_POLE, 0);
|
||||
}
|
||||
|
||||
marioObj->oMarioPolePos += m->controller->stickY / 8.0f;
|
||||
marioObj->oMarioPolePos += poleStickY / 8.0f;
|
||||
marioObj->oMarioPoleYawVel = 0;
|
||||
m->faceAngle[1] = cameraAngle - approach_s32((s16)(cameraAngle - m->faceAngle[1]), 0, 0x400, 0x400);
|
||||
|
||||
if (set_pole_position(m, 0.0f) == POLE_NONE)
|
||||
{
|
||||
sp24 = m->controller->stickY / 4.0f * 0x10000;
|
||||
sp24 = poleStickY / 4.0f * 0x10000;
|
||||
set_mario_anim_with_accel(m, MARIO_ANIM_CLIMB_UP_POLE, sp24);
|
||||
add_tree_leaf_particles(m);
|
||||
play_climbing_sounds(m, 1);
|
||||
@@ -336,12 +337,13 @@ s32 act_top_of_pole(struct MarioState *m)
|
||||
{
|
||||
UNUSED
|
||||
struct Object *marioObj = m->marioObj;
|
||||
f32 poleStickY = -m->controller->stickY;
|
||||
|
||||
if (m->input & INPUT_A_PRESSED)
|
||||
{
|
||||
return set_mario_action(m, ACT_TOP_OF_POLE_JUMP, 0);
|
||||
}
|
||||
if (m->controller->stickY < -16.0f)
|
||||
if (poleStickY < -16.0f)
|
||||
{
|
||||
return set_mario_action(m, ACT_TOP_OF_POLE_TRANSITION, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user