mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-20 19:02:34 +00:00
Merge branch 'fix-boss2pogotarget' into 'next'
Make several actions actually check for a player smh (Fixes #387) Closes #387 See merge request STJr/SRB2!1340
This commit is contained in:
commit
36c193f317
1 changed files with 18 additions and 7 deletions
|
@ -4912,7 +4912,7 @@ void A_ThrownRing(mobj_t *actor)
|
|||
}
|
||||
|
||||
if (actor->tracer && (actor->tracer->health)
|
||||
&& (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC))// Already found someone to follow.
|
||||
&& (actor->tracer->player && actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC))// Already found someone to follow.
|
||||
{
|
||||
const INT32 temp = actor->threshold;
|
||||
actor->threshold = 32000;
|
||||
|
@ -5920,13 +5920,18 @@ void A_DetonChase(mobj_t *actor)
|
|||
|
||||
if (actor->reactiontime == -42)
|
||||
{
|
||||
fixed_t xyspeed;
|
||||
fixed_t xyspeed, speed;
|
||||
|
||||
if (actor->target->player)
|
||||
speed = actor->target->player->normalspeed;
|
||||
else
|
||||
speed = actor->target->info->speed;
|
||||
|
||||
actor->reactiontime = -42;
|
||||
|
||||
exact = actor->movedir>>ANGLETOFINESHIFT;
|
||||
xyspeed = FixedMul(FixedMul(actor->tracer->player->normalspeed,3*FRACUNIT/4), FINECOSINE(exact));
|
||||
actor->momz = FixedMul(FixedMul(actor->tracer->player->normalspeed,3*FRACUNIT/4), FINESINE(exact));
|
||||
xyspeed = FixedMul(FixedMul(speed,3*FRACUNIT/4), FINECOSINE(exact));
|
||||
actor->momz = FixedMul(FixedMul(speed,3*FRACUNIT/4), FINESINE(exact));
|
||||
|
||||
exact = actor->angle>>ANGLETOFINESHIFT;
|
||||
actor->momx = FixedMul(xyspeed, FINECOSINE(exact));
|
||||
|
@ -7521,7 +7526,7 @@ void A_Boss2PogoTarget(mobj_t *actor)
|
|||
}
|
||||
|
||||
// Target hit, retreat!
|
||||
if (actor->target->player->powers[pw_flashing] > TICRATE || actor->flags2 & MF2_FRET)
|
||||
if ((actor->target->player && actor->target->player->powers[pw_flashing] > TICRATE) || actor->flags2 & MF2_FRET)
|
||||
{
|
||||
UINT8 prandom = P_RandomByte();
|
||||
actor->z++; // unstick from the floor
|
||||
|
@ -7532,7 +7537,7 @@ void A_Boss2PogoTarget(mobj_t *actor)
|
|||
// Try to land on top of the player.
|
||||
else if (FixedHypot(actor->x-actor->target->x, actor->y-actor->target->y) < FixedMul(512*FRACUNIT, actor->scale))
|
||||
{
|
||||
fixed_t airtime, gravityadd, zoffs;
|
||||
fixed_t airtime, gravityadd, zoffs, height;
|
||||
|
||||
// check gravity in the sector (for later math)
|
||||
P_CheckGravity(actor, true);
|
||||
|
@ -7554,7 +7559,13 @@ void A_Boss2PogoTarget(mobj_t *actor)
|
|||
// Remember, kids!
|
||||
// Reduced down Calculus lets you avoid bad 'logic math' loops!
|
||||
//airtime = FixedDiv(-actor->momz<<1, gravityadd)<<1; // going from 0 to 0 is much simpler
|
||||
zoffs = (P_GetPlayerHeight(actor->target->player)>>1) + (actor->target->floorz - actor->floorz); // offset by the difference in floor height plus half the player height,
|
||||
|
||||
if (actor->target->player)
|
||||
height = P_GetPlayerHeight(actor->target->player) >> 1;
|
||||
else
|
||||
height = actor->target->height >> 1;
|
||||
|
||||
zoffs = height + (actor->target->floorz - actor->floorz); // offset by the difference in floor height plus half the player height,
|
||||
airtime = FixedDiv((-actor->momz - FixedSqrt(FixedMul(actor->momz,actor->momz)+zoffs)), gravityadd)<<1; // to try and land on their head rather than on their feet
|
||||
|
||||
actor->angle = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y);
|
||||
|
|
Loading…
Reference in a new issue