mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-21 19:31:26 +00:00
fixed sphere's CA2_MELEE stasis issue
This commit is contained in:
parent
2ae07bdf3b
commit
f2349c5ce4
1 changed files with 40 additions and 37 deletions
77
src/p_user.c
77
src/p_user.c
|
@ -2037,47 +2037,50 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff)
|
||||||
else
|
else
|
||||||
player->pflags &= ~PF_GLIDING;
|
player->pflags &= ~PF_GLIDING;
|
||||||
}
|
}
|
||||||
else if (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2 && player->mo->state-states != S_PLAY_MELEE_LANDING)
|
else if (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
||||||
{
|
{
|
||||||
mobjtype_t type = player->revitem;
|
if (player->mo->state-states != S_PLAY_MELEE_LANDING)
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_MELEE_LANDING);
|
|
||||||
player->mo->tics = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS;
|
|
||||||
S_StartSound(player->mo, sfx_s3k8b);
|
|
||||||
player->pflags |= PF_FULLSTASIS;
|
|
||||||
|
|
||||||
// hearticles
|
|
||||||
if (type)
|
|
||||||
{
|
{
|
||||||
UINT8 i = 0;
|
mobjtype_t type = player->revitem;
|
||||||
angle_t throwang = -(2*ANG30);
|
P_SetPlayerMobjState(player->mo, S_PLAY_MELEE_LANDING);
|
||||||
fixed_t xo = P_ReturnThrustX(player->mo, player->drawangle, 16*player->mo->scale);
|
player->mo->tics = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS;
|
||||||
fixed_t yo = P_ReturnThrustY(player->mo, player->drawangle, 16*player->mo->scale);
|
S_StartSound(player->mo, sfx_s3k8b);
|
||||||
fixed_t zo = 6*player->mo->scale;
|
player->pflags |= PF_FULLSTASIS;
|
||||||
fixed_t mu = FixedMul(player->maxdash, player->mo->scale);
|
|
||||||
fixed_t mu2 = FixedHypot(player->mo->momx, player->mo->momy);
|
|
||||||
fixed_t ev;
|
|
||||||
mobj_t *missile = NULL;
|
|
||||||
if (mu2 < mu)
|
|
||||||
mu2 = mu;
|
|
||||||
ev = (50*FRACUNIT - (mu/25))/50;
|
|
||||||
while (i < 5)
|
|
||||||
{
|
|
||||||
missile = P_SpawnMobjFromMobj(player->mo, xo, yo, zo, type);
|
|
||||||
P_SetTarget(&missile->target, player->mo);
|
|
||||||
missile->angle = throwang + player->drawangle;
|
|
||||||
P_Thrust(missile, player->drawangle + ANGLE_90,
|
|
||||||
P_ReturnThrustY(missile, throwang, mu)); // side to side component
|
|
||||||
P_Thrust(missile, player->drawangle, mu2); // forward component
|
|
||||||
P_SetObjectMomZ(missile, (4 + ((i&1)<<1))*FRACUNIT, true);
|
|
||||||
missile->momz += player->mo->pmomz;
|
|
||||||
missile->fuse = TICRATE/2;
|
|
||||||
missile->extravalue2 = ev;
|
|
||||||
|
|
||||||
i++;
|
// hearticles
|
||||||
throwang += ANG30;
|
if (type)
|
||||||
|
{
|
||||||
|
UINT8 i = 0;
|
||||||
|
angle_t throwang = -(2*ANG30);
|
||||||
|
fixed_t xo = P_ReturnThrustX(player->mo, player->drawangle, 16*player->mo->scale);
|
||||||
|
fixed_t yo = P_ReturnThrustY(player->mo, player->drawangle, 16*player->mo->scale);
|
||||||
|
fixed_t zo = 6*player->mo->scale;
|
||||||
|
fixed_t mu = FixedMul(player->maxdash, player->mo->scale);
|
||||||
|
fixed_t mu2 = FixedHypot(player->mo->momx, player->mo->momy);
|
||||||
|
fixed_t ev;
|
||||||
|
mobj_t *missile = NULL;
|
||||||
|
if (mu2 < mu)
|
||||||
|
mu2 = mu;
|
||||||
|
ev = (50*FRACUNIT - (mu/25))/50;
|
||||||
|
while (i < 5)
|
||||||
|
{
|
||||||
|
missile = P_SpawnMobjFromMobj(player->mo, xo, yo, zo, type);
|
||||||
|
P_SetTarget(&missile->target, player->mo);
|
||||||
|
missile->angle = throwang + player->drawangle;
|
||||||
|
P_Thrust(missile, player->drawangle + ANGLE_90,
|
||||||
|
P_ReturnThrustY(missile, throwang, mu)); // side to side component
|
||||||
|
P_Thrust(missile, player->drawangle, mu2); // forward component
|
||||||
|
P_SetObjectMomZ(missile, (4 + ((i&1)<<1))*FRACUNIT, true);
|
||||||
|
missile->momz += player->mo->pmomz;
|
||||||
|
missile->fuse = TICRATE/2;
|
||||||
|
missile->extravalue2 = ev;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
throwang += ANG30;
|
||||||
|
}
|
||||||
|
if (mobjinfo[type].seesound && missile)
|
||||||
|
S_StartSound(missile, missile->info->seesound);
|
||||||
}
|
}
|
||||||
if (mobjinfo[type].seesound && missile)
|
|
||||||
S_StartSound(missile, missile->info->seesound);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (player->charability2 == CA2_GUNSLINGER && player->panim == PA_ABILITY2)
|
else if (player->charability2 == CA2_GUNSLINGER && player->panim == PA_ABILITY2)
|
||||||
|
|
Loading…
Reference in a new issue