mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 02:42:20 +00:00
Okay, this is a MUCH better solution than PF_JUMPDAMAGE.
This commit is contained in:
parent
76ff26e6fb
commit
c54d62851c
5 changed files with 13 additions and 13 deletions
|
@ -156,8 +156,8 @@ typedef enum
|
|||
// Used shield ability
|
||||
PF_SHIELDABILITY = 1<<28,
|
||||
|
||||
// Do jump damage?
|
||||
PF_JUMPDAMAGE = 1<<29
|
||||
// Force jump damage?
|
||||
PF_FORCEJUMPDAMAGE = 1<<29
|
||||
|
||||
// free up to and including 1<<31
|
||||
} pflags_t;
|
||||
|
|
|
@ -306,7 +306,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
}
|
||||
|
||||
if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
||||
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
||||
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
||||
|
@ -353,7 +353,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
P_DamageMobj(toucher, special, special, 1, 0);
|
||||
}
|
||||
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
||||
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
||||
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
||||
|
@ -1346,7 +1346,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
return;
|
||||
}
|
||||
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
||||
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
||||
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
||||
|
|
|
@ -1058,7 +1058,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (thing->flags & MF_MONITOR
|
||||
&& (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING)
|
||||
|| ((tmthing->player->pflags & PF_JUMPED)
|
||||
&& (tmthing->player->pflags & PF_JUMPDAMAGE
|
||||
&& (tmthing->player->pflags & PF_FORCEJUMPDAMAGE
|
||||
|| !(tmthing->player->charflags & SF_NOJUMPSPIN)
|
||||
|| (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
||||
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
||||
|| ((tmthing->player->charflags & SF_STOMPDAMAGE)
|
||||
|
@ -1093,7 +1094,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
else if (thing->flags & MF_MONITOR && tmthing->player
|
||||
&& (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING)
|
||||
|| ((tmthing->player->pflags & PF_JUMPED)
|
||||
&& (tmthing->player->pflags & PF_JUMPDAMAGE
|
||||
&& (tmthing->player->pflags & PF_FORCEJUMPDAMAGE
|
||||
|| !(tmthing->player->charflags & SF_NOJUMPSPIN)
|
||||
|| (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
||||
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
||||
|| ((tmthing->player->charflags & SF_STOMPDAMAGE)
|
||||
|
|
|
@ -3233,7 +3233,7 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
mo->player->pflags &= ~PF_SPINNING;
|
||||
|
||||
if (!(mo->player->pflags & PF_GLIDING))
|
||||
mo->player->pflags &= ~(PF_JUMPED|PF_JUMPDAMAGE);
|
||||
mo->player->pflags &= ~(PF_JUMPED|PF_FORCEJUMPDAMAGE);
|
||||
|
||||
mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/);
|
||||
mo->player->secondjump = 0;
|
||||
|
|
|
@ -877,7 +877,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
|||
// Useful when you want to kill everything the player is doing.
|
||||
void P_ResetPlayer(player_t *player)
|
||||
{
|
||||
player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_JUMPDAMAGE|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY);
|
||||
player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_FORCEJUMPDAMAGE|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY);
|
||||
player->powers[pw_carry] = CR_NONE;
|
||||
player->jumping = 0;
|
||||
player->secondjump = 0;
|
||||
|
@ -3766,8 +3766,6 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
player->mo->eflags &= ~MFE_APPLYPMOMZ;
|
||||
|
||||
player->pflags |= PF_JUMPED;
|
||||
if (!(player->charflags & SF_NOJUMPDAMAGE))
|
||||
player->pflags |= PF_JUMPDAMAGE;
|
||||
|
||||
if (soundandstate)
|
||||
{
|
||||
|
@ -7045,7 +7043,7 @@ static void P_MovePlayer(player_t *player)
|
|||
player->homing = 2;
|
||||
if (P_LookForEnemies(player, false) && player->mo->tracer)
|
||||
{
|
||||
player->pflags |= PF_JUMPDAMAGE;
|
||||
player->pflags |= PF_FORCEJUMPDAMAGE;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
|
||||
S_StartSound(player->mo, sfx_s3k40);
|
||||
player->homing = 3*TICRATE;
|
||||
|
@ -7056,7 +7054,7 @@ static void P_MovePlayer(player_t *player)
|
|||
// Elemental/Bubblewrap shield activation
|
||||
case SH_ELEMENTAL:
|
||||
case SH_BUBBLEWRAP:
|
||||
player->pflags |= PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY;
|
||||
player->pflags |= PF_FORCEJUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SPIN);
|
||||
player->secondjump = 0;
|
||||
player->mo->momx = player->mo->momy = 0;
|
||||
|
|
Loading…
Reference in a new issue