mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
adds frequncy and pitch to aim assist
This commit is contained in:
parent
66d17f60e9
commit
08cdcd6610
1 changed files with 17 additions and 1 deletions
|
@ -578,7 +578,23 @@ int ActorAccessibility_GetRandomStartingFrameCount(int min, int max) {
|
|||
//Aim cue support.
|
||||
void ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* actor)
|
||||
{
|
||||
|
||||
Player* player = GET_PLAYER(actor->play);
|
||||
// 16384
|
||||
s32 angle = player->actor.focus.rot.x;
|
||||
angle = angle / -14000.0 * 16384;
|
||||
s32 yIntercept = ((Math_SinS(angle) / Math_CosS(angle)) * actor->xzDistToPlayer)+player->actor.focus.pos.y;
|
||||
s32 yHight = actor->actor->world.pos.y + 30;
|
||||
if ((yIntercept) > yHight + 30) {
|
||||
actor->aimAssist.pitch = 1.5;
|
||||
} else if ((yIntercept) < yHight - 30) {
|
||||
actor->aimAssist.pitch = 0.5;
|
||||
}
|
||||
s32 yDiff = fabs(yIntercept-yHight);
|
||||
if (yDiff > 300) {
|
||||
actor->aimAssist.frequency = 30;
|
||||
} else {
|
||||
actor->aimAssist.frequency = 1 + (uint8_t)(yDiff / 5);
|
||||
}
|
||||
}
|
||||
|
||||
//External audio engine stuff.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue