mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-26 18:02:30 +00:00
Cap hyudoro speed at 50% kart speed for first place
This commit is contained in:
parent
7a8f3ee88b
commit
6a7b42c063
1 changed files with 15 additions and 2 deletions
|
|
@ -179,6 +179,7 @@ move_to_player (mobj_t *hyu)
|
|||
mobj_t *target = hyudoro_target(hyu);
|
||||
|
||||
angle_t angle;
|
||||
fixed_t speed;
|
||||
|
||||
if (!target)
|
||||
return;
|
||||
|
|
@ -186,8 +187,20 @@ move_to_player (mobj_t *hyu)
|
|||
angle = R_PointToAngle2(
|
||||
hyu->x, hyu->y, target->x, target->y);
|
||||
|
||||
P_InstaThrust(hyu, angle, (hyu->radius / 2) +
|
||||
max(hyu->radius, K_GetSpeed(target)));
|
||||
speed = (hyu->radius / 2) +
|
||||
max(hyu->radius, K_GetSpeed(target));
|
||||
|
||||
// For first place only: cap hyudoro speed at 50%
|
||||
// target player's kart speed
|
||||
if (target->player && target->player->position == 1)
|
||||
{
|
||||
const fixed_t normalspeed =
|
||||
K_GetKartSpeed(target->player, false, false) / 2;
|
||||
|
||||
speed = min(speed, normalspeed);
|
||||
}
|
||||
|
||||
P_InstaThrust(hyu, angle, speed);
|
||||
|
||||
hyu->z = target->z; // stay level with target
|
||||
hyu->angle = angle;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue