mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-06 11:37:19 -04:00
+14
-14
@@ -1125,8 +1125,8 @@ void Actor_UpdatePos(Actor* actor) {
|
||||
* It is recommended to not call this function directly and use `Actor_MoveWithGravity` instead
|
||||
*/
|
||||
void Actor_UpdateVelocityWithGravity(Actor* actor) {
|
||||
actor->velocity.x = actor->speedXZ * Math_SinS(actor->world.rot.y);
|
||||
actor->velocity.z = actor->speedXZ * Math_CosS(actor->world.rot.y);
|
||||
actor->velocity.x = actor->speed * Math_SinS(actor->world.rot.y);
|
||||
actor->velocity.z = actor->speed * Math_CosS(actor->world.rot.y);
|
||||
|
||||
actor->velocity.y += actor->gravity;
|
||||
if (actor->velocity.y < actor->terminalVelocity) {
|
||||
@@ -1150,11 +1150,11 @@ void Actor_MoveWithGravity(Actor* actor) {
|
||||
* It is recommended to not call this function directly and use `Actor_MoveWithoutGravity` instead
|
||||
*/
|
||||
void Actor_UpdateVelocityWithoutGravity(Actor* actor) {
|
||||
f32 horizontalSpeed = Math_CosS(actor->world.rot.x) * actor->speedXZ;
|
||||
f32 speedXZ = Math_CosS(actor->world.rot.x) * actor->speed;
|
||||
|
||||
actor->velocity.x = Math_SinS(actor->world.rot.y) * horizontalSpeed;
|
||||
actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ;
|
||||
actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed;
|
||||
actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ;
|
||||
actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speed;
|
||||
actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1174,11 +1174,11 @@ void Actor_MoveWithoutGravity(Actor* actor) {
|
||||
* It is recommended to not call this function directly and use `Actor_MoveWithoutGravityReverse` instead
|
||||
*/
|
||||
void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor) {
|
||||
f32 horizontalSpeed = Math_CosS(-actor->world.rot.x) * actor->speedXZ;
|
||||
f32 speedXZ = Math_CosS(-actor->world.rot.x) * actor->speed;
|
||||
|
||||
actor->velocity.x = Math_SinS(actor->world.rot.y) * horizontalSpeed;
|
||||
actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speedXZ;
|
||||
actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed;
|
||||
actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ;
|
||||
actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speed;
|
||||
actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1193,7 +1193,7 @@ void Actor_MoveWithoutGravityReverse(Actor* actor) {
|
||||
* Sets horizontal speed and Y velocity using the `speed` argument and current pitch
|
||||
*/
|
||||
void Actor_SetSpeeds(Actor* actor, f32 speed) {
|
||||
actor->speedXZ = Math_CosS(actor->world.rot.x) * speed;
|
||||
actor->speed = Math_CosS(actor->world.rot.x) * speed;
|
||||
actor->velocity.y = -Math_SinS(actor->world.rot.x) * speed;
|
||||
}
|
||||
|
||||
@@ -3607,7 +3607,7 @@ Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3) {
|
||||
((itemAction->id == ACTOR_EN_ARROW) && (func_800BC188(itemAction->params) & arg3))) {
|
||||
f32 speedXZ;
|
||||
|
||||
if ((itemAction->speedXZ <= 0.0f) && (GET_PLAYER(play)->unk_D57 != 0)) {
|
||||
if ((itemAction->speed <= 0.0f) && (GET_PLAYER(play)->unk_D57 != 0)) {
|
||||
if (itemAction->id == ACTOR_ARMS_HOOK) {
|
||||
speedXZ = 20.0f;
|
||||
} else if (itemAction->id == ACTOR_EN_BOOM) {
|
||||
@@ -3624,7 +3624,7 @@ Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
speedXZ = itemAction->speedXZ;
|
||||
speedXZ = itemAction->speed;
|
||||
}
|
||||
|
||||
if (func_800BC1B4(actor, itemAction, arg2, speedXZ)) {
|
||||
@@ -3644,7 +3644,7 @@ Actor* func_800BC444(PlayState* play, Actor* actor, f32 arg2) {
|
||||
while (explosive != NULL) {
|
||||
if (((explosive->id == ACTOR_EN_BOM) || (explosive->id == ACTOR_EN_BOM_CHU) ||
|
||||
(explosive->id == ACTOR_EN_BOMBF))) {
|
||||
if (func_800BC1B4(actor, explosive, arg2, explosive->speedXZ)) {
|
||||
if (func_800BC1B4(actor, explosive, arg2, explosive->speed)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,8 +207,8 @@ s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget) {
|
||||
s32 reachedEnd = false;
|
||||
Vec3f curPointPos;
|
||||
|
||||
Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
|
||||
rotStep = enHy->actor.speedXZ * 400.0f;
|
||||
Math_SmoothStepToF(&enHy->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f);
|
||||
rotStep = enHy->actor.speed * 400.0f;
|
||||
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) &&
|
||||
SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) {
|
||||
enHy->curPoint++;
|
||||
@@ -225,8 +225,8 @@ s32 EnHy_MoveBackwards(EnHy* enHy, f32 speedTarget) {
|
||||
s32 reachedEnd = false;
|
||||
Vec3f curPointPos;
|
||||
|
||||
Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
|
||||
rotStep = enHy->actor.speedXZ * 400.0f;
|
||||
Math_SmoothStepToF(&enHy->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f);
|
||||
rotStep = enHy->actor.speed * 400.0f;
|
||||
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) &&
|
||||
SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) {
|
||||
enHy->curPoint--;
|
||||
|
||||
@@ -219,7 +219,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
|
||||
this->unk152 = 15;
|
||||
this->unk14C = 35;
|
||||
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.speed = 0.0f;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
||||
@@ -346,7 +346,7 @@ void func_800A640C(EnItem00* this, PlayState* play) {
|
||||
this->actor.shape.yOffset = (Math_SinS(this->actor.shape.rot.y) * 150.0f) + 850.0f;
|
||||
}
|
||||
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
|
||||
if (this->unk14C == 0) {
|
||||
if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) &&
|
||||
@@ -406,7 +406,7 @@ void func_800A6780(EnItem00* this, PlayState* play) {
|
||||
|
||||
if (this->actor.params == ITEM00_RECOVERY_HEART) {
|
||||
if (this->actor.velocity.y < 0.0f) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.speed = 0.0f;
|
||||
this->actor.gravity = -0.4f;
|
||||
if (this->actor.velocity.y < -1.5f) {
|
||||
this->actor.velocity.y = -1.5f;
|
||||
@@ -447,7 +447,7 @@ void func_800A6780(EnItem00* this, PlayState* play) {
|
||||
if (this->actor.bgCheckFlags & 3) {
|
||||
this->actionFunc = func_800A640C;
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.speed = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,7 +684,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
|
||||
this->unk152 = 15;
|
||||
this->unk14C = 35;
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.speed = 0.0f;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
||||
@@ -951,7 +951,7 @@ Actor* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, u32 params) {
|
||||
} else {
|
||||
spawnedActor->velocity.y = -2.0f;
|
||||
}
|
||||
spawnedActor->speedXZ = 2.0f;
|
||||
spawnedActor->speed = 2.0f;
|
||||
spawnedActor->gravity = -0.9f;
|
||||
spawnedActor->world.rot.y = randPlusMinusPoint5Scaled(0x10000);
|
||||
Actor_SetScale(spawnedActor, 0.0f);
|
||||
@@ -1002,7 +1002,7 @@ Actor* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s32 params) {
|
||||
if (spawnedActor != NULL) {
|
||||
if (param8000 == 0) {
|
||||
spawnedActor->velocity.y = 0.0f;
|
||||
spawnedActor->speedXZ = 0.0f;
|
||||
spawnedActor->speed = 0.0f;
|
||||
if (param10000 != 0) {
|
||||
spawnedActor->gravity = 0.0f;
|
||||
} else {
|
||||
@@ -1195,7 +1195,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP
|
||||
spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
|
||||
if ((spawnedActor != 0) && (dropId != (u8)ITEM00_NO_DROP)) {
|
||||
spawnedActor->actor.velocity.y = 8.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.speed = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
|
||||
Actor_SetScale(&spawnedActor->actor, 0.0f);
|
||||
|
||||
@@ -492,7 +492,7 @@ s32 Player_IsGoronOrDeku(Player* player) {
|
||||
s32 func_801234D4(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
return (player->stateFlags2 & PLAYER_STATE2_8) || player->actor.speedXZ != 0.0f ||
|
||||
return (player->stateFlags2 & PLAYER_STATE2_8) || (player->actor.speed != 0.0f) ||
|
||||
((player->transformation != PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000)) ||
|
||||
((player->transformation == PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000) &&
|
||||
(!(player->actor.bgCheckFlags & 1) || (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER)));
|
||||
|
||||
+1
-1
@@ -762,7 +762,7 @@ s32 SubS_WeightPathing_Move(Actor* actor, Path* path, s32* waypoint, f32* progre
|
||||
}
|
||||
while (true) {
|
||||
if (!SubS_WeightPathing_ComputePoint(path, *waypoint, &point, *progress, direction) ||
|
||||
((s32)(actor->speedXZ * 10000.0f) == 0)) {
|
||||
((s32)(actor->speed * 10000.0f) == 0)) {
|
||||
return false;
|
||||
}
|
||||
dist = Math_Vec3f_DistXZ(&actor->world.pos, &point);
|
||||
|
||||
Reference in New Issue
Block a user