From c54d62851cad7f2e4a042397d8dab3205d0048ee Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 16:04:02 +0100 Subject: [PATCH] Okay, this is a MUCH better solution than PF_JUMPDAMAGE. --- src/d_player.h | 4 ++-- src/p_inter.c | 6 +++--- src/p_map.c | 6 ++++-- src/p_mobj.c | 2 +- src/p_user.c | 8 +++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4f9833fa0..4f3e37e59 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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; diff --git a/src/p_inter.c b/src/p_inter.c index 8c66d35a0..4bf600c51 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -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? diff --git a/src/p_map.c b/src/p_map.c index d924ad564..72668e478 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -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) diff --git a/src/p_mobj.c b/src/p_mobj.c index e15fe26cd..ecf0133f1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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; diff --git a/src/p_user.c b/src/p_user.c index 5533ed619..fc7ea2159 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -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;