From 4a1f0ce91c658608cd0682a60d9d2385d0cb1c1a Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 05:24:31 -0400 Subject: [PATCH 01/96] New attract shield active Homing attack when activating the attract shield while jumping. --- src/dehacked.c | 1 + src/info.c | 3 ++- src/info.h | 1 + src/lua_baselib.c | 3 ++- src/p_local.h | 2 +- src/p_mobj.c | 7 ++++++- src/p_user.c | 41 +++++++++++++++++++++++++++++++++++------ 7 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 227c48b69..31fb571c1 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5375,6 +5375,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_MAGN10", "S_MAGN11", "S_MAGN12", + "S_MAGN13", "S_FORC1", "S_FORC2", diff --git a/src/info.c b/src/info.c index 775996092..58a652f82 100644 --- a/src/info.c +++ b/src/info.c @@ -1757,6 +1757,7 @@ state_t states[NUMSTATES] = {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_MAGN11}, // S_MAGN10 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_MAGN12}, // S_MAGN11 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN12 + {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS10|12, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN13 {SPR_FORC, FF_TRANS50 , 3, {NULL}, 0, 0, S_FORC2 }, // S_FORC1 {SPR_FORC, FF_TRANS50|1, 3, {NULL}, 0, 0, S_FORC3 }, // S_FORC2 @@ -10365,7 +10366,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_MAGN13, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate diff --git a/src/info.h b/src/info.h index 44a3dd012..a6d5dbd3f 100644 --- a/src/info.h +++ b/src/info.h @@ -2262,6 +2262,7 @@ typedef enum state S_MAGN10, S_MAGN11, S_MAGN12, + S_MAGN13, S_FORC1, S_FORC2, diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 9b0a34f17..9c09e726e 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -791,10 +791,11 @@ static int lib_pReturnThrustY(lua_State *L) static int lib_pLookForEnemies(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + boolean nonenemies = lua_opttrueboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - lua_pushboolean(L, P_LookForEnemies(player)); + lua_pushboolean(L, P_LookForEnemies(player, nonenemies)); return 1; } diff --git a/src/p_local.h b/src/p_local.h index 1e0a9e2eb..db10cdb1c 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -164,7 +164,7 @@ fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move); fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move); void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move); -boolean P_LookForEnemies(player_t *player); +boolean P_LookForEnemies(player_t *player, boolean nonenemies); void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius); void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user boolean P_SuperReady(player_t *player); diff --git a/src/p_mobj.c b/src/p_mobj.c index 9565648c2..b79350092 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5608,12 +5608,17 @@ void P_MobjThinker(mobj_t *mobj) case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: - case MT_YELLOWORB: case MT_BLUEORB: case MT_PITYORB: if (!P_AddShield(mobj)) return; break; + case MT_YELLOWORB: + if (!P_AddShield(mobj)) + return; + if (mobj->target->player->homing) + P_SetMobjState(mobj, mobj->info->painstate); + break; case MT_WATERDROP: P_SceneryCheckWater(mobj); if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop) diff --git a/src/p_user.c b/src/p_user.c index 32dc8733f..ad0b7b76a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3971,7 +3971,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if (player->charability == CA_HOMINGTHOK && !player->homing) { - if (P_LookForEnemies(player)) + if (P_LookForEnemies(player, true)) { if (player->mo->tracer) player->homing = 3*TICRATE; @@ -6792,6 +6792,17 @@ static void P_MovePlayer(player_t *player) if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) P_BlackOw(player); } + // Attract shield activation + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + { + if (!(player->pflags & PF_THOKKED)) + { + player->pflags |= PF_THOKKED; + player->homing = 2; + if (P_LookForEnemies(player, false) && player->mo->tracer) + player->homing = 3*TICRATE; + } + } } // Super Sonic move if (player->charflags & SF_SUPER && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) @@ -6807,8 +6818,20 @@ static void P_MovePlayer(player_t *player) } } + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + { + if (player->homing && player->mo->tracer) + { + if (!(player->pflags & PF_JUMPED) + || player->mo->tracer->health <= 0 + || player->mo->tracer->flags2 & MF2_FRET) + player->homing = 0; + else + P_HomingAttack(player->mo, player->mo->tracer); + } + } // HOMING option. - if (player->charability == CA_HOMINGTHOK) + else if (player->charability == CA_HOMINGTHOK) { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) @@ -7410,9 +7433,9 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) // // P_LookForEnemies // Looks for something you can hit - Used for homing attack -// Includes monitors and springs! +// If nonenemies is true, includes monitors and springs! // -boolean P_LookForEnemies(player_t *player) +boolean P_LookForEnemies(player_t *player, boolean nonenemies) { mobj_t *mo; thinker_t *think; @@ -7425,7 +7448,8 @@ boolean P_LookForEnemies(player_t *player) continue; // not a mobj thinker mo = (mobj_t *)think; - if (!(mo->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR|MF_SPRING))) + if ((nonenemies && !(mo->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR|MF_SPRING))) + || (!nonenemies && !(mo->flags & (MF_ENEMY|MF_BOSS)))) continue; // not a valid enemy if (mo->health <= 0) // dead @@ -7524,7 +7548,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target ns = FixedMul(source->info->speed, source->scale); } else if (source->player) - ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); + { + if (source->player->charability == CA_HOMINGTHOK) + ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); + else //if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + ns = FixedMul(80*FRACUNIT, source->scale); + } source->momx = FixedMul(FixedDiv(enemy->x - source->x, dist), ns); source->momy = FixedMul(FixedDiv(enemy->y - source->y, dist), ns); From 65f2d4b80f857d25aab7961968c6fdfa1c8d3cd4 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 05:59:42 -0400 Subject: [PATCH 02/96] Add PF_SHIELDABILITY This flag is used as a distinction between the character ability CA_HOMINGTHOK and the attract shield's active ability. --- src/d_player.h | 3 +-- src/p_map.c | 4 ++-- src/p_mobj.c | 2 +- src/p_user.c | 30 ++++++++++-------------------- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index b9fcdef75..5ef19c9ac 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -152,8 +152,7 @@ typedef enum /*** misc ***/ PF_FORCESTRAFE = 1<<29, // Turning inputs are translated into strafing inputs PF_ANALOGMODE = 1<<30, // Analog mode? - - // free: 1<<30 and 1<<31 + PF_SHIELDABILITY = 1<<31 // Thokked with shield ability } pflags_t; typedef enum diff --git a/src/p_map.c b/src/p_map.c index 46e32e385..ab2b1662c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -121,7 +121,7 @@ void P_DoSpring(mobj_t *spring, mobj_t *object) /*Someone want to make these work like bumpers?*/ return; } - + object->eflags |= MFE_SPRUNG; // apply this flag asap! spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify @@ -188,7 +188,7 @@ void P_DoSpring(mobj_t *spring, mobj_t *object) localangle2 = spring->angle; } - pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these. + pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. P_ResetPlayer(object->player); if (P_MobjFlip(object)*vertispeed > 0) diff --git a/src/p_mobj.c b/src/p_mobj.c index b79350092..26ff7b92b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2183,7 +2183,7 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; - mo->player->pflags &= ~PF_THOKKED; + mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); //mo->player->pflags &= ~PF_GLIDING; mo->player->jumping = 0; mo->player->secondjump = 0; diff --git a/src/p_user.c b/src/p_user.c index ad0b7b76a..089c0dc9b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -661,7 +661,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->mo->height = player->mo->tracer->height; } - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); player->homing = 0; player->mo->fuse = 0; player->speed = 0; @@ -874,7 +874,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_ROPEHANG|PF_ITEMHANG|PF_MACESPIN|PF_SPINNING|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CARRIED); + player->pflags &= ~(PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN|PF_SPINNING|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_SHIELDABILITY|PF_CARRIED); player->jumping = 0; player->secondjump = 0; player->glidetime = 0; @@ -6797,7 +6797,7 @@ static void P_MovePlayer(player_t *player) { if (!(player->pflags & PF_THOKKED)) { - player->pflags |= PF_THOKKED; + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->homing = 2; if (P_LookForEnemies(player, false) && player->mo->tracer) player->homing = 3*TICRATE; @@ -6818,25 +6818,15 @@ static void P_MovePlayer(player_t *player) } } - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) - { - if (player->homing && player->mo->tracer) - { - if (!(player->pflags & PF_JUMPED) - || player->mo->tracer->health <= 0 - || player->mo->tracer->flags2 & MF2_FRET) - player->homing = 0; - else - P_HomingAttack(player->mo, player->mo->tracer); - } - } // HOMING option. - else if (player->charability == CA_HOMINGTHOK) + if (player->charability == CA_HOMINGTHOK + || (player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) { - P_SpawnThokMobj(player); + if (!(player->pflags & PF_SHIELDABILITY)) + P_SpawnThokMobj(player); P_HomingAttack(player->mo, player->mo->tracer); // But if you don't, then stop homing. @@ -6852,7 +6842,7 @@ static void P_MovePlayer(player_t *player) if (player->mo->tracer->flags2 & MF2_FRET) P_InstaThrust(player->mo, player->mo->angle, -(player->speed>>3)); - if (!(player->mo->tracer->flags & MF_BOSS)) + if (!(player->pflags & PF_SHIELDABILITY) && !(player->mo->tracer->flags & MF_BOSS)) player->pflags &= ~PF_THOKKED; } } @@ -7549,9 +7539,9 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target } else if (source->player) { - if (source->player->charability == CA_HOMINGTHOK) + if (source->player->charability == CA_HOMINGTHOK && !(source->player->pflags & PF_SHIELDABILITY)) ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); - else //if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + else ns = FixedMul(80*FRACUNIT, source->scale); } From 18920e486d1de6c43716d80b469171ab85df0d94 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 06:07:38 -0400 Subject: [PATCH 03/96] Add sfx to Attract shield dash. Because it seemed really weird for a sudden shift of momentum to be unaccompanied. --- src/p_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_user.c b/src/p_user.c index 089c0dc9b..dcb05e8ee 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6799,6 +6799,7 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->homing = 2; + S_StartSound(player->mo, sfx_spdpad); if (P_LookForEnemies(player, false) && player->mo->tracer) player->homing = 3*TICRATE; } From ecd867ab3552ad310f0edd0d006e3c14ec514f29 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 21:08:30 -0400 Subject: [PATCH 04/96] Change A_BombShield to add P_BlackOw. Now when you obtain an Armageddon Shield, and you already HAVE one, the first one explodes _while_ applying the second. --- src/p_enemy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index ef9ff5dda..7d94e105d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3200,12 +3200,13 @@ void A_BombShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_BOMB) - { - player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + // If you already have a bomb shield, use it! + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + P_BlackOw(player); + // Now we know for certain that we don't have a bomb shield, so add one. :3 + player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK); + P_SpawnShieldOrb(player); S_StartSound(player->mo, actor->info->seesound); } From 8a1411b1222eddeaf1a6a4493351de040ffb2e55 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 22:06:27 -0400 Subject: [PATCH 05/96] Attraction homing tweaks. Lower homing speed. Retain velocity after hitting your target. --- src/p_user.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index dcb05e8ee..6206b5d4c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6820,8 +6820,21 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if (player->charability == CA_HOMINGTHOK - || (player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + && player->pflags & PF_SHIELDABILITY) + { + if (player->homing && player->mo->tracer) + { + P_HomingAttack(player->mo, player->mo->tracer); + if (player->mo->tracer->health <= 0 || (player->mo->tracer->flags2 & MF2_FRET)) + player->homing = 0; + } + + // If you're not jumping, then you obviously wouldn't be homing. + if (!(player->pflags & PF_JUMPED)) + player->homing = 0; + } + else if (player->charability == CA_HOMINGTHOK) { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) @@ -7543,7 +7556,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target if (source->player->charability == CA_HOMINGTHOK && !(source->player->pflags & PF_SHIELDABILITY)) ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); else - ns = FixedMul(80*FRACUNIT, source->scale); + ns = FixedMul(45*FRACUNIT, source->scale); } source->momx = FixedMul(FixedDiv(enemy->x - source->x, dist), ns); From 406d809bc2d05048f374bf2a4602f302c5275159 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 22:57:11 -0400 Subject: [PATCH 06/96] Change attract homing thok to negate Z. Do not keep Z momentum from homing. It is a bad idea. --- src/p_user.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 6206b5d4c..ea4d83938 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6827,7 +6827,12 @@ static void P_MovePlayer(player_t *player) { P_HomingAttack(player->mo, player->mo->tracer); if (player->mo->tracer->health <= 0 || (player->mo->tracer->flags2 & MF2_FRET)) + { + P_SetObjectMomZ(player->mo, 6*FRACUNIT, false); + if (player->mo->eflags & MFE_UNDERWATER) + player->mo->momz = FixedMul(player->mo->momz, FRACUNIT/3); player->homing = 0; + } } // If you're not jumping, then you obviously wouldn't be homing. @@ -6839,8 +6844,7 @@ static void P_MovePlayer(player_t *player) // If you've got a target, chase after it! if (player->homing && player->mo->tracer) { - if (!(player->pflags & PF_SHIELDABILITY)) - P_SpawnThokMobj(player); + P_SpawnThokMobj(player); P_HomingAttack(player->mo, player->mo->tracer); // But if you don't, then stop homing. @@ -6856,7 +6860,7 @@ static void P_MovePlayer(player_t *player) if (player->mo->tracer->flags2 & MF2_FRET) P_InstaThrust(player->mo, player->mo->angle, -(player->speed>>3)); - if (!(player->pflags & PF_SHIELDABILITY) && !(player->mo->tracer->flags & MF_BOSS)) + if (!(player->mo->tracer->flags & MF_BOSS)) player->pflags &= ~PF_THOKKED; } } From 2d141739680dbc7802269596f89a3bb1590a663e Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Fri, 29 May 2015 02:35:24 -0400 Subject: [PATCH 07/96] Allow spin button Jump Shield normally. If you walk off a cliff with a jump shield, you can now press EITHER the jump or spin buttons to activate it and double jump. --- src/p_user.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index ea4d83938..613fbe68d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3832,11 +3832,13 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_USE && !(player->pflags & PF_JUMPDOWN) && !player->exiting && !P_PlayerInPain(player)) { - if (onground || player->climbing || player->pflags & (PF_CARRIED|PF_ITEMHANG|PF_ROPEHANG)) - {} - else if (player->pflags & PF_MACESPIN && player->mo->tracer) - {} - else if (!(player->pflags & PF_SLIDING) && ((gametype != GT_CTF) || (!player->gotflag))) + if (onground || player->climbing || player->pflags & (PF_CARRIED|PF_ITEMHANG|PF_ROPEHANG|PF_SLIDING) + || (player->pflags & PF_MACESPIN && player->mo->tracer)) + ; + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP + && !(player->pflags & PF_JUMPED)) + P_DoJumpShield(player); + else if (gametype != GT_CTF || !player->gotflag) { #ifdef HAVE_BLUA if (!LUAh_JumpSpinSpecial(player)) From 99066429de332494f76d6da177a5793840f225ee Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Fri, 29 May 2015 15:47:54 -0400 Subject: [PATCH 08/96] Add PF_SHIELDABILITY to dehacked. --- src/dehacked.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dehacked.c b/src/dehacked.c index 31fb571c1..7b6606b5d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7267,6 +7267,7 @@ static const char *const PLAYERFLAG_LIST[] = { /*** misc ***/ "FORCESTRAFE", // Translate turn inputs into strafe inputs "ANALOGMODE", // Analog mode? + "SHIELDABILITY", // Thokked with shield ability NULL // stop loop here. }; From f8dd9b64abfa69a4af52bfe3923204b07b68f2c7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 21:55:17 +0100 Subject: [PATCH 09/96] Elemental shield ability now coded. REQUIRES NEW PATCH.DTA FROM THE FTP. - Press spin in midair to stomp directly downwards (losing horizontal momentum), creating a flickering fireball around you. - No bouncing on enemies, item boxes, etc - just go straight through. - Hurts other players on touch whilst you're stomping. - Spawns a bunch of flames around you when you hit the ground. Also: - Electric shield's ability now uses different sounds, because I'm picky. --- src/dehacked.c | 14 ++++++- src/info.c | 75 +++++++++++++++++++++++++--------- src/info.h | 15 ++++++- src/lua_baselib.c | 3 +- src/p_inter.c | 12 ++++-- src/p_local.h | 2 +- src/p_map.c | 8 ++-- src/p_mobj.c | 22 ++++++++++ src/p_user.c | 100 ++++++++++++++++++++++++++++++++-------------- 9 files changed, 191 insertions(+), 60 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index f5d3b55cb..1afa5f0cf 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4782,7 +4782,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPIKEBALL7", "S_SPIKEBALL8", - // Fire Shield's Spawn + // Elemental Shield's Spawn + "S_SPINFIRE0", "S_SPINFIRE1", "S_SPINFIRE2", "S_SPINFIRE3", @@ -4790,6 +4791,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPINFIRE5", "S_SPINFIRE6", + // Elemental Shield's FLYING Spawn + "S_AIRSPINFIRE_FLY1", + "S_AIRSPINFIRE_FLY2", + "S_AIRSPINFIRE_FLY3", + "S_AIRSPINFIRE_FLY4", + "S_AIRSPINFIRE_FLY5", + "S_AIRSPINFIRE_FLY6", + "S_AIRSPINFIRE_DIE", + // Spikes "S_SPIKE1", "S_SPIKE2", @@ -5399,6 +5409,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ELEMF6", "S_ELEMF7", "S_ELEMF8", + "S_ELEMF9", + "S_ELEMF10", "S_PITY1", "S_PITY2", diff --git a/src/info.c b/src/info.c index 5e6528c01..f946e72e8 100644 --- a/src/info.c +++ b/src/info.c @@ -1123,13 +1123,23 @@ state_t states[NUMSTATES] = {SPR_SPIK, 6, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL8}, // S_SPIKEBALL7 {SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8 - // Red Shield's Spawn - {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 - {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 - {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 - {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 - {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 + // Elemental Shield's Spawn + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {A_SetFuse}, 6*TICRATE, 0, S_SPINFIRE1}, // S_SPINFIRE0 + {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 + {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 + {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 + {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 + {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 + + // Elemental Shield's FLYING Spawn + {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY2}, //S_AIRSPINFIRE_FLY1, + {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY3}, //S_AIRSPINFIRE_FLY2, + {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY4}, //S_AIRSPINFIRE_FLY3, + {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY5}, //S_AIRSPINFIRE_FLY4, + {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY6}, //S_AIRSPINFIRE_FLY5, + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY1}, //S_AIRSPINFIRE_FLY6, + {SPR_SFLM, FF_FULLBRIGHT, 0, {A_SpawnObjectRelative}, 0, MT_SPINFIRE, S_NULL}, //S_AIRSPINFIRE_DIE, // Floor Spike {SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended @@ -1742,14 +1752,16 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_TRANS50|10, 4, {NULL}, 0, 0, S_ELEM12}, // S_ELEM11 {SPR_ELEM, FF_TRANS50|11, 4, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM12 - {SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2}, // S_ELEMF1 - {SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3}, // S_ELEMF2 - {SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4}, // S_ELEMF3 - {SPR_ELEM, FF_FULLBRIGHT|15, 3, {NULL}, 0, 0, S_ELEMF5}, // S_ELEMF4 - {SPR_ELEM, FF_FULLBRIGHT|16, 3, {NULL}, 0, 0, S_ELEMF6}, // S_ELEMF5 - {SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7}, // S_ELEMF6 - {SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8}, // S_ELEMF7 - {SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1}, // S_ELEMF8 + {SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2 }, // S_ELEMF1 + {SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3 }, // S_ELEMF2 + {SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4 }, // S_ELEMF3 + {SPR_ELEM, FF_FULLBRIGHT|15, 3, {NULL}, 0, 0, S_ELEMF5 }, // S_ELEMF4 + {SPR_ELEM, FF_FULLBRIGHT|16, 3, {NULL}, 0, 0, S_ELEMF6 }, // S_ELEMF5 + {SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7 }, // S_ELEMF6 + {SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8 }, // S_ELEMF7 + {SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF8 + {SPR_ELEM, FF_FULLBRIGHT|20, 1, {NULL}, 0, 0, S_ELEMF10}, // S_ELEMF9 + {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF10 {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY2 }, // S_PITY1 {SPR_PITY, FF_TRANS20|1, 1, {NULL}, 0, 0, S_PITY3 }, // S_PITY2 @@ -5392,7 +5404,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPINFIRE -1, // doomednum - S_SPINFIRE1, // spawnstate + S_SPINFIRE0, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -5413,7 +5425,34 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags + MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE|MF_RUNSPAWNFUNC, // flags + S_NULL // raisestate + }, + + { // MT_AIRSPINFIRE + -1, // doomednum + S_AIRSPINFIRE_FLY1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_AIRSPINFIRE_DIE, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 10*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_MISSILE|MF_FIRE, // flags S_NULL // raisestate }, @@ -9833,7 +9872,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_ELEMF9, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate diff --git a/src/info.h b/src/info.h index f49a56baa..8a56ef77e 100644 --- a/src/info.h +++ b/src/info.h @@ -1633,7 +1633,8 @@ typedef enum state S_SPIKEBALL7, S_SPIKEBALL8, - // Fire Shield's Spawn + // Elemental Shield's Spawn + S_SPINFIRE0, S_SPINFIRE1, S_SPINFIRE2, S_SPINFIRE3, @@ -1641,6 +1642,15 @@ typedef enum state S_SPINFIRE5, S_SPINFIRE6, + // Elemental Shield's FLYING Spawn + S_AIRSPINFIRE_FLY1, + S_AIRSPINFIRE_FLY2, + S_AIRSPINFIRE_FLY3, + S_AIRSPINFIRE_FLY4, + S_AIRSPINFIRE_FLY5, + S_AIRSPINFIRE_FLY6, + S_AIRSPINFIRE_DIE, + // Spikes S_SPIKE1, S_SPIKE2, @@ -2250,6 +2260,8 @@ typedef enum state S_ELEMF6, S_ELEMF7, S_ELEMF8, + S_ELEMF9, + S_ELEMF10, S_PITY1, S_PITY2, @@ -3131,6 +3143,7 @@ typedef enum mobj_type MT_SPIKEBALL, // Spike Ball MT_SPECIALSPIKEBALL, MT_SPINFIRE, + MT_AIRSPINFIRE, // Elemental flame flying through the air MT_SPIKE, MT_STARPOST, MT_BIGMINE, diff --git a/src/lua_baselib.c b/src/lua_baselib.c index b478a8cf6..8846e2403 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -780,10 +780,11 @@ static int lib_pBlackOw(lua_State *L) static int lib_pElementalFireTrail(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + boolean cropcircle = lua_opttrueboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - P_ElementalFireTrail(player); + P_ElementalFireTrail(player, cropcircle); return 0; } diff --git a/src/p_inter.c b/src/p_inter.c index 9d6230cb2..c2e8561a2 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -237,6 +237,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { player_t *player; INT32 i; + boolean elementalpierce; if (objectplacing) return; @@ -291,6 +292,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; #endif + elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (player->pflags & PF_SHIELDABILITY)); + if (special->flags & MF_BOSS) { if (special->type == MT_BLACKEGGMAN) @@ -301,9 +304,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) || (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)) - || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? + || player->powers[pw_invulnerability] || player->powers[pw_super] + || elementalpierce) // Do you possess the ability to subdue the object? { - if (P_MobjFlip(toucher)*toucher->momz < 0) + if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) toucher->momz = -toucher->momz; toucher->momx = -toucher->momx; toucher->momy = -toucher->momy; @@ -330,7 +334,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) /////ENEMIES!!////////////////////////////////////////// //////////////////////////////////////////////////////// if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || player->powers[pw_invulnerability] || player->powers[pw_super]) + || player->powers[pw_invulnerability] || player->powers[pw_super] || elementalpierce) && toucher->z < special->z + special->height && toucher->z + toucher->height > special->z) { // Can only hit snapper from above @@ -346,7 +350,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)) || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? { - if (P_MobjFlip(toucher)*toucher->momz < 0) + if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) toucher->momz = -toucher->momz; P_DamageMobj(special, toucher, toucher, 1, 0); diff --git a/src/p_local.h b/src/p_local.h index 0f21b317e..26369d899 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -151,7 +151,7 @@ boolean P_AutoPause(void); void P_DoJumpShield(player_t *player); void P_BlackOw(player_t *player); -void P_ElementalFireTrail(player_t *player); +void P_ElementalFireTrail(player_t *player, boolean cropcircle); void P_DoPityCheck(player_t *player); void P_PlayerThink(player_t *player); diff --git a/src/p_map.c b/src/p_map.c index af7c4667e..468b46ea3 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -855,10 +855,10 @@ static boolean PIT_CheckThing(mobj_t *thing) { if (G_RingSlingerGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam)) { - if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super]) + if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super] || (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY))) && !thing->player->powers[pw_super]) P_DamageMobj(thing, tmthing, tmthing, 1, 0); - else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super]) + else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super] || (((thing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (thing->player->pflags & PF_SHIELDABILITY))) && !tmthing->player->powers[pw_super]) P_DamageMobj(tmthing, thing, thing, 1, 0); } @@ -942,11 +942,13 @@ static boolean PIT_CheckThing(mobj_t *thing) { SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed. fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;; + boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY)); P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor // Going down? Then bounce back up. if ((P_MobjWasRemoved(thing) // Monitor was removed || !thing->health) // or otherwise popped - && (flipval*(*momz) < 0)) // monitor is on the floor and you're going down, or on the ceiling and you're going up + && (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up + && !elementalpierce) // you're not piercing through the monitor... *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. return false; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 9b9fdea24..ab8071904 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2980,7 +2980,19 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; + + if (((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mo->player->pflags & PF_SHIELDABILITY)) // Elemental pierce attack. + { + if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound + S_StartSound(mo, sfx_s3k4c); + else // create a fire pattern on the ground + { + S_StartSound(mo, sfx_s3k47); + P_ElementalFireTrail(mo->player, true); + } + } mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); + //mo->player->pflags &= ~PF_GLIDING; mo->player->jumping = 0; mo->player->secondjump = 0; @@ -6456,6 +6468,16 @@ void P_MobjThinker(mobj_t *mobj) } else P_AddOverlay(mobj); + if ((mobj->target->type == MT_GREENORB) + && (mobj->target->target) + && (mobj->target->target->player) + && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + && (mobj->target->target->player->pflags & PF_SHIELDABILITY) + && (mobj->state->nextstate < mobj->target->info->painstate)) // Special casing for elemental shield piercing attack. + { + P_SetMobjState(mobj, mobj->target->info->painstate); + mobj->tics++; + } break; case MT_BLACKORB: case MT_WHITEORB: diff --git a/src/p_user.c b/src/p_user.c index 84eea16a0..e1a44cfd0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1347,6 +1347,8 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif + player->pflags &= ~PF_SHIELDABILITY; // Prevent edge cases when switching shields. + if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_BLUEORB; else switch (player->powers[pw_shield] & SH_NOSTACK) @@ -6198,7 +6200,7 @@ void P_BlackOw(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; } -void P_ElementalFireTrail(player_t *player) +void P_ElementalFireTrail(player_t *player, boolean cropcircle) { fixed_t newx; fixed_t newy; @@ -6216,40 +6218,61 @@ void P_ElementalFireTrail(player_t *player) else ground = player->mo->floorz; - travelangle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy); - - for (i = 0; i < 2; i++) + if (cropcircle) { - newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale)); - newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale)); -#ifdef ESLOPE - if (player->mo->standingslope) + travelangle = player->mo->angle + P_RandomRange(-ANGLE_45, ANGLE_45); +#define numangles 8 + for (i = 0; i < 8; i++) { - ground = P_GetZAt(player->mo->standingslope, newx, newy); - if (player->mo->eflags & MFE_VERTICALFLIP) - ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); + flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_AIRSPINFIRE); + P_SetTarget(&flame->target, player->mo); + flame->angle = travelangle + i*(ANGLE_MAX/numangles); + flame->destscale = player->mo->scale; + P_SetScale(flame, player->mo->scale); + flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); + P_InstaThrust(flame, flame->angle, FixedMul(3*FRACUNIT, flame->scale)); + P_SetObjectMomZ(flame, 3*FRACUNIT, false); } -#endif - flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); - P_SetTarget(&flame->target, player->mo); - flame->angle = travelangle; - flame->fuse = TICRATE*6; - flame->destscale = player->mo->scale; - P_SetScale(flame, player->mo->scale); - flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - - flame->momx = 8; - P_XYMovement(flame); - if (P_MobjWasRemoved(flame)) - continue; - - if (player->mo->eflags & MFE_VERTICALFLIP) +#undef numangles + } + else + { + travelangle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy); + for (i = 0; i < 2; i++) { - if (flame->z + flame->height < flame->ceilingz) + + newx = player->mo->x + P_ReturnThrustX(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); + newy = player->mo->y + P_ReturnThrustY(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); + +#ifdef ESLOPE + if (player->mo->standingslope) + { + ground = P_GetZAt(player->mo->standingslope, newx, newy); + if (player->mo->eflags & MFE_VERTICALFLIP) + ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); + } +#endif + flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); + P_SetTarget(&flame->target, player->mo); + flame->angle = travelangle; + // flame->fuse = TICRATE*6; // now done in spawnstate + flame->destscale = player->mo->scale; + P_SetScale(flame, player->mo->scale); + flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); + + flame->momx = 8; + P_XYMovement(flame); + if (P_MobjWasRemoved(flame)) + continue; + + if (player->mo->eflags & MFE_VERTICALFLIP) + { + if (flame->z + flame->height < flame->ceilingz) + P_RemoveMobj(flame); + } + else if (flame->z > flame->floorz) P_RemoveMobj(flame); } - else if (flame->z > flame->floorz) - P_RemoveMobj(flame); } } @@ -6789,7 +6812,7 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (player->pflags & PF_SPINNING) && player->speed > FixedMul(4<mo->scale) && onground && (leveltime & 1) && !(player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))) - P_ElementalFireTrail(player); + P_ElementalFireTrail(player, false); P_DoSpinDash(player, cmd); @@ -6897,9 +6920,24 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->homing = 2; - S_StartSound(player->mo, sfx_spdpad); if (P_LookForEnemies(player, false) && player->mo->tracer) + { + S_StartSound(player->mo, sfx_s3k40); player->homing = 3*TICRATE; + } + else + S_StartSound(player->mo, sfx_s3k41); + } + } + // Elemental shield activation + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + { + if (!(player->pflags & PF_THOKKED)) + { + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + S_StartSound(player->mo, sfx_s3k43); + player->mo->momx = player->mo->momy = 0; + P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); } } } From ec85357643952742365bd661ff25c6684a088fa7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 22:05:13 +0100 Subject: [PATCH 10/96] Didn't properly use the #defined numangles constant. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index e1a44cfd0..5579178d1 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6222,7 +6222,7 @@ void P_ElementalFireTrail(player_t *player, boolean cropcircle) { travelangle = player->mo->angle + P_RandomRange(-ANGLE_45, ANGLE_45); #define numangles 8 - for (i = 0; i < 8; i++) + for (i = 0; i < numangles; i++) { flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_AIRSPINFIRE); P_SetTarget(&flame->target, player->mo); From 940a58b5cad6e40c714e46527746fdf9d0ce2661 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 22:52:49 +0100 Subject: [PATCH 11/96] Shouldn't be true by default, WOOPS --- src/lua_baselib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 8846e2403..d34e319cb 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -780,7 +780,7 @@ static int lib_pBlackOw(lua_State *L) static int lib_pElementalFireTrail(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - boolean cropcircle = lua_opttrueboolean(L, 2); + boolean cropcircle = lua_optboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); From 0fefd86d1e0874dbe16b03da3515b82a9236a294 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 22:56:17 +0100 Subject: [PATCH 12/96] More generic name for P_ElementalFireTrail upon MI's request --- src/lua_baselib.c | 6 +++--- src/p_local.h | 2 +- src/p_mobj.c | 2 +- src/p_user.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index d34e319cb..745c9dcd3 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -777,14 +777,14 @@ static int lib_pBlackOw(lua_State *L) return 0; } -static int lib_pElementalFireTrail(lua_State *L) +static int lib_pElementalFire(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); boolean cropcircle = lua_optboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - P_ElementalFireTrail(player, cropcircle); + P_ElementalFire(player, cropcircle); return 0; } @@ -2038,7 +2038,7 @@ static luaL_Reg lib[] = { {"P_ResetScore",lib_pResetScore}, {"P_DoJumpShield",lib_pDoJumpShield}, {"P_BlackOw",lib_pBlackOw}, - {"P_ElementalFireTrail",lib_pElementalFireTrail}, + {"P_ElementalFire",lib_pElementalFire}, {"P_DoPlayerExit",lib_pDoPlayerExit}, {"P_InstaThrust",lib_pInstaThrust}, {"P_ReturnThrustX",lib_pReturnThrustX}, diff --git a/src/p_local.h b/src/p_local.h index 26369d899..05d1a4823 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -151,7 +151,7 @@ boolean P_AutoPause(void); void P_DoJumpShield(player_t *player); void P_BlackOw(player_t *player); -void P_ElementalFireTrail(player_t *player, boolean cropcircle); +void P_ElementalFire(player_t *player, boolean cropcircle); void P_DoPityCheck(player_t *player); void P_PlayerThink(player_t *player); diff --git a/src/p_mobj.c b/src/p_mobj.c index ab8071904..13dd15d21 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2988,7 +2988,7 @@ static void P_PlayerZMovement(mobj_t *mo) else // create a fire pattern on the ground { S_StartSound(mo, sfx_s3k47); - P_ElementalFireTrail(mo->player, true); + P_ElementalFire(mo->player, true); } } mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); diff --git a/src/p_user.c b/src/p_user.c index 5579178d1..75c70135a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6200,7 +6200,7 @@ void P_BlackOw(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; } -void P_ElementalFireTrail(player_t *player, boolean cropcircle) +void P_ElementalFire(player_t *player, boolean cropcircle) { fixed_t newx; fixed_t newy; @@ -6812,7 +6812,7 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (player->pflags & PF_SPINNING) && player->speed > FixedMul(4<mo->scale) && onground && (leveltime & 1) && !(player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))) - P_ElementalFireTrail(player, false); + P_ElementalFire(player, false); P_DoSpinDash(player, cmd); From ad03bb52786fbfe1661976a3bd75bc29ae61d77d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 23 Jul 2016 18:25:51 +0100 Subject: [PATCH 13/96] Force Shield's air ability is now the Drop Dash (thanks, Sonic Mania, for making me like the momentum redirection idea by recontextualising it to collision with the ground only!) * Press spin in midair to make the shield flash solid repeatedly and make a number of ding noises. * When the player with a flashing, dinging shield hits the ground, they are sent off in spinning form at the maximum of 2*abs(momz) VS the 3D hypotenuse of momx, momy, and momz. --- src/p_mobj.c | 43 +++++++++++++++++++++++++++++++++++-------- src/p_user.c | 9 +++++++++ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 13dd15d21..fd4583891 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2981,14 +2981,25 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; - if (((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mo->player->pflags & PF_SHIELDABILITY)) // Elemental pierce attack. + if (mo->player->pflags & PF_SHIELDABILITY) { - if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound - S_StartSound(mo, sfx_s3k4c); - else // create a fire pattern on the ground + if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) // Elemental shield's stomp attack. { - S_StartSound(mo, sfx_s3k47); - P_ElementalFire(mo->player, true); + if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound + S_StartSound(mo, sfx_s3k4c); + else // create a fire pattern on the ground + { + S_StartSound(mo, sfx_s3k47); + P_ElementalFire(mo->player, true); + } + } + if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash. + { + fixed_t magnitude = max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2); // vertical momentum is amplified here, since otherwise this was kind of weak. + P_InstaThrust(mo, mo->angle, magnitude); + S_StartSound(mo, sfx_zoom); + mo->player->pflags |= PF_SPINNING; + P_SetPlayerMobjState(mo, S_PLAY_SPIN); } } mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); @@ -6482,7 +6493,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: - case MT_BLUEORB: case MT_PITYORB: if (!P_AddShield(mobj)) return; @@ -6490,9 +6500,26 @@ void P_MobjThinker(mobj_t *mobj) case MT_YELLOWORB: if (!P_AddShield(mobj)) return; - if (mobj->target->player->homing) + if ((mobj->target) + && (mobj->target->player) + && (mobj->target->player->homing)) P_SetMobjState(mobj, mobj->info->painstate); break; + case MT_BLUEORB: + if (!P_AddShield(mobj)) + return; + if ((mobj->target) + && (mobj->target->player) + && (mobj->target->player->pflags & PF_SHIELDABILITY)) + { + mobj->frame &= ~FF_TRANSMASK; + if (!(leveltime & 15)) + { + S_StopSound(mobj->target); + S_StartSound(mobj->target, sfx_ding); + } + } + break; case MT_WATERDROP: P_SceneryCheckWater(mobj); if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop) diff --git a/src/p_user.c b/src/p_user.c index 75c70135a..2d957aec3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6940,6 +6940,15 @@ static void P_MovePlayer(player_t *player) P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); } } + // Force shield activation + if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE) + { + if (!(player->pflags & PF_THOKKED)) + { + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + S_StartSound(player->mo, sfx_ding); + } + } } // Super Sonic move if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) From d0bb7293bd73c8a0ea4653fad3fb2ed2e6768a11 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 23 Jul 2016 21:01:40 +0100 Subject: [PATCH 14/96] Maximum Drop Dash speed of 75*FRACUNIT. --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index fd4583891..86ff3259a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2995,7 +2995,7 @@ static void P_PlayerZMovement(mobj_t *mo) } if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash. { - fixed_t magnitude = max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2); // vertical momentum is amplified here, since otherwise this was kind of weak. + fixed_t magnitude = min(max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2), 75<angle, magnitude); S_StartSound(mo, sfx_zoom); mo->player->pflags |= PF_SPINNING; From 436dfbb24f6eb41586641f90f3c4a355c480c6a3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 23 Jul 2016 21:37:32 +0100 Subject: [PATCH 15/96] Crashed in THZ1 when testing going down the long section at the end, EIP blames this line, wasn't really necessary in the first place... fair enough. --- src/p_mobj.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 86ff3259a..138455604 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6515,7 +6515,6 @@ void P_MobjThinker(mobj_t *mobj) mobj->frame &= ~FF_TRANSMASK; if (!(leveltime & 15)) { - S_StopSound(mobj->target); S_StartSound(mobj->target, sfx_ding); } } From f34a28e80e71cd783648d00463dfc9a74ef3508a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 21 Aug 2016 13:55:16 +0100 Subject: [PATCH 16/96] Removed a hack that caused the groundpound spinfire to hurt you if you lost your shield. --- src/dehacked.c | 10 ---------- src/doomdef.h | 2 +- src/info.c | 39 +-------------------------------------- src/info.h | 11 ----------- src/p_mobj.c | 24 ++++++++++++++++++++---- src/p_user.c | 6 ++++-- 6 files changed, 26 insertions(+), 66 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 1afa5f0cf..8fb0e8df7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4783,7 +4783,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPIKEBALL8", // Elemental Shield's Spawn - "S_SPINFIRE0", "S_SPINFIRE1", "S_SPINFIRE2", "S_SPINFIRE3", @@ -4791,15 +4790,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPINFIRE5", "S_SPINFIRE6", - // Elemental Shield's FLYING Spawn - "S_AIRSPINFIRE_FLY1", - "S_AIRSPINFIRE_FLY2", - "S_AIRSPINFIRE_FLY3", - "S_AIRSPINFIRE_FLY4", - "S_AIRSPINFIRE_FLY5", - "S_AIRSPINFIRE_FLY6", - "S_AIRSPINFIRE_DIE", - // Spikes "S_SPIKE1", "S_SPIKE2", diff --git a/src/doomdef.h b/src/doomdef.h index 70ec8c0d1..77c0a9800 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -158,7 +158,7 @@ extern FILE *logstream; // Does this version require an added patch file? // Comment or uncomment this as necessary. -//#define USE_PATCH_DTA +#define USE_PATCH_DTA // Modification options // If you want to take advantage of the Master Server's ability to force clients to update diff --git a/src/info.c b/src/info.c index f946e72e8..484ab321d 100644 --- a/src/info.c +++ b/src/info.c @@ -1124,7 +1124,6 @@ state_t states[NUMSTATES] = {SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8 // Elemental Shield's Spawn - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {A_SetFuse}, 6*TICRATE, 0, S_SPINFIRE1}, // S_SPINFIRE0 {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 @@ -1132,15 +1131,6 @@ state_t states[NUMSTATES] = {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 - // Elemental Shield's FLYING Spawn - {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY2}, //S_AIRSPINFIRE_FLY1, - {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY3}, //S_AIRSPINFIRE_FLY2, - {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY4}, //S_AIRSPINFIRE_FLY3, - {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY5}, //S_AIRSPINFIRE_FLY4, - {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY6}, //S_AIRSPINFIRE_FLY5, - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY1}, //S_AIRSPINFIRE_FLY6, - {SPR_SFLM, FF_FULLBRIGHT, 0, {A_SpawnObjectRelative}, 0, MT_SPINFIRE, S_NULL}, //S_AIRSPINFIRE_DIE, - // Floor Spike {SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended {SPR_USPK, 5, 2, {A_Pain}, 0, 0, S_SPIKE3}, // S_SPIKE2 @@ -5404,7 +5394,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPINFIRE -1, // doomednum - S_SPINFIRE0, // spawnstate + S_SPINFIRE1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -5429,33 +5419,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_AIRSPINFIRE - -1, // doomednum - S_AIRSPINFIRE_FLY1, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_AIRSPINFIRE_DIE, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 10*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 1, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_FIRE, // flags - S_NULL // raisestate - }, - { // MT_SPIKE 523, // doomednum S_SPIKE1, // spawnstate diff --git a/src/info.h b/src/info.h index 8a56ef77e..2460f6fbc 100644 --- a/src/info.h +++ b/src/info.h @@ -1634,7 +1634,6 @@ typedef enum state S_SPIKEBALL8, // Elemental Shield's Spawn - S_SPINFIRE0, S_SPINFIRE1, S_SPINFIRE2, S_SPINFIRE3, @@ -1642,15 +1641,6 @@ typedef enum state S_SPINFIRE5, S_SPINFIRE6, - // Elemental Shield's FLYING Spawn - S_AIRSPINFIRE_FLY1, - S_AIRSPINFIRE_FLY2, - S_AIRSPINFIRE_FLY3, - S_AIRSPINFIRE_FLY4, - S_AIRSPINFIRE_FLY5, - S_AIRSPINFIRE_FLY6, - S_AIRSPINFIRE_DIE, - // Spikes S_SPIKE1, S_SPIKE2, @@ -3143,7 +3133,6 @@ typedef enum mobj_type MT_SPIKEBALL, // Spike Ball MT_SPECIALSPIKEBALL, MT_SPINFIRE, - MT_AIRSPINFIRE, // Elemental flame flying through the air MT_SPIKE, MT_STARPOST, MT_BIGMINE, diff --git a/src/p_mobj.c b/src/p_mobj.c index 138455604..5ce06f90b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2377,6 +2377,19 @@ static boolean P_ZMovement(mobj_t *mo) mo->flags |= MF_NOGRAVITY; } break; + case MT_SPINFIRE: + if (P_CheckDeathPitCollide(mo)) + { + P_RemoveMobj(mo); + return false; + } + if (mo->z <= mo->floorz && mo->momz) + { + mo->flags |= MF_NOGRAVITY; + mo->momx = mo->momy = mo->momz = 0; + mo->z = mo->floorz; + } + break; case MT_GOOP: if (P_CheckDeathPitCollide(mo)) { @@ -7338,10 +7351,13 @@ void P_MobjThinker(mobj_t *mobj) #endif break; case MT_SPINFIRE: - if (mobj->eflags & MFE_VERTICALFLIP) - mobj->z = mobj->ceilingz - mobj->height; - else - mobj->z = mobj->floorz; + if (mobj->flags & MF_NOGRAVITY) + { + if (mobj->eflags & MFE_VERTICALFLIP) + mobj->z = mobj->ceilingz - mobj->height; + else + mobj->z = mobj->floorz; + } // THERE IS NO BREAK HERE ON PURPOSE default: // check mobj against possible water content, before movement code diff --git a/src/p_user.c b/src/p_user.c index 2d957aec3..99eef15ae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6224,9 +6224,11 @@ void P_ElementalFire(player_t *player, boolean cropcircle) #define numangles 8 for (i = 0; i < numangles; i++) { - flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_AIRSPINFIRE); + flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_SPINFIRE); + flame->flags &= ~MF_NOGRAVITY; P_SetTarget(&flame->target, player->mo); flame->angle = travelangle + i*(ANGLE_MAX/numangles); + flame->fuse = TICRATE*7; // takes about an extra second to hit the ground flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); @@ -6255,7 +6257,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); P_SetTarget(&flame->target, player->mo); flame->angle = travelangle; - // flame->fuse = TICRATE*6; // now done in spawnstate + flame->fuse = TICRATE*6; flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); From dc3be7b8a199019ed29c0b0164c89e0d2dde1bfa Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 21 Aug 2016 15:42:09 +0100 Subject: [PATCH 17/96] Removing now-irrelevant whitespace and cleaning up the last of the hack. --- src/info.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/info.c b/src/info.c index 484ab321d..cc635c038 100644 --- a/src/info.c +++ b/src/info.c @@ -1124,12 +1124,12 @@ state_t states[NUMSTATES] = {SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8 // Elemental Shield's Spawn - {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 - {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 - {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 - {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 - {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 + {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 + {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 + {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 + {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 + {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 // Floor Spike {SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended @@ -5415,7 +5415,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE|MF_RUNSPAWNFUNC, // flags + MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags S_NULL // raisestate }, From 9a2dd50e4dee99515d6b1e37ee3085214aa4f2f2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 27 Sep 2016 19:03:57 +0100 Subject: [PATCH 18/96] ...I should really check what I'm doing more thoroughly, sorry. --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 0f0a7e570..37b684016 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3223,7 +3223,7 @@ static void P_PlayerZMovement(mobj_t *mo) P_SetPlayerMobjState(mo, S_PLAY_SPIN); } } - mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); + mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; mo->player->secondjump = 0; mo->player->glidetime = 0; From 35dda1cd72a17d35ee29ee91e6646b3399da4660 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 20:02:58 +0100 Subject: [PATCH 19/96] Replaced the Force Shield's shitty drop dash I coded with a much more interesting and experimental ability. * The Dodge Dash * Allows you to dash - no control, no falling, no key response - for 2 + (number of extra shield hitpoints) tics. * If you're holding movement keys down, you dash in the direction you're holding - otherwise, you dash directly forward. * You're spinning (spindash spin, not jump spin) until your dash is over, then your momentum is cut down significantly and you end up in falling frames. * It may not necessarily be super useful for Sonic, but it helps the other characters. * http://gfycat.com/BogusFailingFritillarybutterfly * http://gfycat.com/PoliticalIdealisticBallpython (outdated speed, shows any direction) --- src/p_mobj.c | 24 +++--------------------- src/p_user.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 37b684016..7092e7d81 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3214,14 +3214,6 @@ static void P_PlayerZMovement(mobj_t *mo) P_ElementalFire(mo->player, true); } } - else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash. - { - fixed_t magnitude = min(max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2), 75<angle, magnitude); - S_StartSound(mo, sfx_zoom); - mo->player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(mo, S_PLAY_SPIN); - } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; @@ -6713,6 +6705,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: + case MT_BLUEORB: case MT_PITYORB: if (!P_AddShield(mobj)) return; @@ -6723,20 +6716,9 @@ void P_MobjThinker(mobj_t *mobj) if ((mobj->target) && (mobj->target->player) && (mobj->target->player->homing)) - P_SetMobjState(mobj, mobj->info->painstate); - break; - case MT_BLUEORB: - if (!P_AddShield(mobj)) - return; - if ((mobj->target) - && (mobj->target->player) - && (mobj->target->player->pflags & PF_SHIELDABILITY)) { - mobj->frame &= ~FF_TRANSMASK; - if (!(leveltime & 15)) - { - S_StartSound(mobj->target, sfx_ding); - } + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; } break; case MT_WATERDROP: diff --git a/src/p_user.c b/src/p_user.c index 405fa67b6..409ee9b45 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -867,6 +867,15 @@ 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) { + if (player->mo + && (player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + && player->pflags & PF_SHIELDABILITY) + { + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + player->mo->flags &= ~MF_NOGRAVITY; + player->pflags &= ~PF_FULLSTASIS; + } + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; @@ -3835,7 +3844,7 @@ void P_DoJumpShield(player_t *player) player->pflags &= ~PF_JUMPED; player->secondjump = 0; player->jumping = 0; - player->pflags |= PF_THOKKED; + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->pflags &= ~PF_SPINNING; P_SetPlayerMobjState(player->mo, S_PLAY_FALL); S_StartSound(player->mo, sfx_wdjump); @@ -6930,8 +6939,21 @@ static void P_MovePlayer(player_t *player) { if (!(player->pflags & PF_THOKKED)) { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - S_StartSound(player->mo, sfx_ding); + angle_t dashangle = player->mo->angle; + if (player->cmd.forwardmove || player->cmd.sidemove) + { + dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<homing = 2; + if ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE) + player->homing++; + S_StartSound(player->mo, sfx_s3k47); + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; + player->mo->flags |= MF_NOGRAVITY; + P_InstaThrust(player->mo, dashangle, 64*FRACUNIT); + player->mo->momz = 0; } } } @@ -6950,7 +6972,25 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + && player->pflags & PF_SHIELDABILITY) + { + if (player->homing) + { + player->pflags |= PF_FULLSTASIS; + player->mo->momz = 0; + if (!(player->pflags & PF_SPINNING)) + player->homing = 0; + } + + if (player->homing == 0) + { + P_ResetPlayer(player); + player->mo->momx >>= 3; + player->mo->momy >>= 3; + } + } + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT // Sonic 3D Blast. && player->pflags & PF_SHIELDABILITY) { if (player->homing && player->mo->tracer) @@ -6969,7 +7009,7 @@ static void P_MovePlayer(player_t *player) if (!(player->pflags & PF_JUMPED)) player->homing = 0; } - else if (player->charability == CA_HOMINGTHOK) + else if (player->charability == CA_HOMINGTHOK) // Sonic Adventure. { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) @@ -9185,7 +9225,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) + if ((player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) || ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE && player->pflags & PF_SHIELDABILITY)) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; From accd8bc5bd7f1e58f343b1945155de9e69728be2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 20:36:08 +0100 Subject: [PATCH 20/96] Minor fixes. Notably - no longer "deletes gravity" when hitting a slope mid-dash. --- src/p_mobj.c | 5 +++++ src/p_user.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 7092e7d81..dcc2ff18b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3214,6 +3214,11 @@ static void P_PlayerZMovement(mobj_t *mo) P_ElementalFire(mo->player, true); } } + else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. + { + mo->flags &= ~MF_NOGRAVITY; + mo->player->pflags &= ~PF_FULLSTASIS; + } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; diff --git a/src/p_user.c b/src/p_user.c index 409ee9b45..a00c76b79 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6945,9 +6945,7 @@ static void P_MovePlayer(player_t *player) dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<homing = 2; - if ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE) - player->homing++; + player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); S_StartSound(player->mo, sfx_s3k47); P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; From 34d56561e46ab7715fddbf43da86cb50d2567b9a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 20:44:05 +0100 Subject: [PATCH 21/96] Fixed MORE problems with landing on slopes. --- src/p_mobj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index dcc2ff18b..dcc18587d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3216,8 +3216,11 @@ static void P_PlayerZMovement(mobj_t *mo) } else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. { + P_SetPlayerMobjState(mo, S_PLAY_WALK); mo->flags &= ~MF_NOGRAVITY; - mo->player->pflags &= ~PF_FULLSTASIS; + mo->player->pflags &= ~(PF_FULLSTASIS|PF_SPINNING); + mo->momx >>= 3; + mo->momy >>= 3; } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); From 3eb3caacd54432df4140465ebeac94a2374825f0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 21:25:15 +0100 Subject: [PATCH 22/96] Tweaked the elemental shield's piercing ability. Specifically: * The spinfire ring is now capable of damaging enemies. (god, what a terrible hack this is) * When ground pounding, you now bounce off the floor a little bit to make the ability less spammable. --- src/p_mobj.c | 28 ++++++++++++++++++++-------- src/p_user.c | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index dcc18587d..ede8b4b63 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2579,11 +2579,15 @@ static boolean P_ZMovement(mobj_t *mo) P_RemoveMobj(mo); return false; } - if (mo->z <= mo->floorz && mo->momz) + if (mo->momz + && !(mo->flags & MF_NOGRAVITY) + && ((!(mo->eflags & MFE_VERTICALFLIP) && mo->z <= mo->floorz) + || ((mo->eflags & MFE_VERTICALFLIP) && mo->z+mo->height >= mo->ceilingz))) { mo->flags |= MF_NOGRAVITY; - mo->momx = mo->momy = mo->momz = 0; - mo->z = mo->floorz; + mo->momx = 8; // this is a hack which is used to ensure it still behaves as a missile and can damage others + mo->momy = mo->momz = 0; + mo->z = ((mo->eflags & MFE_VERTICALFLIP) ? mo->ceilingz-mo->height : mo->floorz); } break; case MT_GOOP: @@ -3071,6 +3075,8 @@ static void P_PlayerZMovement(mobj_t *mo) if (P_MobjFlip(mo)*mo->momz < 0) // falling { + boolean clipmomz = true; + mo->pmomz = 0; // We're on a new floor, don't keep doing platform movement. // Squat down. Decrease viewheight for a moment after hitting the ground (hard), @@ -3213,6 +3219,9 @@ static void P_PlayerZMovement(mobj_t *mo) S_StartSound(mo, sfx_s3k47); P_ElementalFire(mo->player, true); } + P_SetObjectMomZ(mo, 5*FRACUNIT/2, false); + P_SetPlayerMobjState(mo, S_PLAY_FALL); + clipmomz = false; } else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. { @@ -3234,11 +3243,14 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_SPINNING)) mo->player->pflags &= ~PF_STARTDASH; - if (tmfloorthing && (tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR) - || tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER)) - mo->momz = tmfloorthing->momz; - else if (!tmfloorthing) - mo->momz = 0; + if (clipmomz) + { + if (tmfloorthing && (tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR) + || tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER)) + mo->momz = tmfloorthing->momz; + else if (!tmfloorthing) + mo->momz = 0; + } } else if (tmfloorthing && (tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR) || tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER)) diff --git a/src/p_user.c b/src/p_user.c index a00c76b79..58af55fe5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6244,7 +6244,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) P_SetScale(flame, player->mo->scale); flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - flame->momx = 8; + flame->momx = 8; // this is a hack which is used to ensure it still behaves as a missile and can damage others P_XYMovement(flame); if (P_MobjWasRemoved(flame)) continue; From d6a404e1efdd1f187b1d801af32093843712036c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 00:34:17 +0100 Subject: [PATCH 23/96] * On Mystic's reccomendation - an alternate method which has the direction to shoot off based on the direction you're moving, not the direction you're holding. * When not pressing any direction, you now go backwards by default - to emphasise that this is primarily for defensive, not offensive, purposes. * The camera can now handle the player going backwards without them going completely off-screen. * Fixed some overzealous checks. --- src/p_mobj.c | 2 +- src/p_user.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ede8b4b63..1df1541e9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3223,7 +3223,7 @@ static void P_PlayerZMovement(mobj_t *mo) P_SetPlayerMobjState(mo, S_PLAY_FALL); clipmomz = false; } - else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. + else if (mo->player->powers[pw_shield] & SH_FORCE) // Force shield's dodge dash. { P_SetPlayerMobjState(mo, S_PLAY_WALK); mo->flags &= ~MF_NOGRAVITY; diff --git a/src/p_user.c b/src/p_user.c index 58af55fe5..369e6112e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -868,7 +868,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) void P_ResetPlayer(player_t *player) { if (player->mo - && (player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + && player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) { P_SetPlayerMobjState(player->mo, S_PLAY_FALL); @@ -6935,17 +6935,22 @@ static void P_MovePlayer(player_t *player) } } // Force shield activation - if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE) + if (player->powers[pw_shield] & SH_FORCE) { if (!(player->pflags & PF_THOKKED)) { angle_t dashangle = player->mo->angle; - if (player->cmd.forwardmove || player->cmd.sidemove) - { +#if 1 // shadow.wad style redirection - hold down directional keys to set your path, go backwards by default + if (!(player->pflags & PF_ANALOGMODE) && (player->cmd.forwardmove || player->cmd.sidemove)) dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<mo->momx || player->mo->momy) + dashangle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); +#endif + dashangle += ANGLE_180; P_ResetPlayer(player); - player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); + player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); // might get ridiculous with 256 hitpoints, don't you think? S_StartSound(player->mo, sfx_s3k47); P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; @@ -6970,7 +6975,7 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + if (player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) { if (player->homing) @@ -8073,6 +8078,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); } + if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) + camspeed <<= 1; + #ifdef REDSANALOG if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) { camstill = true; @@ -9223,7 +9231,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if ((player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) || ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE && player->pflags & PF_SHIELDABILITY)) + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; From 011af0daff10856faa6aeccb533377c46a010e19 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 12:15:22 +0100 Subject: [PATCH 24/96] Tweaks to some sections of the code that recognise what shields the player has. Specifically: * introducing the new friend, SH_FORCEHP (which is used as a bitmask to get the extra hitpoints of a force-shield user) * P_DamageMobj now considers the unimplemented shield constants as well as the implemented ones. --- src/d_player.h | 1 + src/p_inter.c | 14 +++++++++++--- src/p_mobj.c | 4 ++-- src/p_user.c | 4 ++-- src/st_stuff.c | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index e80ac387c..c24990eb5 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -196,6 +196,7 @@ typedef enum SH_FIREFLOWER = 0x100, // The force shield uses the lower 8 bits to count how many hits are left. SH_FORCE = 0x200, + SH_FORCEHP = 0xFF, // to be used as a bitmask only SH_STACK = SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK diff --git a/src/p_inter.c b/src/p_inter.c index ece8f25e1..c6f7bb310 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2972,20 +2972,28 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)) return false; +#define shieldtype (player->powers[pw_shield] & SH_NOSTACK) switch (damagetype) { case DMG_WATER: + if (shieldtype == SH_BUBBLEWRAP + || shieldtype == SH_ELEMENTAL) + return false; // Invincible to water damage + break; case DMG_FIRE: - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - return false; // Invincible to water/fire damage + if (shieldtype == SH_FLAMEAURA + || shieldtype == SH_ELEMENTAL) + return false; // Invincible to fire damage break; case DMG_ELECTRIC: - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + if (shieldtype == SH_ATTRACT + || shieldtype == SH_THUNDERCOIN) return false; // Invincible to electric damage break; default: break; } +#undef shieldtype } if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling diff --git a/src/p_mobj.c b/src/p_mobj.c index 1df1541e9..e40fce499 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6326,9 +6326,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return false; } - if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & 0xFF)) + if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP)) { - thing->movecount = (thing->target->player->powers[pw_shield] & 0xFF); + thing->movecount = (thing->target->player->powers[pw_shield] & SH_FORCEHP); if (thing->movecount < 1) { if (thing->info->painstate) diff --git a/src/p_user.c b/src/p_user.c index 369e6112e..ca6bb9632 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1392,7 +1392,7 @@ void P_SpawnShieldOrb(player_t *player) if (player->powers[pw_shield] & SH_FORCE) { //Copy and pasted from P_ShieldLook in p_mobj.c - shieldobj->movecount = (player->powers[pw_shield] & 0xFF); + shieldobj->movecount = (player->powers[pw_shield] & SH_FORCEHP); if (shieldobj->movecount < 1) { if (shieldobj->info->painstate) @@ -6950,7 +6950,7 @@ static void P_MovePlayer(player_t *player) #endif dashangle += ANGLE_180; P_ResetPlayer(player); - player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); // might get ridiculous with 256 hitpoints, don't you think? + player->homing = 2 + (player->powers[pw_shield] & SH_FORCEHP); // might get ridiculous with 256 hitpoints, don't you think? S_StartSound(player->mo, sfx_s3k47); P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; diff --git a/src/st_stuff.c b/src/st_stuff.c index 43d2bd176..8f36d5128 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -800,7 +800,7 @@ static void ST_drawFirstPersonHUD(void) // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right if (player->powers[pw_shield] & SH_FORCE) { - if ((player->powers[pw_shield] & 0xFF) > 0 || leveltime & 1) + if ((player->powers[pw_shield] & SH_FORCEHP) > 0 || leveltime & 1) p = forceshield; } else switch (player->powers[pw_shield] & SH_NOSTACK) From f1fb276e5ac9f91efdd65a7db245aaad83780ca8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 13:48:33 +0100 Subject: [PATCH 25/96] Fixed a bug where using your shield ability just before your shield changed got you stuck in whatever state it left you. To do that, P_SwitchShield was born! Don't use with Force. --- src/p_enemy.c | 37 +++++++++++++++---------------------- src/p_local.h | 1 + src/p_user.c | 24 ++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 4c4fa5857..bbdc22116 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3058,11 +3058,7 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_JUMP) - { - player->powers[pw_shield] = SH_JUMP|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_JUMP); S_StartSound(player->mo, actor->info->seesound); } @@ -3090,11 +3086,7 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT) - { - player->powers[pw_shield] = SH_ATTRACT|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_ATTRACT); S_StartSound(player->mo, actor->info->seesound); } @@ -3296,8 +3288,8 @@ void A_BombShield(mobj_t *actor) P_BlackOw(player); // Now we know for certain that we don't have a bomb shield, so add one. :3 - player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); + P_SwitchShield(player, SH_BOMB); + S_StartSound(player->mo, actor->info->seesound); } @@ -3324,11 +3316,7 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL) - { - player->powers[pw_shield] = SH_ELEMENTAL|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_ELEMENTAL); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) P_RestoreMusic(player); @@ -3366,8 +3354,17 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; + //can't use P_SwitchShield(player, SH_FORCE) - special case + if (!(player->powers[pw_shield] & SH_FORCE)) { + // Just in case. + if (player->pflags & PF_SHIELDABILITY) + { + player->pflags &= ~PF_SHIELDABILITY; + player->homing = 0; + } + player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; P_SpawnShieldOrb(player); } @@ -3404,11 +3401,7 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY) - { - player->powers[pw_shield] = SH_PITY+(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_PITY); S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_local.h b/src/p_local.h index 3541a3fb0..e64a8dd43 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -142,6 +142,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); +void P_SwitchShield(player_t *player, UINT16 shieldtype); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerLives(player_t *player, INT32 numlives); diff --git a/src/p_user.c b/src/p_user.c index 3f7610add..47e59c211 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1403,6 +1403,30 @@ void P_SpawnShieldOrb(player_t *player) } } +void P_SwitchShield(player_t *player, UINT16 shieldtype) +{ + if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) + { + // Just in case. + if (player->pflags & PF_SHIELDABILITY) + { + player->pflags &= ~PF_SPINNING|PF_SHIELDABILITY; // They'll still have PF_THOKKED... + player->homing = 0; + if (player->powers[pw_shield] & SH_FORCE) // Dash. + { + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + player->mo->flags &= ~MF_NOGRAVITY; + player->pflags &= ~PF_FULLSTASIS; + player->mo->momx >>= 3; + player->mo->momy >>= 3; + } + } + + player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); + P_SpawnShieldOrb(player); + } +} + // // P_SpawnGhostMobj // From cbe703478cc484357f84d7a6dfff2384cd6ec559 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 13:56:19 +0100 Subject: [PATCH 26/96] Fixed another bug where you were able to use the whirlwind shield ability after using the force shield's dodge dash. --- src/p_user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 47e59c211..2deeaf029 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -867,6 +867,8 @@ 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) { + pflags_t removelist = (PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + if (player->mo && player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) @@ -874,9 +876,10 @@ void P_ResetPlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_FALL); player->mo->flags &= ~MF_NOGRAVITY; player->pflags &= ~PF_FULLSTASIS; + removelist &= ~PF_THOKKED; } - player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + player->pflags &= ~removelist; player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; From dc57a34213cb8eb6d63778e1092e93943fb99d92 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:06:53 +0100 Subject: [PATCH 27/96] Revert "Fixed another bug where you were able to use the whirlwind shield ability after using the force shield's dodge dash." This reverts commit cbe703478cc484357f84d7a6dfff2384cd6ec559. --- src/p_user.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 2deeaf029..47e59c211 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -867,8 +867,6 @@ 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) { - pflags_t removelist = (PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); - if (player->mo && player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) @@ -876,10 +874,9 @@ void P_ResetPlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_FALL); player->mo->flags &= ~MF_NOGRAVITY; player->pflags &= ~PF_FULLSTASIS; - removelist &= ~PF_THOKKED; } - player->pflags &= ~removelist; + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; From 4f79157a50404fc0ad4ca5b6738963fc56bdb6ba Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:12:26 +0100 Subject: [PATCH 28/96] Fixed that bug the wrong way, THIS is a much better solution for what I wanted to tweak. --- src/p_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_user.c b/src/p_user.c index 47e59c211..280b0d489 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7013,6 +7013,7 @@ static void P_MovePlayer(player_t *player) if (player->homing == 0) { P_ResetPlayer(player); + player->pflags |= PF_THOKKED; // silly silly player->mo->momx >>= 3; player->mo->momy >>= 3; } From aa4fca0339252d60cc9d22d54caf9e6ceb74a482 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:18:13 +0100 Subject: [PATCH 29/96] Added description to P_SwitchShield. --- src/p_user.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 280b0d489..4ff39a181 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1403,6 +1403,15 @@ void P_SpawnShieldOrb(player_t *player) } } +// +// P_SwitchShield +// +// Handles the possibility of switching +// between shields thoroughly, then +// adds the desired one. +// +// Not for use if shieldtype would be SH_FORCE. +// void P_SwitchShield(player_t *player, UINT16 shieldtype) { if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) From a694ebc348eea2f8bae33ce42d0827c9ce916530 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:33:15 +0100 Subject: [PATCH 30/96] Fixed issue where holding spin when going into a non-horizontal spring would use your whirlwind shield ability immediately. --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 4ff39a181..3659b1e92 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3952,7 +3952,8 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) else if (onground || player->climbing || (player->mo->tracer && player->powers[pw_carry])) {} else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP - && !(player->pflags & PF_JUMPED)) + && !(player->pflags & PF_JUMPED) + && !(player->pflags & PF_USEDOWN)) P_DoJumpShield(player); else if (!(player->pflags & PF_SLIDING) && ((gametype != GT_CTF) || (!player->gotflag))) { From 64a1fa54219c9fa2e2fa61fb2b2b68e4fe67f6ce Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 11 Oct 2016 23:35:31 +0100 Subject: [PATCH 31/96] Players are half height in Mario mode when they don't have any shields, the Mario mode pity shield is invisible, and Mario mode players immediately get a pity shield when they lose any other type of shield. So basically that's a Red Mushroom, right? https://gfycat.com/ThoughtfulAcademicChrysalis --- src/d_player.h | 10 +++++----- src/p_enemy.c | 28 ++++++++++++++++------------ src/p_inter.c | 5 ++++- src/p_local.h | 8 +++++--- src/p_user.c | 6 ++++-- src/r_things.c | 13 ++++++++++++- 6 files changed, 46 insertions(+), 24 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index c24990eb5..91520293d 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -192,12 +192,12 @@ typedef enum SH_FLAMEAURA, // Pity shield: the world's most basic shield ever, given to players who suck at Match SH_PITY, - // The fireflower is special, it combines with other shields. - SH_FIREFLOWER = 0x100, - // The force shield uses the lower 8 bits to count how many hits are left. - SH_FORCE = 0x200, + // The force shield uses the lower 8 bits to count how many extra hits are left. + SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - + // The fireflower is special... + SH_FIREFLOWER = 0x200, + // ...it can combine with other shields. SH_STACK = SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/p_enemy.c b/src/p_enemy.c index 5ab83b4a8..80372ce5f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3058,9 +3058,9 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - P_SwitchShield(player, SH_JUMP); - S_StartSound(player->mo, actor->info->seesound); + + P_SwitchShield(player, SH_JUMP); } // Function: A_RingShield @@ -3086,9 +3086,9 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - P_SwitchShield(player, SH_ATTRACT); - S_StartSound(player->mo, actor->info->seesound); + + P_SwitchShield(player, SH_ATTRACT); } // Function: A_RingBox @@ -3287,10 +3287,10 @@ void A_BombShield(mobj_t *actor) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) P_BlackOw(player); + S_StartSound(player->mo, actor->info->seesound); + // Now we know for certain that we don't have a bomb shield, so add one. :3 P_SwitchShield(player, SH_BOMB); - - S_StartSound(player->mo, actor->info->seesound); } // Function: A_WaterShield @@ -3316,6 +3316,8 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; + S_StartSound(player->mo, actor->info->seesound); + P_SwitchShield(player, SH_ELEMENTAL); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) @@ -3328,7 +3330,6 @@ void A_WaterShield(mobj_t *actor) player->powers[pw_spacetime] = 0; P_RestoreMusic(player); } - S_StartSound(player->mo, actor->info->seesound); } // Function: A_ForceShield @@ -3354,6 +3355,8 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; + S_StartSound(player->mo, actor->info->seesound); + //can't use P_SwitchShield(player, SH_FORCE) - special case if (!(player->powers[pw_shield] & SH_FORCE)) @@ -3370,8 +3373,6 @@ void A_ForceShield(mobj_t *actor) } else player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; - - S_StartSound(player->mo, actor->info->seesound); } // Function: A_PityShield @@ -3401,9 +3402,11 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - P_SwitchShield(player, SH_PITY); - S_StartSound(player->mo, actor->info->seesound); + + if (player->powers[pw_shield] && mariomode) return; + + P_SwitchShield(player, SH_PITY); } @@ -3429,9 +3432,10 @@ void A_GravityBox(mobj_t *actor) } player = actor->target->player; - player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1); S_StartSound(player, actor->info->activesound); + + player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1); } // Function: A_ScoreRise diff --git a/src/p_inter.c b/src/p_inter.c index 992141fb0..8ae97b831 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2735,9 +2735,10 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { + boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit - if ((player->powers[pw_shield] & 0xFF) == 0) + if ((player->powers[pw_shield] & SH_FORCEHP) == 0) player->powers[pw_shield] &= ~SH_FORCE; else player->powers[pw_shield]--; @@ -2759,6 +2760,8 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; + if (willbetallmario && !player->powers[pw_shield]) + player->powers[pw_shield] |= SH_PITY; } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) diff --git a/src/p_local.h b/src/p_local.h index e64a8dd43..09848aa51 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -59,11 +59,13 @@ #define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK) -#define mariomode (maptol & TOL_MARIO) #define twodlevel (maptol & TOL_2D) -#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale) -#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale) +#define mariomode (maptol & TOL_MARIO) +#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) + +#define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) +#define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) // // P_TICK diff --git a/src/p_user.c b/src/p_user.c index 177b8a2a7..2f076f59b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1367,6 +1367,8 @@ void P_SpawnShieldOrb(player_t *player) P_RemoveMobj(shieldobj); //kill the old one(s) } + if (orbtype == MT_PITYORB && mariomode) return; + shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; @@ -8102,7 +8104,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam_still.value; camrotate = cv_cam_rotate.value; camdist = FixedMul(cv_cam_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); } else // Camera 2 { @@ -8110,7 +8112,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam2_still.value; camrotate = cv_cam2_rotate.value; camdist = FixedMul(cv_cam2_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); } if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) diff --git a/src/r_things.c b/src/r_things.c index e8aa2956f..18ec1570c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1128,6 +1128,8 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t offset, offset2; boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); + fixed_t shortmarioshift = shortmario(thing->player); + INT32 dispoffset = thing->info->dispoffset; //SoM: 3/17/2000 @@ -1317,6 +1319,12 @@ static void R_ProjectSprite(mobj_t *thing) xscale = FixedMul(xscale, ang_scale); + if (shortmarioshift) + { + yscale >>= shortmarioshift; + this_scale /= 2; + } + if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) { fixed_t linkscale; @@ -1377,6 +1385,9 @@ static void R_ProjectSprite(mobj_t *thing) gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale); } + if (shortmarioshift) + this_scale *= 2; + if (thing->subsector->sector->cullheight) { if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt)) @@ -1442,7 +1453,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->thingheight = thing->height; vis->pz = thing->z; vis->pzt = vis->pz + vis->thingheight; - vis->texturemid = vis->gzt - viewz; + vis->texturemid = (vis->gzt - viewz) << shortmarioshift; vis->scalestep = scalestep; vis->mobj = thing; // Easy access! Tails 06-07-2002 From a842d96a48c6f979d6c89027ffb38c4474f7e299 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 11 Oct 2016 23:35:31 +0100 Subject: [PATCH 32/96] Forgot to commit this change when moving everything over to shortmarioshifts. --- src/r_things.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 18ec1570c..13688740d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1322,7 +1322,7 @@ static void R_ProjectSprite(mobj_t *thing) if (shortmarioshift) { yscale >>= shortmarioshift; - this_scale /= 2; + this_scale >>= shortmarioshift; } if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) @@ -1386,7 +1386,7 @@ static void R_ProjectSprite(mobj_t *thing) } if (shortmarioshift) - this_scale *= 2; + this_scale <<= shortmarioshift; if (thing->subsector->sector->cullheight) { From d4f0afa0d1689d91dccc1a85552ac73613c3d034 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 17:55:07 +0100 Subject: [PATCH 33/96] A Heckloada Mario Stuff https://gfycat.com/MasculineSatisfiedAfricanwilddog and https://gfycat.com/PastCompetentGypsymoth describe this all in varying states of completion --- src/d_player.h | 1 + src/p_enemy.c | 6 +++ src/p_inter.c | 27 ++++++++-- src/p_local.h | 2 + src/p_mobj.c | 43 +++++++++++++++- src/p_user.c | 130 +++++++++++++++++++++++++++---------------------- src/r_things.c | 14 +++--- 7 files changed, 154 insertions(+), 69 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 91520293d..1fa101e12 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -227,6 +227,7 @@ typedef enum pw_underwater, // underwater timer pw_spacetime, // In space, no one can hear you spin! pw_extralife, // Extra Life timer + pw_marioflashing, // Getting/losing powerup pw_super, // Are you super? pw_gravityboots, // gravity boots diff --git a/src/p_enemy.c b/src/p_enemy.c index 80372ce5f..104e53f1e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3359,6 +3359,12 @@ void A_ForceShield(mobj_t *actor) //can't use P_SwitchShield(player, SH_FORCE) - special case + if (mariomode && player->mo) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + } + if (!(player->powers[pw_shield] & SH_FORCE)) { // Just in case. diff --git a/src/p_inter.c b/src/p_inter.c index 8ae97b831..9c8885411 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -142,7 +142,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) if (player->bot && weapon) return false; - if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics) + if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX) return false; return true; @@ -1138,6 +1138,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_FIREFLOWER: if (player->bot) return; + if (mariomode) + { + toucher->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY) + player->powers[pw_shield] &= SH_NOSTACK; + } player->powers[pw_shield] |= SH_FIREFLOWER; toucher->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -1204,6 +1211,15 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, special->info->painsound); + if (mariomode && !player->powers[pw_shield]) + { + S_StartSound(toucher, sfx_mario3); + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->powers[pw_shield] = SH_PITY; + P_SpawnShieldOrb(player); + } + if (!(netgame && circuitmap && player != &players[consoleplayer])) P_SetMobjState(special, special->info->painstate); return; @@ -1997,6 +2013,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget } target->flags2 &= ~MF2_DONTDRAW; + + if (mariomode) + target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } // if killed by a player @@ -2773,7 +2792,9 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes + if (mariomode) + S_StartSound(player->mo, sfx_mario8); + else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes S_StartSound(player->mo, sfx_spkdth); else S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss. @@ -3134,7 +3155,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else { player->health -= damage; // mirror mobj health here - target->player->powers[pw_flashing] = flashingtics; + //target->player->powers[pw_flashing] = flashingtics; if (damage > 0) // don't spill emeralds/ammo/panels for shield damage P_PlayerRingBurst(player, damage); } diff --git a/src/p_local.h b/src/p_local.h index 09848aa51..041a2150d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -64,6 +64,8 @@ #define mariomode (maptol & TOL_MARIO) #define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) +#define MARIOFLASHINGTICS 19 + #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 1ae64bc60..95403995b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4061,6 +4061,40 @@ static void P_PlayerMobjThinker(mobj_t *mobj) I_Assert(mobj->player != NULL); I_Assert(!P_MobjWasRemoved(mobj)); + if (mobj->player->powers[pw_marioflashing]) + { + if (!mobj->player->powers[pw_nocontrol]++) + mobj->player->powers[pw_nocontrol]++; + + if (!(mobj->player->powers[pw_marioflashing] % 4)) + { + UINT16 shieldswitch = mobj->player->powers[pw_shield]; + mobj->player->powers[pw_shield] = mobj->movecount; + mobj->movecount = shieldswitch; + if ((mobj->player->powers[pw_shield] & SH_FIREFLOWER) != (mobj->movecount & SH_FIREFLOWER)) + { + if (mobj->player->powers[pw_shield] & SH_FIREFLOWER) + { + mobj->color = SKINCOLOR_WHITE; + G_GhostAddColor(GHC_FIREFLOWER); + } + else + { + mobj->color = mobj->player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } + } + if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK)) + P_SpawnShieldOrb(mobj->player); + } + + mobj->player->powers[pw_marioflashing]--; + if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) + if (--(mobj->player->powers[pw_flashing]) == flashingtics) + mobj->player->powers[pw_flashing]--; + return; + } + P_MobjCheckWater(mobj); #ifdef ESLOPE @@ -6380,9 +6414,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->x = thing->target->x; thing->y = thing->target->y; if (thing->eflags & MFE_VERTICALFLIP) - thing->z = thing->target->z + thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) - FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z + ((thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) - FixedMul(2*FRACUNIT, thing->target->scale); else - thing->z = thing->target->z - FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) + FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z - ((FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) + FixedMul(2*FRACUNIT, thing->target->scale); P_SetThingPosition(thing); P_CheckPosition(thing, thing->x, thing->y); @@ -7091,6 +7125,11 @@ void P_MobjThinker(mobj_t *mobj) break; case MT_PLAYER: /// \todo Have the player's dead body completely finish its animation even if they've already respawned. + if (mobj->player && mobj->player->powers[pw_marioflashing]) + { + mobj->player->powers[pw_marioflashing]--; + return; // don't do any momz + } if (!(mobj->flags2 & MF2_DONTDRAW)) { if (!mobj->fuse) diff --git a/src/p_user.c b/src/p_user.c index 2f076f59b..1589d308a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -790,59 +790,65 @@ boolean P_PlayerInPain(player_t *player) // void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) { - angle_t ang; - fixed_t fallbackspeed; - - if (player->mo->eflags & MFE_VERTICALFLIP) - player->mo->z--; - else - player->mo->z++; - - if (player->mo->eflags & MFE_UNDERWATER) - P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); - else - P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); - - if (inflictor) - { - ang = R_PointToAngle2(inflictor->x-inflictor->momx, inflictor->y - inflictor->momy, player->mo->x - player->mo->momx, player->mo->y - player->mo->momy); - - // explosion and rail rings send you farther back, making it more difficult - // to recover - if ((inflictor->flags2 & MF2_SCATTER) && source) - { - fixed_t dist = P_AproxDistance(P_AproxDistance(source->x-player->mo->x, source->y-player->mo->y), source->z-player->mo->z); - - dist = FixedMul(128*FRACUNIT, inflictor->scale) - dist/4; - - if (dist < FixedMul(4*FRACUNIT, inflictor->scale)) - dist = FixedMul(4*FRACUNIT, inflictor->scale); - - fallbackspeed = dist; - } - else if (inflictor->flags2 & MF2_EXPLOSION) - { - if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(38*FRACUNIT, inflictor->scale); // 7x - else - fallbackspeed = FixedMul(30*FRACUNIT, inflictor->scale); // 5x - } - else if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(45*FRACUNIT, inflictor->scale); // 4x - else - fallbackspeed = FixedMul(4*FRACUNIT, inflictor->scale); // the usual amount of force - } - else - { - ang = R_PointToAngle2(player->mo->momx, player->mo->momy, 0, 0); - fallbackspeed = FixedMul(4*FRACUNIT, player->mo->scale); - } - - P_InstaThrust(player->mo, ang, fallbackspeed); - if (player->powers[pw_carry] == CR_ROPEHANG) P_SetTarget(&player->mo->tracer, NULL); + if (!mariomode) + { + angle_t ang; + fixed_t fallbackspeed; + + P_ResetPlayer(player); + P_SetPlayerMobjState(player->mo, player->mo->info->painstate); + + if (player->mo->eflags & MFE_VERTICALFLIP) + player->mo->z--; + else + player->mo->z++; + + if (player->mo->eflags & MFE_UNDERWATER) + P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); + else + P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); + + if (inflictor) + { + ang = R_PointToAngle2(inflictor->x-inflictor->momx, inflictor->y - inflictor->momy, player->mo->x - player->mo->momx, player->mo->y - player->mo->momy); + + // explosion and rail rings send you farther back, making it more difficult + // to recover + if ((inflictor->flags2 & MF2_SCATTER) && source) + { + fixed_t dist = P_AproxDistance(P_AproxDistance(source->x-player->mo->x, source->y-player->mo->y), source->z-player->mo->z); + + dist = FixedMul(128*FRACUNIT, inflictor->scale) - dist/4; + + if (dist < FixedMul(4*FRACUNIT, inflictor->scale)) + dist = FixedMul(4*FRACUNIT, inflictor->scale); + + fallbackspeed = dist; + } + else if (inflictor->flags2 & MF2_EXPLOSION) + { + if (inflictor->flags2 & MF2_RAILRING) + fallbackspeed = FixedMul(38*FRACUNIT, inflictor->scale); // 7x + else + fallbackspeed = FixedMul(30*FRACUNIT, inflictor->scale); // 5x + } + else if (inflictor->flags2 & MF2_RAILRING) + fallbackspeed = FixedMul(45*FRACUNIT, inflictor->scale); // 4x + else + fallbackspeed = FixedMul(4*FRACUNIT, inflictor->scale); // the usual amount of force + } + else + { + ang = R_PointToAngle2(player->mo->momx, player->mo->momy, 0, 0); + fallbackspeed = FixedMul(4*FRACUNIT, player->mo->scale); + } + + P_InstaThrust(player->mo, ang, fallbackspeed); + } + // Point penalty for hitting a hazard during tag. // Discourages players from intentionally hurting themselves to avoid being tagged. if (gametype == GT_TAG && (!(player->pflags & PF_TAGGED) && !(player->pflags & PF_TAGIT))) @@ -853,9 +859,13 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) player->score = 0; } - P_ResetPlayer(player); - P_SetPlayerMobjState(player->mo, player->mo->info->painstate); player->powers[pw_flashing] = flashingtics; + if (mariomode) + { + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->powers[pw_flashing] += MARIOFLASHINGTICS; + player->mo->movecount = player->powers[pw_shield]; + } if (player->timeshit != UINT8_MAX) ++player->timeshit; @@ -1416,6 +1426,12 @@ void P_SpawnShieldOrb(player_t *player) // void P_SwitchShield(player_t *player, UINT16 shieldtype) { + if (mariomode && player->mo) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->powers[pw_nocontrol] += MARIOFLASHINGTICS; + } if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) { // Just in case. @@ -8104,7 +8120,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam_still.value; camrotate = cv_cam_rotate.value; camdist = FixedMul(cv_cam_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); + camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale, mo->scale)); } else // Camera 2 { @@ -8112,7 +8128,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam2_still.value; camrotate = cv_cam2_rotate.value; camdist = FixedMul(cv_cam2_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); + camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); } if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) @@ -8532,9 +8548,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist = FixedHypot(f1, f2); if (mo->eflags & MFE_VERTICALFLIP) - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - (P_GetPlayerHeight(player) << shortmario(player))); else - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + (P_GetPlayerHeight(player) << shortmario(player))); if (player->playerstate != PST_DEAD) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' @@ -9268,7 +9284,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1) && !player->powers[pw_marioflashing]) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; diff --git a/src/r_things.c b/src/r_things.c index 13688740d..823dda3ac 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1319,12 +1319,6 @@ static void R_ProjectSprite(mobj_t *thing) xscale = FixedMul(xscale, ang_scale); - if (shortmarioshift) - { - yscale >>= shortmarioshift; - this_scale >>= shortmarioshift; - } - if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) { fixed_t linkscale; @@ -1370,6 +1364,12 @@ static void R_ProjectSprite(mobj_t *thing) return; } + if (shortmarioshift) // squish mario + { + yscale >>= shortmarioshift; + this_scale >>= shortmarioshift; + } + //SoM: 3/17/2000: Disregard sprites that are out of view.. if (vflip) { @@ -1385,7 +1385,7 @@ static void R_ProjectSprite(mobj_t *thing) gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale); } - if (shortmarioshift) + if (shortmarioshift) // unsquish the x component this_scale <<= shortmarioshift; if (thing->subsector->sector->cullheight) From 71b7db4e0dfc017b6407a71ba73abd21983e2d09 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 22:06:12 +0100 Subject: [PATCH 34/96] Refinements to flashing. --- src/p_local.h | 2 +- src/p_mobj.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 041a2150d..b1c9366c5 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -64,7 +64,7 @@ #define mariomode (maptol & TOL_MARIO) #define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) -#define MARIOFLASHINGTICS 19 +#define MARIOFLASHINGTICS 21 #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 95403995b..de544362c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4066,7 +4066,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) if (!mobj->player->powers[pw_nocontrol]++) mobj->player->powers[pw_nocontrol]++; - if (!(mobj->player->powers[pw_marioflashing] % 4)) + if (!((--mobj->player->powers[pw_marioflashing] - 1) % 5)) { UINT16 shieldswitch = mobj->player->powers[pw_shield]; mobj->player->powers[pw_shield] = mobj->movecount; @@ -4088,7 +4088,6 @@ static void P_PlayerMobjThinker(mobj_t *mobj) P_SpawnShieldOrb(mobj->player); } - mobj->player->powers[pw_marioflashing]--; if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) if (--(mobj->player->powers[pw_flashing]) == flashingtics) mobj->player->powers[pw_flashing]--; From dff9209bd2260a29bece503235764095b8cd7a3e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 22:06:40 +0100 Subject: [PATCH 35/96] A fix for the thing where you can get stuck inside a Mario block that has a monitor in it. --- src/p_floor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 8f51698cc..220b87572 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1782,8 +1782,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node) break; } // Ignore popped monitors, too. - if (node->m_thing->flags & MF_MONITOR - && node->m_thing->threshold == 68) + if (node->m_thing->health == 0 // this only really applies for monitors + || (!(node->m_thing->flags & MF_MONITOR) && (mobjinfo[node->m_thing->type].flags & MF_MONITOR))) // gold monitor support continue; // Okay, we found something valid. if (!thing // take either the first thing @@ -3156,15 +3156,15 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob S_StartSound(puncher, sfx_mario9); // Puncher is "close enough" } - if (itsamonitor) + if (itsamonitor && thing) { - P_UnsetThingPosition(tmthing); - tmthing->x = oldx; - tmthing->y = oldy; - tmthing->z = oldz; - tmthing->momx = 1; - tmthing->momy = 1; - P_SetThingPosition(tmthing); + P_UnsetThingPosition(thing); + thing->x = oldx; + thing->y = oldy; + thing->z = oldz; + thing->momx = 1; + thing->momy = 1; + P_SetThingPosition(thing); } } else From a36912baef77220d62c88cbfd114c993ff594765 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 23:47:18 +0100 Subject: [PATCH 36/96] In Mario mode... * shields give you 1000 points * redundant shields don't make you puase * checkpoints give you 2000 points * falling down a deathpit is just falling, not bouncing --- src/info.c | 2 +- src/p_enemy.c | 55 +++++++++++++++++++++------------ src/p_inter.c | 85 +++++++++++++++++++++++++++++++++------------------ src/p_local.h | 4 +-- src/p_mobj.c | 2 +- src/p_user.c | 21 ++++++++++--- 6 files changed, 111 insertions(+), 58 deletions(-) diff --git a/src/info.c b/src/info.c index f7ff3f13d..c27a606fb 100644 --- a/src/info.c +++ b/src/info.c @@ -12236,7 +12236,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate - sfx_mario3, // deathsound + sfx_None, // deathsound 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height diff --git a/src/p_enemy.c b/src/p_enemy.c index 104e53f1e..dccc6a8ea 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3058,9 +3058,10 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - P_SwitchShield(player, SH_JUMP); + if (P_SwitchShield(player, SH_JUMP)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); } // Function: A_RingShield @@ -3086,9 +3087,10 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - P_SwitchShield(player, SH_ATTRACT); + if (P_SwitchShield(player, SH_ATTRACT)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); } // Function: A_RingBox @@ -3287,10 +3289,9 @@ void A_BombShield(mobj_t *actor) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) P_BlackOw(player); - S_StartSound(player->mo, actor->info->seesound); - // Now we know for certain that we don't have a bomb shield, so add one. :3 - P_SwitchShield(player, SH_BOMB); + P_SwitchShield(player, SH_BOMB); // will never return false, so no need for sound test + S_StartSound(player->mo, actor->info->seesound); } // Function: A_WaterShield @@ -3316,9 +3317,10 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - P_SwitchShield(player, SH_ELEMENTAL); + if (P_SwitchShield(player, SH_ELEMENTAL)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) P_RestoreMusic(player); @@ -3355,18 +3357,23 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - //can't use P_SwitchShield(player, SH_FORCE) - special case - if (mariomode && player->mo) + if (mariomode) { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 + P_AddPlayerScore(player, 1000); } if (!(player->powers[pw_shield] & SH_FORCE)) { + if (mariomode) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + } + // Just in case. if (player->pflags & PF_SHIELDABILITY) { @@ -3376,9 +3383,14 @@ void A_ForceShield(mobj_t *actor) player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; P_SpawnShieldOrb(player); + S_StartSound(player->mo, actor->info->seesound); } else + { player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; + if (mariomode) + S_StartSound(player->mo, sfx_itemup); + } } // Function: A_PityShield @@ -3408,11 +3420,14 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - if (player->powers[pw_shield] && mariomode) return; + if (player->powers[pw_shield] && mariomode) + { + S_StartSound(player->mo, sfx_itemup); + return; + } P_SwitchShield(player, SH_PITY); + S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index 9c8885411..05f8b3d4e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1138,6 +1138,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_FIREFLOWER: if (player->bot) return; + { + mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 + P_AddPlayerScore(player, 1000); + } + + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) + { + S_StartSound(toucher, sfx_itemup); + break; + } + else + S_StartSound(toucher, sfx_mario3); + if (mariomode) { toucher->movecount = player->powers[pw_shield]; @@ -1145,9 +1159,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY) player->powers[pw_shield] &= SH_NOSTACK; } - player->powers[pw_shield] |= SH_FIREFLOWER; + player->powers[pw_shield] |= SH_FIREFLOWER; //= (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; -- perfect implementation, not worth it whilst we only have one stack power toucher->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); + break; // *************** // @@ -1211,13 +1226,18 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, special->info->painsound); - if (mariomode && !player->powers[pw_shield]) + if (mariomode) { - S_StartSound(toucher, sfx_mario3); - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_PITY; - P_SpawnShieldOrb(player); + mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+7); // 2000 + P_AddPlayerScore(player, 2000); + if (!player->powers[pw_shield]) + { + S_StartSound(toucher, sfx_mario3); + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_shield] = SH_PITY; + P_SpawnShieldOrb(player); + } } if (!(netgame && circuitmap && player != &players[consoleplayer])) @@ -2013,9 +2033,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget } target->flags2 &= ~MF2_DONTDRAW; - - if (mariomode) - target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } // if killed by a player @@ -2281,24 +2298,32 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget break; case MT_PLAYER: - target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) - target->momx = target->momy = target->momz = 0; - if (damagetype == DMG_DROWNED) // drowned { - target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack. - if (target->player->charflags & SF_MACHINE) - S_StartSound(target, sfx_fizzle); + boolean mariodeathpit = (mariomode && damagetype == DMG_DEATHPIT); + target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) + if (!mariodeathpit) + { + target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + target->momx = target->momy = target->momz = 0; + } + if (damagetype == DMG_DROWNED) // drowned + { + target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack. + if (target->player->charflags & SF_MACHINE) + S_StartSound(target, sfx_fizzle); + else + S_StartSound(target, sfx_drown); + // Don't jump up when drowning + } else - S_StartSound(target, sfx_drown); - // Don't jump up when drowning - } - else - { - P_SetObjectMomZ(target, 14*FRACUNIT, false); - if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes - S_StartSound(target, sfx_spkdth); - else - P_PlayDeathSound(target); + { + if (!mariodeathpit) + P_SetObjectMomZ(target, 14*FRACUNIT, false); + if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes + S_StartSound(target, sfx_spkdth); + else + P_PlayDeathSound(target); + } } break; default: @@ -2656,9 +2681,11 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) P_PlayerEmeraldBurst(player, false); } - // Get rid of shield - player->powers[pw_shield] = SH_NONE; - player->mo->color = player->skincolor; + if (!mariomode) // Get rid of shield + { + player->powers[pw_shield] = SH_NONE; + player->mo->color = player->skincolor; + } // Get rid of emeralds player->powers[pw_emeralds] = 0; diff --git a/src/p_local.h b/src/p_local.h index b1c9366c5..f10ac2a4d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,7 +62,7 @@ #define twodlevel (maptol & TOL_2D) #define mariomode (maptol & TOL_MARIO) -#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) +#define shortmario(player) ((player && mariomode && !player->powers[pw_shield] && !objectplacing) ? 1 : 0) #define MARIOFLASHINGTICS 21 @@ -146,7 +146,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); -void P_SwitchShield(player_t *player, UINT16 shieldtype); +boolean P_SwitchShield(player_t *player, UINT16 shieldtype); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerLives(player_t *player, INT32 numlives); diff --git a/src/p_mobj.c b/src/p_mobj.c index de544362c..72b2eaf1d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3102,7 +3102,7 @@ static void P_PlayerZMovement(mobj_t *mo) if (P_MobjFlip(mo)*mo->momz < 0) // falling { - boolean clipmomz = true; + boolean clipmomz = !(P_CheckDeathPitCollide(mo)); mo->pmomz = 0; // We're on a new floor, don't keep doing platform movement. diff --git a/src/p_user.c b/src/p_user.c index 1589d308a..d81c9e19f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1424,16 +1424,23 @@ void P_SpawnShieldOrb(player_t *player) // // Not for use if shieldtype would be SH_FORCE. // -void P_SwitchShield(player_t *player, UINT16 shieldtype) +boolean P_SwitchShield(player_t *player, UINT16 shieldtype) { - if (mariomode && player->mo) + if (mariomode) { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_nocontrol] += MARIOFLASHINGTICS; + mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 + P_AddPlayerScore(player, 1000); } + if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) { + if (mariomode) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + } + // Just in case. if (player->pflags & PF_SHIELDABILITY) { @@ -1451,7 +1458,9 @@ void P_SwitchShield(player_t *player, UINT16 shieldtype) player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); + return true; } + return false; } // @@ -6232,6 +6241,8 @@ void P_BlackOw(player_t *player) P_NukeEnemies(player->mo, player->mo, 1536*FRACUNIT); // Search for all nearby enemies and nuke their pants off! player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; + if (mariomode && !player->powers[pw_shield]) + player->powers[pw_shield] = SH_PITY; } void P_ElementalFire(player_t *player, boolean cropcircle) From 4997564d303213ffe25fa9170c26461edbd82519 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 23:55:16 +0100 Subject: [PATCH 37/96] I like this timing more. --- src/p_local.h | 2 +- src/p_mobj.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index f10ac2a4d..4568fe4d8 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -64,7 +64,7 @@ #define mariomode (maptol & TOL_MARIO) #define shortmario(player) ((player && mariomode && !player->powers[pw_shield] && !objectplacing) ? 1 : 0) -#define MARIOFLASHINGTICS 21 +#define MARIOFLASHINGTICS TICRATE/2 #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 72b2eaf1d..50a80ebea 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4066,7 +4066,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) if (!mobj->player->powers[pw_nocontrol]++) mobj->player->powers[pw_nocontrol]++; - if (!((--mobj->player->powers[pw_marioflashing] - 1) % 5)) + if (!(--mobj->player->powers[pw_marioflashing] % 4)) { UINT16 shieldswitch = mobj->player->powers[pw_shield]; mobj->player->powers[pw_shield] = mobj->movecount; From 80300ac476d08d478fc609c80451d4ca99f56480 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 38/96] Fireflower is now on same level as all other shields, as opposed to being an additional stack layer. (MID LECTURE COMMIT STRATS YO) --- src/d_player.h | 7 +++---- src/dehacked.c | 2 +- src/p_enemy.c | 7 +++++++ src/p_inter.c | 20 +++++++++----------- src/p_local.h | 4 ++-- src/p_mobj.c | 19 ++++++------------- src/p_user.c | 24 ++++++++++++++++++------ src/r_things.c | 2 +- 8 files changed, 47 insertions(+), 38 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 1fa101e12..4bdfb9581 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -192,13 +192,12 @@ typedef enum SH_FLAMEAURA, // Pity shield: the world's most basic shield ever, given to players who suck at Match SH_PITY, + // The fireflower used to be stackable with other shields. Not anymore. + SH_FIREFLOWER, // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - // The fireflower is special... - SH_FIREFLOWER = 0x200, - // ...it can combine with other shields. - SH_STACK = SH_FIREFLOWER, + SH_STACK = 0, //SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index b6076f872..7e50f1d8d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7092,8 +7092,8 @@ struct { {"SH_THUNDERCOIN",SH_THUNDERCOIN}, {"SH_FLAMEAURA",SH_FLAMEAURA}, {"SH_PITY",SH_PITY}, + {"SH_FIREFLOWER",SH_FIREFLOWER}, // These ones are special and use the upper bits - {"SH_FIREFLOWER",SH_FIREFLOWER}, // Lower bits are a normal shield stacked on top of the fire flower {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit // Stack masks {"SH_STACK",SH_STACK}, diff --git a/src/p_enemy.c b/src/p_enemy.c index dccc6a8ea..a519563de 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3381,6 +3381,13 @@ void A_ForceShield(mobj_t *actor) player->homing = 0; } + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER + && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } + player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; P_SpawnShieldOrb(player); S_StartSound(player->mo, actor->info->seesound); diff --git a/src/p_inter.c b/src/p_inter.c index 05f8b3d4e..4d34de374 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1156,12 +1156,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { toucher->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY) - player->powers[pw_shield] &= SH_NOSTACK; } - player->powers[pw_shield] |= SH_FIREFLOWER; //= (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; -- perfect implementation, not worth it whilst we only have one stack power - toucher->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); + player->powers[pw_shield] = (player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; + P_SpawnShieldOrb(player); break; @@ -1235,6 +1232,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { S_StartSound(toucher, sfx_mario3); player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; player->powers[pw_shield] = SH_PITY; P_SpawnShieldOrb(player); } @@ -2782,6 +2780,7 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); + boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit if ((player->powers[pw_shield] & SH_FORCEHP) == 0) @@ -2792,12 +2791,6 @@ void P_RemoveShield(player_t *player) else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE) { // Second layer shields player->powers[pw_shield] = SH_NONE; - // Reset fireflower - if (!player->powers[pw_super]) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) // Give them what's coming to them! { @@ -2808,6 +2801,11 @@ void P_RemoveShield(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; if (willbetallmario && !player->powers[pw_shield]) player->powers[pw_shield] |= SH_PITY; + if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) diff --git a/src/p_local.h b/src/p_local.h index 4568fe4d8..7107432ef 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,9 +62,9 @@ #define twodlevel (maptol & TOL_2D) #define mariomode (maptol & TOL_MARIO) -#define shortmario(player) ((player && mariomode && !player->powers[pw_shield] && !objectplacing) ? 1 : 0) +#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) -#define MARIOFLASHINGTICS TICRATE/2 +#define MARIOFLASHINGTICS 21 #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 50a80ebea..822f2ef85 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4071,21 +4071,14 @@ static void P_PlayerMobjThinker(mobj_t *mobj) UINT16 shieldswitch = mobj->player->powers[pw_shield]; mobj->player->powers[pw_shield] = mobj->movecount; mobj->movecount = shieldswitch; - if ((mobj->player->powers[pw_shield] & SH_FIREFLOWER) != (mobj->movecount & SH_FIREFLOWER)) - { - if (mobj->player->powers[pw_shield] & SH_FIREFLOWER) - { - mobj->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - else - { - mobj->color = mobj->player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - } if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK)) P_SpawnShieldOrb(mobj->player); + if ((mobj->player->powers[pw_shield] & SH_NOSTACK) != SH_FIREFLOWER && (mobj->movecount & SH_NOSTACK) == SH_FIREFLOWER + && !(mobj->player->powers[pw_super] || (mariomode && mobj->player->powers[pw_invulnerability]))) + { + mobj->color = mobj->player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } } if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) diff --git a/src/p_user.c b/src/p_user.c index d81c9e19f..ffbff5ed4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1340,8 +1340,6 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif - player->pflags &= ~PF_SHIELDABILITY; // Prevent edge cases when switching shields. - if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_BLUEORB; else switch (player->powers[pw_shield] & SH_NOSTACK) @@ -1361,6 +1359,13 @@ void P_SpawnShieldOrb(player_t *player) case SH_PITY: orbtype = MT_PITYORB; break; + case SH_FIREFLOWER: + if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = SKINCOLOR_WHITE; + G_GhostAddColor(GHC_FIREFLOWER); + } + return; default: return; } @@ -1456,6 +1461,13 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) } } + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER // it's implicit that the new shield isn't a fireflower + && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } + player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); return true; @@ -2164,7 +2176,7 @@ static void P_CheckInvincibilityTimer(player_t *player) { if (mariomode) { - if (player->powers[pw_shield] & SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -3188,7 +3200,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_ATTACK || cmd->buttons & BT_FIRENORMAL) { - if (!(player->pflags & PF_ATTACKDOWN) && player->powers[pw_shield] & SH_FIREFLOWER && !player->climbing) + if (!(player->pflags & PF_ATTACKDOWN) && (player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER && !player->climbing) { player->pflags |= PF_ATTACKDOWN; P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); @@ -3423,7 +3435,7 @@ static void P_DoSuperStuff(player_t *player) P_SpawnShieldOrb(player); // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -3473,7 +3485,7 @@ static void P_DoSuperStuff(player_t *player) player->powers[pw_super] = 0; // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); diff --git a/src/r_things.c b/src/r_things.c index 823dda3ac..eb1a3cb25 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1128,7 +1128,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t offset, offset2; boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); - fixed_t shortmarioshift = shortmario(thing->player); + fixed_t shortmarioshift = (objectplacing ? 0 : shortmario(thing->player)); INT32 dispoffset = thing->info->dispoffset; From a119db3a8581ca22b7fffbe93cb0b6a6c0913db7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 39/96] Coins are no defense now! (This lecture is boring.) --- src/p_inter.c | 7 ++++++- src/p_user.c | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 4d34de374..a8a826fdf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -145,6 +145,9 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX) return false; + if (player->mo && player->mo->health <= 0) + return false; + return true; } @@ -3135,7 +3138,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_ShieldDamage(player, inflictor, source, damage); damage = 0; } - else if (player->mo->health > 1) // No shield but have rings. + else if (!mariomode && player->mo->health > 1) // No shield but have rings. { damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage, damagetype); @@ -3297,6 +3300,8 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) // Spill the ammo P_PlayerWeaponAmmoBurst(player); + if (mariomode) return; + for (i = 0; i < num_rings; i++) { INT32 objType = mobjinfo[MT_RING].reactiontime; diff --git a/src/p_user.c b/src/p_user.c index ffbff5ed4..219b82529 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -937,7 +937,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) { INT32 gainlives = 0; - while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1)) + while ((mariomode || player->xtralife < maxXtraLife) && player->health > 100 * (player->xtralife+1)) { ++gainlives; ++player->xtralife; @@ -949,6 +949,12 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) P_PlayLivesJingle(player); } } + + if (mariomode && player->health > 100) + { + player->mo->health = 1; + player->health = 1; + } } // From 8f1493e1359a40941a5323d1a7df39a5c7ec20ad Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 40/96] Start big. (He's been on the same powerpoint slide for 30 minutes now.) --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 5e45921b7..d90439152 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2196,6 +2196,9 @@ void G_PlayerReborn(INT32 player) p->health = 1; // 0 rings p->panim = PA_IDLE; // standing animation + if (mariomode) + p->powers[pw_shield] = SH_PITY; // start big + if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent From 5e92ca1a4a613498b2c220d5a6b9c4c2e9da6829 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 41/96] Okay, made the Mushroom a seperate shield instead of a hacked pity shield. This is a lot nicer in general. --- src/d_player.h | 4 +++- src/dehacked.c | 1 + src/g_game.c | 2 +- src/p_enemy.c | 10 +++------- src/p_inter.c | 7 ++----- src/p_user.c | 6 +----- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4bdfb9581..8e3f4c904 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -197,7 +197,9 @@ typedef enum // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - SH_STACK = 0, //SH_FIREFLOWER, + // The mushroom CAN stack with other shields. + SH_MUSHROOM = 0x200, + SH_STACK = SH_MUSHROOM, //|SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index 7e50f1d8d..3d3a887a7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7095,6 +7095,7 @@ struct { {"SH_FIREFLOWER",SH_FIREFLOWER}, // These ones are special and use the upper bits {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit + {"SH_MUSHROOM", SH_MUSHROOM}, // Can stack with other shields // Stack masks {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/g_game.c b/src/g_game.c index d90439152..200a0f45b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2197,7 +2197,7 @@ void G_PlayerReborn(INT32 player) p->panim = PA_IDLE; // standing animation if (mariomode) - p->powers[pw_shield] = SH_PITY; // start big + p->powers[pw_shield] = SH_MUSHROOM; // start big if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent diff --git a/src/p_enemy.c b/src/p_enemy.c index a519563de..a2fcd314b 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3427,14 +3427,10 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if (player->powers[pw_shield] && mariomode) - { + if (P_SwitchShield(player, SH_PITY)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) S_StartSound(player->mo, sfx_itemup); - return; - } - - P_SwitchShield(player, SH_PITY); - S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index a8a826fdf..1baeb6baf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1160,7 +1160,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) toucher->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } - player->powers[pw_shield] = (player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; + player->powers[pw_shield] = (mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; P_SpawnShieldOrb(player); break; @@ -1236,7 +1236,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, sfx_mario3); player->mo->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_PITY; + player->powers[pw_shield] = SH_MUSHROOM; P_SpawnShieldOrb(player); } } @@ -2782,7 +2782,6 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { - boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit @@ -2802,8 +2801,6 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (willbetallmario && !player->powers[pw_shield]) - player->powers[pw_shield] |= SH_PITY; if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) { player->mo->color = player->skincolor; diff --git a/src/p_user.c b/src/p_user.c index 219b82529..d199c86f7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1388,8 +1388,6 @@ void P_SpawnShieldOrb(player_t *player) P_RemoveMobj(shieldobj); //kill the old one(s) } - if (orbtype == MT_PITYORB && mariomode) return; - shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; @@ -1474,7 +1472,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) G_GhostAddColor(GHC_NORMAL); } - player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); + player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); return true; } @@ -6259,8 +6257,6 @@ void P_BlackOw(player_t *player) P_NukeEnemies(player->mo, player->mo, 1536*FRACUNIT); // Search for all nearby enemies and nuke their pants off! player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (mariomode && !player->powers[pw_shield]) - player->powers[pw_shield] = SH_PITY; } void P_ElementalFire(player_t *player, boolean cropcircle) From 2903180dee45d7d3e0b51f5552e32db110fd8bf7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 42/96] Treat the loss of the mushroom as a weapon-ring-spilling event in Mario-themed ringslinger, based on comments MI made on IRC about how different mariomode ringslinger would be. --- src/p_inter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 1baeb6baf..811e32afe 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2677,10 +2677,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) // Burst weapons and emeralds in Match/CTF only if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) - { P_PlayerRingBurst(player, player->health - 1); - P_PlayerEmeraldBurst(player, false); - } if (!mariomode) // Get rid of shield { @@ -2818,7 +2815,12 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); if (mariomode) + { S_StartSound(player->mo, sfx_mario8); + // Burst weapons and emeralds in Match/CTF only + if (!player->powers[pw_shield] && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) + P_PlayerRingBurst(player, 0); + } else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes S_StartSound(player->mo, sfx_spkdth); else From 91f9770cafa28b9dcc09b36119e10196d507a298 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 43/96] Fixed up the coin-looping. --- src/p_user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d199c86f7..7a91f5012 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -950,10 +950,11 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) } } - if (mariomode && player->health > 100) + if (mariomode && player->health > 100 && !G_RingSlingerGametype() && !G_TagGametype()) { - player->mo->health = 1; - player->health = 1; + player->mo->health = 1 + (player->health - 1) % 100; + player->health = player->mo->health; + player->xtralife = 0; } } From 2d85b146ea3feffc1416669e7d748a72f5fad77c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 44/96] Messed up the force shield stuff when implementing SH_MUSHROOM. --- src/p_enemy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index a2fcd314b..6b3793d32 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3368,12 +3368,6 @@ void A_ForceShield(mobj_t *actor) if (!(player->powers[pw_shield] & SH_FORCE)) { - if (mariomode) - { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - } - // Just in case. if (player->pflags & PF_SHIELDABILITY) { @@ -3388,16 +3382,22 @@ void A_ForceShield(mobj_t *actor) G_GhostAddColor(GHC_NORMAL); } - player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; - P_SpawnShieldOrb(player); S_StartSound(player->mo, actor->info->seesound); } - else + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); + + if ((player->powers[pw_shield] & SH_FORCE) && (player->powers[pw_shield] & SH_FORCEHP)) + return; // if you have a force shield with at least 2hp already, let's not go any further. + + if (mariomode) { - player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; - if (mariomode) - S_StartSound(player->mo, sfx_itemup); + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } + + player->powers[pw_shield] = SH_FORCE|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|0x01; + P_SpawnShieldOrb(player); } // Function: A_PityShield From 05aefc3edeab94a950597cc9f4901b2623715260 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 45/96] Removed bit of code that'd never run. --- src/p_inter.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 811e32afe..0b2262ab7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3304,8 +3304,6 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) for (i = 0; i < num_rings; i++) { INT32 objType = mobjinfo[MT_RING].reactiontime; - if (mariomode) - objType = mobjinfo[MT_COIN].reactiontime; z = player->mo->z; if (player->mo->eflags & MFE_VERTICALFLIP) From 6e47a07a04835e462ead5f84842265292fd301f4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 46/96] Fixed monitors not making sounds if you had that monitor already and it wasn't mariomode. --- src/p_enemy.c | 12 +++++++----- src/p_user.c | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 6b3793d32..d3434a828 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3060,7 +3060,7 @@ void A_JumpShield(mobj_t *actor) if (P_SwitchShield(player, SH_JUMP)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); } @@ -3089,7 +3089,7 @@ void A_RingShield(mobj_t *actor) if (P_SwitchShield(player, SH_ATTRACT)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); } @@ -3319,7 +3319,7 @@ void A_WaterShield(mobj_t *actor) if (P_SwitchShield(player, SH_ELEMENTAL)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) @@ -3384,7 +3384,9 @@ void A_ForceShield(mobj_t *actor) S_StartSound(player->mo, actor->info->seesound); } - else if (mariomode) + else if (!mariomode) + S_StartSound(player->mo, actor->info->seesound); + else S_StartSound(player->mo, sfx_itemup); if ((player->powers[pw_shield] & SH_FORCE) && (player->powers[pw_shield] & SH_FORCEHP)) @@ -3429,7 +3431,7 @@ void A_PityShield(mobj_t *actor) if (P_SwitchShield(player, SH_PITY)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); } diff --git a/src/p_user.c b/src/p_user.c index 7a91f5012..6ae507f0c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1428,9 +1428,11 @@ void P_SpawnShieldOrb(player_t *player) // // P_SwitchShield // -// Handles the possibility of switching -// between shields thoroughly, then -// adds the desired one. +// Handles the possibility of switching between +// the non-stack layer of shields thoroughly, +// then adds the desired one. +// +// Returns whether to play a normal sound or an itemup. // // Not for use if shieldtype would be SH_FORCE. // @@ -1477,7 +1479,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) P_SpawnShieldOrb(player); return true; } - return false; + return (!mariomode); } // From 3aa9d2a1b17ef18552773d9c9c15c5d2d942a0e7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 47/96] Sonic 3 shields implemented at a basic visual/functional level - no abilities yet. --- src/d_player.h | 8 +- src/dehacked.c | 104 +++++++++- src/hardware/hw_light.c | 6 + src/info.c | 433 ++++++++++++++++++++++++++++++++++++++-- src/info.h | 110 +++++++++- src/p_enemy.c | 90 +++++++++ src/p_floor.c | 15 +- src/p_mobj.c | 17 +- src/p_user.c | 21 +- src/st_stuff.c | 37 ++-- 10 files changed, 779 insertions(+), 62 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 8e3f4c904..77ad34dab 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -186,12 +186,12 @@ typedef enum SH_ATTRACT, SH_ELEMENTAL, SH_BOMB, - // Stupid useless unimplimented Sonic 3 shields - SH_BUBBLEWRAP, - SH_THUNDERCOIN, - SH_FLAMEAURA, // Pity shield: the world's most basic shield ever, given to players who suck at Match SH_PITY, + // Sonic 3 shields + SH_FLAMEAURA, + SH_BUBBLEWRAP, + SH_THUNDERCOIN, // The fireflower used to be stackable with other shields. Not anymore. SH_FIREFLOWER, // The force shield uses the lower 8 bits to count how many extra hits are left. diff --git a/src/dehacked.c b/src/dehacked.c index 3d3a887a7..bd3f8455f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1687,6 +1687,9 @@ static actionpointer_t actionpointers[] = {{A_WaterShield}, "A_WATERSHIELD"}, {{A_ForceShield}, "A_FORCESHIELD"}, {{A_PityShield}, "A_PITYSHIELD"}, + {{A_FlameShield}, "A_FLAMESHIELD"}, + {{A_BubbleShield}, "A_BUBBLESHIELD"}, + {{A_ThunderShield}, "A_THUNDERSHIELD"}, {{A_GravityBox}, "A_GRAVITYBOX"}, {{A_ScoreRise}, "A_SCORERISE"}, {{A_ParticleSpawn}, "A_PARTICLESPAWN"}, @@ -4908,6 +4911,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_RECYCLER_BOX", "S_SCORE1K_BOX", "S_SCORE10K_BOX", + "S_FLAMEAURA_BOX", + "S_BUBBLEWRAP_BOX", + "S_THUNDERCOIN_BOX", // Gold Repeat Monitor States (one per box) "S_PITY_GOLDBOX", @@ -4920,6 +4926,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_INVULN_GOLDBOX", "S_EGGMAN_GOLDBOX", "S_GRAVITY_GOLDBOX", + "S_FLAMEAURA_GOLDBOX", + "S_BUBBLEWRAP_GOLDBOX", + "S_THUNDERCOIN_GOLDBOX", // Team Ring Boxes (these are special) "S_RING_REDBOX1", @@ -4981,6 +4990,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SCORE10K_ICON1", "S_SCORE10K_ICON2", + "S_FLAMEAURA_ICON1", + "S_FLAMEAURA_ICON2", + + "S_BUBBLEWRAP_ICON1", + "S_BUBBLEWRAP_ICON2", + + "S_THUNDERCOIN_ICON1", + "S_THUNDERCOIN_ICON2", + "S_ROCKET", "S_LASER", @@ -5409,6 +5427,68 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PITY9", "S_PITY10", + "S_FIRS1", + "S_FIRS2", + "S_FIRS3", + "S_FIRS4", + "S_FIRS5", + "S_FIRS6", + "S_FIRS7", + "S_FIRS8", + "S_FIRS9", + + "S_FIRSB1", + "S_FIRSB2", + "S_FIRSB3", + "S_FIRSB4", + "S_FIRSB5", + "S_FIRSB6", + "S_FIRSB7", + "S_FIRSB8", + "S_FIRSB9", + + "S_BUBS1", + "S_BUBS2", + "S_BUBS3", + "S_BUBS4", + "S_BUBS5", + "S_BUBS6", + "S_BUBS7", + "S_BUBS8", + "S_BUBS9", + + "S_BUBSB1", + "S_BUBSB2", + + "S_ZAPS1", + "S_ZAPS2", + "S_ZAPS3", + "S_ZAPS4", + "S_ZAPS5", + "S_ZAPS6", + "S_ZAPS7", + "S_ZAPS8", + "S_ZAPS9", + "S_ZAPS10", + "S_ZAPS11", + "S_ZAPS12", + "S_ZAPS13", // blank frame + "S_ZAPS14", + "S_ZAPS15", + "S_ZAPS16", + + "S_ZAPSB1", // blank frame + "S_ZAPSB2", + "S_ZAPSB3", + "S_ZAPSB4", + "S_ZAPSB5", + "S_ZAPSB6", + "S_ZAPSB7", + "S_ZAPSB8", + "S_ZAPSB9", + "S_ZAPSB10", + "S_ZAPSB11", // blank frame + // Invincibility Sparkles "S_IVSP", @@ -6231,6 +6311,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_RECYCLER_BOX", "MT_SCORE1K_BOX", "MT_SCORE10K_BOX", + "MT_FLAMEAURA_BOX", + "MT_BUBBLEWRAP_BOX", + "MT_THUNDERCOIN_BOX", // Monitor boxes -- repeating (big) boxes "MT_PITY_GOLDBOX", @@ -6243,6 +6326,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_INVULN_GOLDBOX", "MT_EGGMAN_GOLDBOX", "MT_GRAVITY_GOLDBOX", + "MT_FLAMEAURA_GOLDBOX", + "MT_BUBBLEWRAP_GOLDBOX", + "MT_THUNDERCOIN_GOLDBOX", // Monitor boxes -- special "MT_RING_REDBOX", @@ -6265,6 +6351,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_RECYCLER_ICON", "MT_SCORE1K_ICON", "MT_SCORE10K_ICON", + "MT_FLAMEAURA_ICON", + "MT_BUBBLEWRAP_ICON", + "MT_THUNDERCOIN_ICON", // Projectiles "MT_ROCKET", @@ -6417,12 +6506,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_EGGSTATUE2", // Powerup Indicators - "MT_GREENORB", // Elemental shield mobj - "MT_YELLOWORB", // Attract shield mobj - "MT_BLUEORB", // Force shield mobj - "MT_BLACKORB", // Armageddon shield mobj - "MT_WHITEORB", // Whirlwind shield mobj - "MT_PITYORB", // Pity shield mobj + "MT_ELEMENTAL_ORB", // Elemental shield mobj + "MT_ATTRACT_ORB", // Attract shield mobj + "MT_FORCE_ORB", // Force shield mobj + "MT_BOMB_ORB", // Armageddon shield mobj + "MT_JUMP_ORB", // Whirlwind shield mobj + "MT_PITY_ORB", // Pity shield mobj + "MT_FLAMEAURA_ORB", // Flame shield mobj + "MT_BUBBLEWRAP_ORB", // Bubble shield mobj + "MT_THUNDERCOIN_ORB", // Thunder shield mobj "MT_IVSP", // invincibility sparkles "MT_SUPERSPARK", // Super Sonic Spark diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index e79aba735..a73a3462c 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -271,6 +271,9 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_TVRC &lspr[NOLIGHT], // SPR_TV1K &lspr[NOLIGHT], // SPR_TVTK + &lspr[NOLIGHT], // SPR_TVFL + &lspr[NOLIGHT], // SPR_TVBB + &lspr[NOLIGHT], // SPR_TVZP // Projectiles &lspr[NOLIGHT], // SPR_MISL @@ -359,6 +362,9 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_ELEM &lspr[NOLIGHT], // SPR_FORC &lspr[NOLIGHT], // SPR_PITY + &lspr[NOLIGHT], // SPR_FIRS + &lspr[NOLIGHT], // SPR_BUBS + &lspr[NOLIGHT], // SPR_ZAPS &lspr[INVINCIBLE_L], // SPR_IVSP &lspr[SUPERSPARK_L], // SPR_SSPK diff --git a/src/info.c b/src/info.c index c27a606fb..85a9589c9 100644 --- a/src/info.c +++ b/src/info.c @@ -159,6 +159,9 @@ char sprnames[NUMSPRITES + 1][5] = "TVRC", // ReCycler "TV1K", // 1,000 points (1 K) "TVTK", // 10,000 points (Ten K) + "TVFL", // FLame shield + "TVBB", // BuBble shield + "TVZP", // Thunder shield (ZaP) // Projectiles "MISL", @@ -243,6 +246,9 @@ char sprnames[NUMSPRITES + 1][5] = "ELEM", // Elemental Shield Orb and Fire "FORC", // Force Shield Orb "PITY", // Pity Shield Orb + "FIRS", // Flame Shield Orb + "BUBS", // Bubble Shield Orb + "ZAPS", // Thunder Shield Orb "IVSP", // invincibility sparkles "SSPK", // Super Sonic Spark @@ -1623,6 +1629,9 @@ state_t states[NUMSTATES] = {SPR_TVRC, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_RECYCLER_BOX {SPR_TV1K, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE1K_BOX {SPR_TVTK, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE10K_BOX + {SPR_TVFL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_FLAMEAURA_BOX + {SPR_TVBB, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_BUBBLEWRAP_BOX + {SPR_TVZP, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_THUNDERCOIN_BOX // Gold Repeat Monitor States (one per box) {SPR_TVPI, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_PITY_GOLDBOX @@ -1635,6 +1644,9 @@ state_t states[NUMSTATES] = {SPR_TVIV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_INVULN_GOLDBOX {SPR_TVEG, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_EGGMAN_GOLDBOX {SPR_TVGV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_GRAVITY_GOLDBOX + {SPR_TVFL, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_FLAMEAURA_GOLDBOX + {SPR_TVBB, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_BUBBLEWRAP_GOLDBOX + {SPR_TVZP, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_THUNDERCOIN_GOLDBOX // Team Ring Boxes (these are special) {SPR_TRRI, 0, 2, {NULL}, 0, 0, S_RING_REDBOX2}, // S_RING_REDBOX1 @@ -1696,6 +1708,15 @@ state_t states[NUMSTATES] = {SPR_TVTK, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1 {SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2 + {SPR_TVFL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FLAMEAURA_ICON2}, // S_FLAMEAURA_ICON1 + {SPR_TVFL, 2, 18, {A_FlameShield}, 0, 0, S_NULL}, // S_FLAMEAURA_ICON2 + + {SPR_TVBB, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_BUBBLEWRAP_ICON2}, // S_BUBBLEWRAP_ICON1 + {SPR_TVBB, 2, 18, {A_BubbleShield}, 0, 0, S_NULL}, // S_BUBBLERWAP_ICON2 + + {SPR_TVZP, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_THUNDERCOIN_ICON2}, // S_THUNDERCOIN_ICON1 + {SPR_TVZP, 2, 18, {A_ThunderShield}, 0, 0, S_NULL}, // S_THUNDERCOIN_ICON2 + // --- {SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET @@ -2134,6 +2155,68 @@ state_t states[NUMSTATES] = {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY10}, // S_PITY9 {SPR_PITY, FF_TRANS20|5, 1, {NULL}, 0, 0, S_PITY1 }, // S_PITY10 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40 , 2, {NULL}, 0, 0, S_FIRS2}, // S_FIRS1 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|1, 2, {NULL}, 0, 0, S_FIRS3}, // S_FIRS2 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|2, 2, {NULL}, 0, 0, S_FIRS4}, // S_FIRS3 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|3, 2, {NULL}, 0, 0, S_FIRS5}, // S_FIRS4 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|4, 2, {NULL}, 0, 0, S_FIRS6}, // S_FIRS5 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|5, 2, {NULL}, 0, 0, S_FIRS7}, // S_FIRS6 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|6, 2, {NULL}, 0, 0, S_FIRS8}, // S_FIRS7 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|7, 2, {NULL}, 0, 0, S_FIRS9}, // S_FIRS8 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|8, 2, {NULL}, 0, 0, S_FIRS1}, // S_FIRS9 + + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_FIRSB2}, // S_FIRSB1 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_FIRSB3}, // S_FIRSB2 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_FIRSB4}, // S_FIRSB3 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|12, 2, {NULL}, 0, 0, S_FIRSB5}, // S_FIRSB4 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|13, 2, {NULL}, 0, 0, S_FIRSB6}, // S_FIRSB5 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|14, 2, {NULL}, 0, 0, S_FIRSB7}, // S_FIRSB6 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|15, 2, {NULL}, 0, 0, S_FIRSB8}, // S_FIRSB7 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 + + {SPR_BUBS, FF_TRANS30| 2, 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 + {SPR_BUBS, FF_TRANS30| 3, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 + {SPR_BUBS, FF_TRANS30| 4, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 + {SPR_BUBS, FF_TRANS30| 5, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 + {SPR_BUBS, FF_TRANS30| 6, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 + {SPR_BUBS, FF_TRANS30| 7, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 + {SPR_BUBS, FF_TRANS30| 8, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 + {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 + {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 + + {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 + {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB2 + + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 2, 2, {NULL}, 0, 0, S_ZAPS4 }, // S_ZAPS3 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 3, 2, {NULL}, 0, 0, S_ZAPS5 }, // S_ZAPS4 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 4, 2, {NULL}, 0, 0, S_ZAPS6 }, // S_ZAPS5 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 5, 2, {NULL}, 0, 0, S_ZAPS7 }, // S_ZAPS6 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 6, 2, {NULL}, 0, 0, S_ZAPS8 }, // S_ZAPS7 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 7, 2, {NULL}, 0, 0, S_ZAPS9 }, // S_ZAPS8 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 8, 2, {NULL}, 0, 0, S_ZAPS10}, // S_ZAPS9 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 9, 2, {NULL}, 0, 0, S_ZAPS11}, // S_ZAPS10 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|10, 2, {NULL}, 0, 0, S_ZAPS12}, // S_ZAPS11 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|11, 2, {NULL}, 0, 0, S_ZAPS13}, // S_ZAPS12 + {SPR_NULL, 0, 9*2, {NULL}, 0, 0, S_ZAPS14}, // S_ZAPS13 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 9, 2, {NULL}, 0, 0, S_ZAPS15}, // S_ZAPS14 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|10, 2, {NULL}, 0, 0, S_ZAPS16}, // S_ZAPS15 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|11, 2, {NULL}, 0, 0, S_ZAPS1 }, // S_ZAPS16 + + {SPR_NULL, 0, 12*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB1 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 8, 2, {NULL}, 0, 0, S_ZAPSB3 }, // S_ZAPSB2 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 7, 2, {NULL}, 0, 0, S_ZAPSB4 }, // S_ZAPSB3 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 6, 2, {NULL}, 0, 0, S_ZAPSB5 }, // S_ZAPSB4 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 5, 2, {NULL}, 0, 0, S_ZAPSB6 }, // S_ZAPSB5 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 4, 2, {NULL}, 0, 0, S_ZAPSB7 }, // S_ZAPSB6 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 3, 2, {NULL}, 0, 0, S_ZAPSB8 }, // S_ZAPSB7 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 2, 2, {NULL}, 0, 0, S_ZAPSB9 }, // S_ZAPSB8 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPSB10}, // S_ZAPSB9 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPSB11}, // S_ZAPSB10 + {SPR_NULL, 0, 15*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB11 + // Invincibility Sparkles {SPR_IVSP, FF_ANIMATE, 32, {NULL}, 31, 1, S_NULL}, // S_IVSP @@ -6429,6 +6512,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEAURA_BOX + 420, // doomednum + S_FLAMEAURA_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_FLAMEAURA_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_FLAMEAURA_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_BOX + 421, // doomednum + S_BUBBLEWRAP_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_BUBBLEWRAP_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_BUBBLEWRAP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_BOX + 422, // doomednum + S_THUNDERCOIN_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_THUNDERCOIN_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_THUNDERCOIN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + { // MT_PITY_GOLDBOX 431, // doomednum S_PITY_GOLDBOX, // spawnstate @@ -6699,6 +6863,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEAURA_GOLDBOX + 450, // doomednum + S_FLAMEAURA_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_FLAMEAURA_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_FLAMEAURA_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_GOLDBOX + 451, // doomednum + S_BUBBLEWRAP_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_BUBBLEWRAP_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_BUBBLEWRAP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_GOLDBOX + 452, // doomednum + S_THUNDERCOIN_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_THUNDERCOIN_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_THUNDERCOIN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + { // MT_RING_REDBOX 414, // doomednum S_RING_REDBOX1, // spawnstate @@ -7185,6 +7430,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEAURA_ICON + -1, // doomednum + S_FLAMEAURA_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_ICON + -1, // doomednum + S_BUBBLEWRAP_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_ICON + -1, // doomednum + S_THUNDERCOIN_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + { // MT_ROCKET -1, // doomednum S_ROCKET, // spawnstate @@ -10428,7 +10754,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_GREENORB + { // MT_ELEMENTAL_ORB -1, // doomednum S_ELEM1, // spawnstate 1000, // spawnhealth @@ -10447,7 +10773,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_ELEMENTAL, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10455,7 +10781,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_YELLOWORB + { // MT_ATTRACT_ORB -1, // doomednum S_MAGN1, // spawnstate 1000, // spawnhealth @@ -10474,7 +10800,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_ATTRACT, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10482,7 +10808,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BLUEORB + { // MT_FORCE_ORB -1, // doomednum S_FORC1, // spawnstate 1000, // spawnhealth @@ -10501,7 +10827,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_FORCE, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10509,7 +10835,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BLACKORB + { // MT_BOMB_ORB -1, // doomednum S_ARMA1, // spawnstate 1000, // spawnhealth @@ -10528,7 +10854,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_BOMB, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10536,7 +10862,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_WHITEORB + { // MT_JUMP_ORB -1, // doomednum S_WIND1, // spawnstate 1000, // spawnhealth @@ -10555,7 +10881,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_JUMP, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10563,7 +10889,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_PITYORB + { // MT_PITY_ORB -1, // doomednum S_PITY1, // spawnstate 1000, // spawnhealth @@ -10582,7 +10908,88 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_PITY, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_FLAMEAURA_ORB + -1, // doomednum + S_FIRSB1, // spawnstate + 1000, // spawnhealth + S_FIRS1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + SKINCOLOR_NONE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + SH_FLAMEAURA, // speed + 64*FRACUNIT, // radius + 64*FRACUNIT, // height + -2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_ORB + -1, // doomednum + S_BUBSB1, // spawnstate + 1000, // spawnhealth + S_BUBS1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + SKINCOLOR_NONE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + SH_BUBBLEWRAP, // speed + 64*FRACUNIT, // radius + 64*FRACUNIT, // height + -2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_ORB + -1, // doomednum + S_ZAPSB1, // spawnstate + 1000, // spawnhealth + S_ZAPS1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + SKINCOLOR_NONE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + SH_THUNDERCOIN, // speed + 64*FRACUNIT, // radius + 64*FRACUNIT, // height + -2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10609,7 +11016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 2, // display offset + 3, // display offset 16, // mass 0, // damage sfx_None, // activesound diff --git a/src/info.h b/src/info.h index 16666ed96..638657226 100644 --- a/src/info.h +++ b/src/info.h @@ -56,6 +56,9 @@ void A_BombShield(); // Obtained Bomb Shield void A_WaterShield(); // Obtained Water Shield void A_ForceShield(); // Obtained Force Shield void A_PityShield(); // Obtained Pity Shield. We're... sorry. +void A_FlameShield(); // Obtained Flame Shield +void A_BubbleShield(); // Obtained Bubble Shield +void A_ThunderShield(); // Obtained Thunder Shield void A_GravityBox(); void A_ScoreRise(); // Rise the score logo void A_ParticleSpawn(); @@ -351,6 +354,9 @@ typedef enum sprite SPR_TVRC, // ReCycler SPR_TV1K, // 1,000 points (1 K) SPR_TVTK, // 10,000 points (Ten K) + SPR_TVFL, // FLame shield + SPR_TVBB, // BuBble shield + SPR_TVZP, // Thunder shield (ZaP) // Projectiles SPR_MISL, @@ -435,6 +441,9 @@ typedef enum sprite SPR_ELEM, // Elemental Shield Orb and Fire SPR_FORC, // Force Shield Orb SPR_PITY, // Pity Shield Orb + SPR_FIRS, // Flame Shield Orb + SPR_BUBS, // Bubble Shield Orb + SPR_ZAPS, // Thunder Shield Orb SPR_IVSP, // invincibility sparkles SPR_SSPK, // Super Sonic Spark @@ -1814,6 +1823,9 @@ typedef enum state S_RECYCLER_BOX, S_SCORE1K_BOX, S_SCORE10K_BOX, + S_FLAMEAURA_BOX, + S_BUBBLEWRAP_BOX, + S_THUNDERCOIN_BOX, // Gold Repeat Monitor States (one per box) S_PITY_GOLDBOX, @@ -1826,6 +1838,9 @@ typedef enum state S_INVULN_GOLDBOX, S_EGGMAN_GOLDBOX, S_GRAVITY_GOLDBOX, + S_FLAMEAURA_GOLDBOX, + S_BUBBLEWRAP_GOLDBOX, + S_THUNDERCOIN_GOLDBOX, // Team Ring Boxes (these are special) S_RING_REDBOX1, @@ -1887,6 +1902,15 @@ typedef enum state S_SCORE10K_ICON1, S_SCORE10K_ICON2, + S_FLAMEAURA_ICON1, + S_FLAMEAURA_ICON2, + + S_BUBBLEWRAP_ICON1, + S_BUBBLEWRAP_ICON2, + + S_THUNDERCOIN_ICON1, + S_THUNDERCOIN_ICON2, + // --- S_ROCKET, @@ -2317,6 +2341,68 @@ typedef enum state S_PITY9, S_PITY10, + S_FIRS1, + S_FIRS2, + S_FIRS3, + S_FIRS4, + S_FIRS5, + S_FIRS6, + S_FIRS7, + S_FIRS8, + S_FIRS9, + + S_FIRSB1, + S_FIRSB2, + S_FIRSB3, + S_FIRSB4, + S_FIRSB5, + S_FIRSB6, + S_FIRSB7, + S_FIRSB8, + S_FIRSB9, + + S_BUBS1, + S_BUBS2, + S_BUBS3, + S_BUBS4, + S_BUBS5, + S_BUBS6, + S_BUBS7, + S_BUBS8, + S_BUBS9, + + S_BUBSB1, + S_BUBSB2, + + S_ZAPS1, + S_ZAPS2, + S_ZAPS3, + S_ZAPS4, + S_ZAPS5, + S_ZAPS6, + S_ZAPS7, + S_ZAPS8, + S_ZAPS9, + S_ZAPS10, + S_ZAPS11, + S_ZAPS12, + S_ZAPS13, // blank frame + S_ZAPS14, + S_ZAPS15, + S_ZAPS16, + + S_ZAPSB1, // blank frame + S_ZAPSB2, + S_ZAPSB3, + S_ZAPSB4, + S_ZAPSB5, + S_ZAPSB6, + S_ZAPSB7, + S_ZAPSB8, + S_ZAPSB9, + S_ZAPSB10, + S_ZAPSB11, // blank frame + // Invincibility Sparkles S_IVSP, @@ -3158,6 +3244,9 @@ typedef enum mobj_type MT_RECYCLER_BOX, MT_SCORE1K_BOX, MT_SCORE10K_BOX, + MT_FLAMEAURA_BOX, + MT_BUBBLEWRAP_BOX, + MT_THUNDERCOIN_BOX, // Monitor boxes -- repeating (big) boxes MT_PITY_GOLDBOX, @@ -3170,6 +3259,9 @@ typedef enum mobj_type MT_INVULN_GOLDBOX, MT_EGGMAN_GOLDBOX, MT_GRAVITY_GOLDBOX, + MT_FLAMEAURA_GOLDBOX, + MT_BUBBLEWRAP_GOLDBOX, + MT_THUNDERCOIN_GOLDBOX, // Monitor boxes -- special MT_RING_REDBOX, @@ -3192,6 +3284,9 @@ typedef enum mobj_type MT_RECYCLER_ICON, MT_SCORE1K_ICON, MT_SCORE10K_ICON, + MT_FLAMEAURA_ICON, + MT_BUBBLEWRAP_ICON, + MT_THUNDERCOIN_ICON, // Projectiles MT_ROCKET, @@ -3344,12 +3439,15 @@ typedef enum mobj_type MT_EGGSTATUE2, // Powerup Indicators - MT_GREENORB, // Elemental shield mobj - MT_YELLOWORB, // Attract shield mobj - MT_BLUEORB, // Force shield mobj - MT_BLACKORB, // Armageddon shield mobj - MT_WHITEORB, // Whirlwind shield mobj - MT_PITYORB, // Pity shield mobj + MT_ELEMENTAL_ORB, // Elemental shield mobj + MT_ATTRACT_ORB, // Attract shield mobj + MT_FORCE_ORB, // Force shield mobj + MT_BOMB_ORB, // Armageddon shield mobj + MT_JUMP_ORB, // Whirlwind shield mobj + MT_PITY_ORB, // Pity shield mobj + MT_FLAMEAURA_ORB, // Flame shield mobj + MT_BUBBLEWRAP_ORB, // Bubble shield mobj + MT_THUNDERCOIN_ORB, // Thunder shield mobj MT_IVSP, // invincibility sparkles MT_SUPERSPARK, // Super Sonic Spark diff --git a/src/p_enemy.c b/src/p_enemy.c index d3434a828..7ef87ac44 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -104,6 +104,9 @@ void A_BombShield(mobj_t *actor); void A_WaterShield(mobj_t *actor); void A_ForceShield(mobj_t *actor); void A_PityShield(mobj_t *actor); +void A_FlameShield(mobj_t *actor); +void A_BubbleShield(mobj_t *actor); +void A_ThunderShield(mobj_t *actor); void A_GravityBox(mobj_t *actor); void A_ScoreRise(mobj_t *actor); void A_ParticleSpawn(mobj_t *actor); @@ -3435,6 +3438,93 @@ void A_PityShield(mobj_t *actor) S_StartSound(player->mo, sfx_itemup); } +// Function: A_FlameShield +// +// Description: Awards the player a flame shield. +// +// var1 = unused +// var2 = unused +// +void A_FlameShield(mobj_t *actor) +{ + player_t *player; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlameShield", actor)) + return; +#endif + if (!actor->target || !actor->target->player) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); + return; + } + + player = actor->target->player; + + if (P_SwitchShield(player, SH_FLAMEAURA)) + S_StartSound(player->mo, actor->info->seesound); + else + S_StartSound(player->mo, sfx_itemup); +} + +// Function: A_BubbleShield +// +// Description: Awards the player a bubble shield. +// +// var1 = unused +// var2 = unused +// +void A_BubbleShield(mobj_t *actor) +{ + player_t *player; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_BubbleShield", actor)) + return; +#endif + if (!actor->target || !actor->target->player) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); + return; + } + + player = actor->target->player; + + if (P_SwitchShield(player, SH_BUBBLEWRAP)) + S_StartSound(player->mo, actor->info->seesound); + else + S_StartSound(player->mo, sfx_itemup); +} + +// Function: A_ThunderShield +// +// Description: Awards the player a thunder shield. +// +// var1 = unused +// var2 = unused +// +void A_ThunderShield(mobj_t *actor) +{ + player_t *player; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_ThunderShield", actor)) + return; +#endif + if (!actor->target || !actor->target->player) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); + return; + } + + player = actor->target->player; + + if (P_SwitchShield(player, SH_THUNDERCOIN)) + S_StartSound(player->mo, actor->info->seesound); + else + S_StartSound(player->mo, sfx_itemup); +} + // Function: A_GravityBox // diff --git a/src/p_floor.c b/src/p_floor.c index 220b87572..3d18cc3bd 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1748,12 +1748,15 @@ static mobj_t *SearchMarioNode(msecnode_t *node) case MT_GHOST: case MT_OVERLAY: case MT_EMERALDSPAWN: - case MT_GREENORB: - case MT_YELLOWORB: - case MT_BLUEORB: - case MT_BLACKORB: - case MT_WHITEORB: - case MT_PITYORB: + case MT_ELEMENTAL_ORB: + case MT_ATTRACT_ORB: + case MT_FORCE_ORB: + case MT_BOMB_ORB: + case MT_JUMP_ORB: + case MT_PITY_ORB: + case MT_FLAMEAURA_ORB: + case MT_BUBBLEWRAP_ORB: + case MT_THUNDERCOIN_ORB: case MT_IVSP: case MT_SUPERSPARK: case MT_RAIN: diff --git a/src/p_mobj.c b/src/p_mobj.c index 822f2ef85..2cd6b7d77 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6764,7 +6764,7 @@ void P_MobjThinker(mobj_t *mobj) } else P_AddOverlay(mobj); - if ((mobj->target->type == MT_GREENORB) + if ((mobj->target->type == MT_ELEMENTAL_ORB) && (mobj->target->target) && (mobj->target->target->player) && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) @@ -6775,15 +6775,18 @@ void P_MobjThinker(mobj_t *mobj) mobj->tics++; } break; - case MT_BLACKORB: - case MT_WHITEORB: - case MT_GREENORB: - case MT_BLUEORB: - case MT_PITYORB: + case MT_BOMB_ORB: + case MT_JUMP_ORB: + case MT_ELEMENTAL_ORB: + case MT_FORCE_ORB: + case MT_PITY_ORB: + case MT_FLAMEAURA_ORB: + case MT_BUBBLEWRAP_ORB: + case MT_THUNDERCOIN_ORB: if (!P_AddShield(mobj)) return; break; - case MT_YELLOWORB: + case MT_ATTRACT_ORB: if (!P_AddShield(mobj)) return; if ((mobj->target) diff --git a/src/p_user.c b/src/p_user.c index 6ae507f0c..df28806b6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1348,23 +1348,32 @@ void P_SpawnShieldOrb(player_t *player) #endif if (player->powers[pw_shield] & SH_FORCE) - orbtype = MT_BLUEORB; + orbtype = MT_FORCE_ORB; else switch (player->powers[pw_shield] & SH_NOSTACK) { case SH_JUMP: - orbtype = MT_WHITEORB; + orbtype = MT_JUMP_ORB; break; case SH_ATTRACT: - orbtype = MT_YELLOWORB; + orbtype = MT_ATTRACT_ORB; break; case SH_ELEMENTAL: - orbtype = MT_GREENORB; + orbtype = MT_ELEMENTAL_ORB; break; case SH_BOMB: - orbtype = MT_BLACKORB; + orbtype = MT_BOMB_ORB; break; case SH_PITY: - orbtype = MT_PITYORB; + orbtype = MT_PITY_ORB; + break; + case SH_FLAMEAURA: + orbtype = MT_FLAMEAURA_ORB; + break; + case SH_BUBBLEWRAP: + orbtype = MT_BUBBLEWRAP_ORB; + break; + case SH_THUNDERCOIN: + orbtype = MT_THUNDERCOIN_ORB; break; case SH_FIREFLOWER: if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) diff --git a/src/st_stuff.c b/src/st_stuff.c index 8f36d5128..08d4204af 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -99,6 +99,9 @@ static patch_t *ringshield; static patch_t *watershield; static patch_t *bombshield; static patch_t *pityshield; +static patch_t *flameshield; +static patch_t *bubbleshield; +static patch_t *thundershield; static patch_t *invincibility; static patch_t *sneakers; static patch_t *gravboots; @@ -288,15 +291,18 @@ void ST_LoadGraphics(void) scatterring = W_CachePatchName("SCATIND", PU_HUDGFX); grenadering = W_CachePatchName("GRENIND", PU_HUDGFX); railring = W_CachePatchName("RAILIND", PU_HUDGFX); - jumpshield = W_CachePatchName("WHTVB0", PU_HUDGFX); - forceshield = W_CachePatchName("BLTVB0", PU_HUDGFX); - ringshield = W_CachePatchName("YLTVB0", PU_HUDGFX); - watershield = W_CachePatchName("ELTVB0", PU_HUDGFX); - bombshield = W_CachePatchName("BKTVB0", PU_HUDGFX); - pityshield = W_CachePatchName("GRTVB0", PU_HUDGFX); - invincibility = W_CachePatchName("PINVB0", PU_HUDGFX); - sneakers = W_CachePatchName("SHTVB0", PU_HUDGFX); - gravboots = W_CachePatchName("GBTVB0", PU_HUDGFX); + jumpshield = W_CachePatchName("TVWWC0", PU_HUDGFX); + forceshield = W_CachePatchName("TVFOC0", PU_HUDGFX); + ringshield = W_CachePatchName("TVATC0", PU_HUDGFX); + watershield = W_CachePatchName("TVELC0", PU_HUDGFX); + bombshield = W_CachePatchName("TVARC0", PU_HUDGFX); + pityshield = W_CachePatchName("TVPIC0", PU_HUDGFX); + flameshield = W_CachePatchName("TVFLC0", PU_HUDGFX); + bubbleshield = W_CachePatchName("TVBBC0", PU_HUDGFX); + thundershield = W_CachePatchName("TVZPC0", PU_HUDGFX); + invincibility = W_CachePatchName("TVIVC0", PU_HUDGFX); + sneakers = W_CachePatchName("TVSSC0", PU_HUDGFX); + gravboots = W_CachePatchName("TVGVC0", PU_HUDGFX); tagico = W_CachePatchName("TAGICO", PU_HUDGFX); rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX); @@ -805,11 +811,14 @@ static void ST_drawFirstPersonHUD(void) } else switch (player->powers[pw_shield] & SH_NOSTACK) { - case SH_JUMP: p = jumpshield; break; - case SH_ELEMENTAL: p = watershield; break; - case SH_BOMB: p = bombshield; break; - case SH_ATTRACT: p = ringshield; break; - case SH_PITY: p = pityshield; break; + case SH_JUMP: p = jumpshield; break; + case SH_ELEMENTAL: p = watershield; break; + case SH_BOMB: p = bombshield; break; + case SH_ATTRACT: p = ringshield; break; + case SH_PITY: p = pityshield; break; + case SH_FLAMEAURA: p = flameshield; break; + case SH_BUBBLEWRAP: p = bubbleshield; break; + case SH_THUNDERCOIN: p = thundershield; break; default: break; } From aa8a454ea9ed28524907686315ee3ec515f9e011 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 48/96] Turning some shield attributes into flags means that environmental protection and ring-pulling can be more elegantly handled. As a consequence, the S3 shields now have all their passives, and are just waiting on me to give them actives (two of which don't have the necessary sprites for...) --- src/d_player.h | 34 ++++++++++++++++++++++------------ src/dehacked.c | 25 ++++++++++++++++--------- src/p_enemy.c | 10 +++++----- src/p_inter.c | 15 +++++---------- src/p_mobj.c | 11 ++++++++--- src/p_spec.c | 2 +- src/p_user.c | 6 +++--- 7 files changed, 60 insertions(+), 43 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 77ad34dab..a7b19439d 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -181,25 +181,35 @@ typedef enum typedef enum { SH_NONE = 0, - // Standard shields + + // Shield flags + SH_PROTECTFIRE = 0x400, + SH_PROTECTWATER = 0x800, + SH_PROTECTELECTRICITY = 0x1000, + + // Indivisible shields + SH_PITY = 1, SH_JUMP, - SH_ATTRACT, - SH_ELEMENTAL, SH_BOMB, - // Pity shield: the world's most basic shield ever, given to players who suck at Match - SH_PITY, - // Sonic 3 shields - SH_FLAMEAURA, - SH_BUBBLEWRAP, - SH_THUNDERCOIN, - // The fireflower used to be stackable with other shields. Not anymore. SH_FIREFLOWER, + + // normal shields that use flags + SH_ATTRACT = SH_PROTECTELECTRICITY, + SH_ELEMENTAL = SH_PROTECTFIRE|SH_PROTECTWATER, + + // Sonic 3 shields + SH_FLAMEAURA = SH_PROTECTFIRE, + SH_BUBBLEWRAP = SH_PROTECTWATER, + SH_THUNDERCOIN = SH_JUMP|SH_PROTECTELECTRICITY, + // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - // The mushroom CAN stack with other shields. + + // Mostly for use with Mario mode. SH_MUSHROOM = 0x200, - SH_STACK = SH_MUSHROOM, //|SH_FIREFLOWER, + + SH_STACK = SH_MUSHROOM, // second-layer shields SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index bd3f8455f..20dce51d4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7174,21 +7174,28 @@ struct { {"PRECIP_STORM_NOSTRIKES",PRECIP_STORM_NOSTRIKES}, // Shields - // These ones use the lower 8 bits {"SH_NONE",SH_NONE}, + // Shield flags + {"SH_PROTECTFIRE",SH_PROTECTFIRE}, + {"SH_PROTECTWATER",SH_PROTECTWATER}, + {"SH_PROTECTELECTRICITY",SH_PROTECTELECTRICITY}, + // Indivisible shields + {"SH_PITY",SH_PITY}, {"SH_JUMP",SH_JUMP}, + {"SH_BOMB",SH_BOMB}, + {"SH_FIREFLOWER",SH_FIREFLOWER}, + // normal shields that use flags {"SH_ATTRACT",SH_ATTRACT}, {"SH_ELEMENTAL",SH_ELEMENTAL}, - {"SH_BOMB",SH_BOMB}, + // Sonic 3 shields + {"SH_FLAMEAURA",SH_FLAMEAURA}, {"SH_BUBBLEWRAP",SH_BUBBLEWRAP}, {"SH_THUNDERCOIN",SH_THUNDERCOIN}, - {"SH_FLAMEAURA",SH_FLAMEAURA}, - {"SH_PITY",SH_PITY}, - {"SH_FIREFLOWER",SH_FIREFLOWER}, - // These ones are special and use the upper bits - {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit - {"SH_MUSHROOM", SH_MUSHROOM}, // Can stack with other shields - // Stack masks + // The force shield uses the lower 8 bits to count how many extra hits are left. + {"SH_FORCE",SH_FORCE}, + {"SH_FORCEHP",SH_FORCEHP}, // to be used as a bitmask only + // Mostly for use with Mario mode. + {"SH_MUSHROOM", SH_MUSHROOM}, {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/p_enemy.c b/src/p_enemy.c index 7ef87ac44..6345a89c4 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -741,7 +741,7 @@ static boolean P_LookForShield(mobj_t *actor) (actor->type == MT_BLUETEAMRING && player->ctfteam != 2)) continue; - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) && (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST, player->mo->scale))) { P_SetTarget(&actor->tracer, player->mo); @@ -3817,7 +3817,7 @@ void A_AttractChase(mobj_t *actor) // Turn flingrings back into regular rings if attracted. if (actor->tracer && actor->tracer->player - && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) + && !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) { mobj_t *newring; newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime); @@ -4022,7 +4022,7 @@ void A_ThrownRing(mobj_t *actor) // A non-homing ring getting attracted by a // magnetic player. If he gets too far away, make // sure to stop the attraction! - if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) && P_AproxDistance(P_AproxDistance(actor->tracer->x-actor->x, actor->tracer->y-actor->y), actor->tracer->z-actor->z) > FixedMul(RING_DIST/4, actor->tracer->scale))) { @@ -4030,7 +4030,7 @@ void A_ThrownRing(mobj_t *actor) } if (actor->tracer && (actor->tracer->health) - && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)// Already found someone to follow. + && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY))// Already found someone to follow. { const INT32 temp = actor->threshold; actor->threshold = 32000; @@ -4098,7 +4098,7 @@ void A_ThrownRing(mobj_t *actor) if (!P_CheckSight(actor, player->mo)) continue; // out of sight - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) && dist < FixedMul(RING_DIST/4, player->mo->scale)) P_SetTarget(&actor->tracer, player->mo); return; diff --git a/src/p_inter.c b/src/p_inter.c index 0b2262ab7..c5938c90e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1459,7 +1459,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; case MT_EXTRALARGEBUBBLE: - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTWATER) return; if (maptol & TOL_NIGHTS) return; @@ -3022,28 +3022,23 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)) return false; -#define shieldtype (player->powers[pw_shield] & SH_NOSTACK) switch (damagetype) { case DMG_WATER: - if (shieldtype == SH_BUBBLEWRAP - || shieldtype == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTWATER) return false; // Invincible to water damage break; case DMG_FIRE: - if (shieldtype == SH_FLAMEAURA - || shieldtype == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTFIRE) return false; // Invincible to fire damage break; case DMG_ELECTRIC: - if (shieldtype == SH_ATTRACT - || shieldtype == SH_THUNDERCOIN) + if (player->powers[pw_shield] & SH_PROTECTELECTRICITY) return false; // Invincible to electric damage break; default: break; } -#undef shieldtype } if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling @@ -3067,7 +3062,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force && inflictor && inflictor->flags & MF_FIRE) { - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTFIRE) return false; // Invincible to fire objects if (G_PlatformGametype() && inflictor && source && source->player) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2cd6b7d77..d87e3cc20 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3619,15 +3619,20 @@ void P_MobjCheckWater(mobj_t *mobj) { if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability]))) { - if ((p->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) - { // Water removes attract shield. + if (p->powers[pw_shield] & SH_PROTECTELECTRICITY) + { // Water removes electric shields... p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; P_FlashPal(p, PAL_WHITE, 1); } + else if ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER)) + { // ...and fire-only shields. + p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; + P_FlashPal(p, PAL_NUKE, 1); + } } // Drown timer setting - if ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL // Has elemental + if ((p->powers[pw_shield] & SH_PROTECTWATER) // Has water protection || (p->exiting) // Or exiting || (maptol & TOL_NIGHTS) // Or in NiGHTS mode || (mariomode)) // Or in Mario mode... diff --git a/src/p_spec.c b/src/p_spec.c index ed2ff055c..0119664aa 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3562,7 +3562,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers P_PlayerFlagBurst(player, false); break; case 12: // Space Countdown - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL && !player->powers[pw_spacetime]) + if (!(player->powers[pw_shield] & SH_PROTECTWATER) && !player->powers[pw_spacetime]) player->powers[pw_spacetime] = spacetimetics + 1; break; case 13: // Ramp Sector (Increase step-up/down) diff --git a/src/p_user.c b/src/p_user.c index df28806b6..8ceef8d6e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2229,7 +2229,7 @@ static void P_DoBubbleBreath(player_t *player) fixed_t z = player->mo->z; mobj_t *bubble = NULL; - if (!(player->mo->eflags & MFE_UNDERWATER) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && !(player->pflags & PF_NIGHTSMODE)) || player->spectator) + if (!(player->mo->eflags & MFE_UNDERWATER) || ((player->powers[pw_shield] & SH_PROTECTWATER) && !(player->pflags & PF_NIGHTSMODE)) || player->spectator) return; if (player->charflags & SF_MACHINE) @@ -9242,7 +9242,7 @@ void P_PlayerThink(player_t *player) if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter player->powers[pw_tailsfly]--; - if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) + if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_PROTECTWATER))) { if (player->powers[pw_underwater] <= 12*TICRATE+1) P_RestoreMusic(player); //incase they were about to drown @@ -9252,7 +9252,7 @@ void P_PlayerThink(player_t *player) else if (player->powers[pw_underwater] && !(maptol & TOL_NIGHTS) && !((netgame || multiplayer) && player->spectator)) // underwater timer player->powers[pw_underwater]--; - if (player->powers[pw_spacetime] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) + if (player->powers[pw_spacetime] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_PROTECTWATER))) player->powers[pw_spacetime] = 0; else if (player->powers[pw_spacetime] && !(maptol & TOL_NIGHTS) && !((netgame || multiplayer) && player->spectator)) // underwater timer player->powers[pw_spacetime]--; From 2acfc72d86dde21e77ae813e0d6b8d502c58f7d3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 49/96] Made P_SwitchShield take into account the force shield, then made A_ForceShield take the number of bonus hitpoints as its var1. (Also, drowning timer is properly reset by ALL protectwater shields, not just elemental.) --- src/info.c | 2 +- src/p_enemy.c | 61 ++++++++------------------------------------------- src/p_user.c | 30 ++++++++++++++++++++----- 3 files changed, 35 insertions(+), 58 deletions(-) diff --git a/src/info.c b/src/info.c index 85a9589c9..b991e6825 100644 --- a/src/info.c +++ b/src/info.c @@ -1670,7 +1670,7 @@ state_t states[NUMSTATES] = {SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2 {SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1 - {SPR_TVFO, 2, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON2 + {SPR_TVFO, 2, 18, {A_ForceShield}, 1, 0, S_NULL}, // S_FORCE_ICON2 {SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1 {SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2 diff --git a/src/p_enemy.c b/src/p_enemy.c index 6345a89c4..900547ccb 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3324,29 +3324,19 @@ void A_WaterShield(mobj_t *actor) S_StartSound(player->mo, actor->info->seesound); else S_StartSound(player->mo, sfx_itemup); - - if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) - P_RestoreMusic(player); - - player->powers[pw_underwater] = 0; - - if (player->powers[pw_spacetime] > 1) - { - player->powers[pw_spacetime] = 0; - P_RestoreMusic(player); - } } // Function: A_ForceShield // // Description: Awards the player a force shield. // -// var1 = unused +// var1 = Number of additional hitpoints to give // var2 = unused // void A_ForceShield(mobj_t *actor) { player_t *player; + INT32 locvar1 = var1; #ifdef HAVE_BLUA if (LUA_CallAction("A_ForceShield", actor)) @@ -3358,51 +3348,18 @@ void A_ForceShield(mobj_t *actor) return; } + if (locvar1 < 0 || locvar1 > SH_FORCEHP) + { + CONS_Debug(DBG_GAMELOGIC, "Invalid number of additional hitpoints.\n"); + return; + } + player = actor->target->player; - //can't use P_SwitchShield(player, SH_FORCE) - special case - - if (mariomode) - { - mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 - P_AddPlayerScore(player, 1000); - } - - if (!(player->powers[pw_shield] & SH_FORCE)) - { - // Just in case. - if (player->pflags & PF_SHIELDABILITY) - { - player->pflags &= ~PF_SHIELDABILITY; - player->homing = 0; - } - - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER - && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - S_StartSound(player->mo, actor->info->seesound); - } - else if (!mariomode) + if (P_SwitchShield(player, SH_FORCE|locvar1)) S_StartSound(player->mo, actor->info->seesound); else S_StartSound(player->mo, sfx_itemup); - - if ((player->powers[pw_shield] & SH_FORCE) && (player->powers[pw_shield] & SH_FORCEHP)) - return; // if you have a force shield with at least 2hp already, let's not go any further. - - if (mariomode) - { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - } - - player->powers[pw_shield] = SH_FORCE|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|0x01; - P_SpawnShieldOrb(player); } // Function: A_PityShield diff --git a/src/p_user.c b/src/p_user.c index 8ceef8d6e..589e5e3c7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1443,10 +1443,16 @@ void P_SpawnShieldOrb(player_t *player) // // Returns whether to play a normal sound or an itemup. // -// Not for use if shieldtype would be SH_FORCE. -// boolean P_SwitchShield(player_t *player, UINT16 shieldtype) { + boolean donthavealready = (shieldtype & SH_FORCE) + ? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE)) + : ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype); + + boolean stopshieldability = (shieldtype & SH_FORCE) + ? (!(player->powers[pw_shield] & SH_FORCE)) + : true; + if (mariomode) { mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); @@ -1454,7 +1460,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) P_AddPlayerScore(player, 1000); } - if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) + if (donthavealready) { if (mariomode) { @@ -1463,9 +1469,9 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) } // Just in case. - if (player->pflags & PF_SHIELDABILITY) + if (stopshieldability && player->pflags & PF_SHIELDABILITY) { - player->pflags &= ~PF_SPINNING|PF_SHIELDABILITY; // They'll still have PF_THOKKED... + player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); // They'll still have PF_THOKKED... player->homing = 0; if (player->powers[pw_shield] & SH_FORCE) // Dash. { @@ -1486,6 +1492,20 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); + + if (shieldtype & SH_PROTECTWATER) + { + if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) + P_RestoreMusic(player); + + player->powers[pw_underwater] = 0; + + if (player->powers[pw_spacetime] > 1) + { + player->powers[pw_spacetime] = 0; + P_RestoreMusic(player); + } + } return true; } return (!mariomode); From 5ff507213bea4a9a0f987ff564a445684f9b5821 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 50/96] * Some shield constants renamed. * Some shield sounds swapped (can be reverted later). * Partial implementation of S3K shield abilities. * The ability to elemental-groundpound onto gold monitors without going straight through them. * Force shield ability removed because nobody could agree on it, we'll keep it blank until another idea can get through the disagreement juggernaut. --- src/d_player.h | 10 +-- src/dehacked.c | 12 ++-- src/info.c | 52 +++++++------- src/info.h | 6 +- src/p_enemy.c | 16 ++--- src/p_floor.c | 4 +- src/p_inter.c | 6 +- src/p_map.c | 12 +++- src/p_mobj.c | 29 ++++---- src/p_user.c | 182 ++++++++++++++++++------------------------------- src/st_stuff.c | 4 +- 11 files changed, 150 insertions(+), 183 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index a7b19439d..54960115f 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -185,22 +185,22 @@ typedef enum // Shield flags SH_PROTECTFIRE = 0x400, SH_PROTECTWATER = 0x800, - SH_PROTECTELECTRICITY = 0x1000, + SH_PROTECTELECTRIC = 0x1000, // Indivisible shields SH_PITY = 1, - SH_JUMP, - SH_BOMB, + SH_WHIRLWIND, + SH_ARMAGEDDON, SH_FIREFLOWER, // normal shields that use flags - SH_ATTRACT = SH_PROTECTELECTRICITY, + SH_ATTRACT = SH_PROTECTELECTRIC, SH_ELEMENTAL = SH_PROTECTFIRE|SH_PROTECTWATER, // Sonic 3 shields SH_FLAMEAURA = SH_PROTECTFIRE, SH_BUBBLEWRAP = SH_PROTECTWATER, - SH_THUNDERCOIN = SH_JUMP|SH_PROTECTELECTRICITY, + SH_THUNDERCOIN = SH_WHIRLWIND|SH_PROTECTELECTRIC, // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, diff --git a/src/dehacked.c b/src/dehacked.c index 20dce51d4..cfaa7b526 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5459,6 +5459,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BUBSB1", "S_BUBSB2", + "S_BUBSB3", + "S_BUBSB4", "S_ZAPS1", "S_ZAPS2", @@ -6509,8 +6511,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ELEMENTAL_ORB", // Elemental shield mobj "MT_ATTRACT_ORB", // Attract shield mobj "MT_FORCE_ORB", // Force shield mobj - "MT_BOMB_ORB", // Armageddon shield mobj - "MT_JUMP_ORB", // Whirlwind shield mobj + "MT_ARMAGEDDON_ORB", // Armageddon shield mobj + "MT_WHIRLWIND_ORB", // Whirlwind shield mobj "MT_PITY_ORB", // Pity shield mobj "MT_FLAMEAURA_ORB", // Flame shield mobj "MT_BUBBLEWRAP_ORB", // Bubble shield mobj @@ -7178,11 +7180,11 @@ struct { // Shield flags {"SH_PROTECTFIRE",SH_PROTECTFIRE}, {"SH_PROTECTWATER",SH_PROTECTWATER}, - {"SH_PROTECTELECTRICITY",SH_PROTECTELECTRICITY}, + {"SH_PROTECTELECTRIC",SH_PROTECTELECTRIC}, // Indivisible shields {"SH_PITY",SH_PITY}, - {"SH_JUMP",SH_JUMP}, - {"SH_BOMB",SH_BOMB}, + {"SH_WHIRLWIND",SH_WHIRLWIND}, + {"SH_ARMAGEDDON",SH_ARMAGEDDON}, {"SH_FIREFLOWER",SH_FIREFLOWER}, // normal shields that use flags {"SH_ATTRACT",SH_ATTRACT}, diff --git a/src/info.c b/src/info.c index b991e6825..56edd0b85 100644 --- a/src/info.c +++ b/src/info.c @@ -2175,18 +2175,20 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 - {SPR_BUBS, FF_TRANS30| 2, 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 - {SPR_BUBS, FF_TRANS30| 3, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 - {SPR_BUBS, FF_TRANS30| 4, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 - {SPR_BUBS, FF_TRANS30| 5, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 - {SPR_BUBS, FF_TRANS30| 6, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 - {SPR_BUBS, FF_TRANS30| 7, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 - {SPR_BUBS, FF_TRANS30| 8, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 - {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 - {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 + {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 + {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 + {SPR_BUBS, FF_TRANS30|2, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 + {SPR_BUBS, FF_TRANS30|3, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 + {SPR_BUBS, FF_TRANS30|4, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 + {SPR_BUBS, FF_TRANS30|5, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 + {SPR_BUBS, FF_TRANS30|6, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 + {SPR_BUBS, FF_TRANS30|7, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 + {SPR_BUBS, FF_TRANS30|8, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 - {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 - {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB2 + {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 + {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 + {SPR_BUBS, FF_TRANS30|11, 2, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3 + {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2 @@ -7057,7 +7059,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ATTRACT_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k41, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7111,7 +7113,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ARMAGEDDON_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3e, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7165,7 +7167,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ELEMENTAL_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3f, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7435,7 +7437,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_FLAMEAURA_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3e, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7462,7 +7464,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_BUBBLEWRAP_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3f, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7489,7 +7491,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_THUNDERCOIN_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k41, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -10762,7 +10764,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_ELEMF9, // painstate + S_NULL, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10778,7 +10780,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_ELEMF9 // raisestate }, { // MT_ATTRACT_ORB @@ -10835,7 +10837,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BOMB_ORB + { // MT_ARMAGEDDON_ORB -1, // doomednum S_ARMA1, // spawnstate 1000, // spawnhealth @@ -10851,7 +10853,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - SH_BOMB, // speed + SH_ARMAGEDDON, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height 2, // display offset @@ -10862,7 +10864,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_JUMP_ORB + { // MT_WHIRLWIND_ORB -1, // doomednum S_WIND1, // spawnstate 1000, // spawnhealth @@ -10878,7 +10880,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - SH_JUMP, // speed + SH_WHIRLWIND, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height 2, // display offset @@ -10978,7 +10980,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_ZAPSB11, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10994,7 +10996,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_ZAPS14 // raisestate }, { // MT_IVSP diff --git a/src/info.h b/src/info.h index 638657226..a18a374d9 100644 --- a/src/info.h +++ b/src/info.h @@ -2373,6 +2373,8 @@ typedef enum state S_BUBSB1, S_BUBSB2, + S_BUBSB3, + S_BUBSB4, S_ZAPS1, S_ZAPS2, @@ -3442,8 +3444,8 @@ typedef enum mobj_type MT_ELEMENTAL_ORB, // Elemental shield mobj MT_ATTRACT_ORB, // Attract shield mobj MT_FORCE_ORB, // Force shield mobj - MT_BOMB_ORB, // Armageddon shield mobj - MT_JUMP_ORB, // Whirlwind shield mobj + MT_ARMAGEDDON_ORB, // Armageddon shield mobj + MT_WHIRLWIND_ORB, // Whirlwind shield mobj MT_PITY_ORB, // Pity shield mobj MT_FLAMEAURA_ORB, // Flame shield mobj MT_BUBBLEWRAP_ORB, // Bubble shield mobj diff --git a/src/p_enemy.c b/src/p_enemy.c index 900547ccb..cde3f6310 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -741,7 +741,7 @@ static boolean P_LookForShield(mobj_t *actor) (actor->type == MT_BLUETEAMRING && player->ctfteam != 2)) continue; - if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if ((player->powers[pw_shield] & SH_PROTECTELECTRIC) && (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST, player->mo->scale))) { P_SetTarget(&actor->tracer, player->mo); @@ -3061,7 +3061,7 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_JUMP)) + if (P_SwitchShield(player, SH_WHIRLWIND)) S_StartSound(player->mo, actor->info->seesound); else S_StartSound(player->mo, sfx_itemup); @@ -3289,11 +3289,11 @@ void A_BombShield(mobj_t *actor) player = actor->target->player; // If you already have a bomb shield, use it! - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) P_BlackOw(player); // Now we know for certain that we don't have a bomb shield, so add one. :3 - P_SwitchShield(player, SH_BOMB); // will never return false, so no need for sound test + P_SwitchShield(player, SH_ARMAGEDDON); // will never return false, so no need for sound test S_StartSound(player->mo, actor->info->seesound); } @@ -3774,7 +3774,7 @@ void A_AttractChase(mobj_t *actor) // Turn flingrings back into regular rings if attracted. if (actor->tracer && actor->tracer->player - && !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) + && !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) { mobj_t *newring; newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime); @@ -3979,7 +3979,7 @@ void A_ThrownRing(mobj_t *actor) // A non-homing ring getting attracted by a // magnetic player. If he gets too far away, make // sure to stop the attraction! - if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC) && P_AproxDistance(P_AproxDistance(actor->tracer->x-actor->x, actor->tracer->y-actor->y), actor->tracer->z-actor->z) > FixedMul(RING_DIST/4, actor->tracer->scale))) { @@ -3987,7 +3987,7 @@ void A_ThrownRing(mobj_t *actor) } if (actor->tracer && (actor->tracer->health) - && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY))// Already found someone to follow. + && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC))// Already found someone to follow. { const INT32 temp = actor->threshold; actor->threshold = 32000; @@ -4055,7 +4055,7 @@ void A_ThrownRing(mobj_t *actor) if (!P_CheckSight(actor, player->mo)) continue; // out of sight - if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if ((player->powers[pw_shield] & SH_PROTECTELECTRIC) && dist < FixedMul(RING_DIST/4, player->mo->scale)) P_SetTarget(&actor->tracer, player->mo); return; diff --git a/src/p_floor.c b/src/p_floor.c index 3d18cc3bd..96d854a10 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1751,8 +1751,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node) case MT_ELEMENTAL_ORB: case MT_ATTRACT_ORB: case MT_FORCE_ORB: - case MT_BOMB_ORB: - case MT_JUMP_ORB: + case MT_ARMAGEDDON_ORB: + case MT_WHIRLWIND_ORB: case MT_PITY_ORB: case MT_FLAMEAURA_ORB: case MT_BUBBLEWRAP_ORB: diff --git a/src/p_inter.c b/src/p_inter.c index c5938c90e..822602fd8 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1582,7 +1582,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour else switch (inflictor->type) { case MT_PLAYER: - if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) str = M_GetText("%s%s's armageddon blast %s %s.\n"); else if (inflictor->player->powers[pw_invulnerability]) str = M_GetText("%s%s's invincibility aura %s %s.\n"); @@ -2791,7 +2791,7 @@ void P_RemoveShield(player_t *player) { // Second layer shields player->powers[pw_shield] = SH_NONE; } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) // Give them what's coming to them! + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them! { P_BlackOw(player); // BAM! player->pflags |= PF_JUMPDOWN; @@ -3033,7 +3033,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Invincible to fire damage break; case DMG_ELECTRIC: - if (player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if (player->powers[pw_shield] & SH_PROTECTELECTRIC) return false; // Invincible to electric damage break; default: diff --git a/src/p_map.c b/src/p_map.c index b3ad9b74f..bb904cc3d 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1052,6 +1052,8 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) { + boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + && (tmthing->player->pflags & PF_SHIELDABILITY)); if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) @@ -1059,11 +1061,12 @@ static boolean PIT_CheckThing(mobj_t *thing) && !(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) - && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)))) + && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)) + || elementalpierce)) { SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed. fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;; - boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY)); + fixed_t *z = &tmthing->z; // aau. P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor // Going down? Then bounce back up. if ((P_MobjWasRemoved(thing) // Monitor was removed @@ -1071,7 +1074,10 @@ static boolean PIT_CheckThing(mobj_t *thing) && (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up && !elementalpierce) // you're not piercing through the monitor... *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. - return false; + if (!(elementalpierce && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. + return false; + else + *z -= *momz; // to ensure proper collision. } } } diff --git a/src/p_mobj.c b/src/p_mobj.c index d87e3cc20..840d4aa49 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3250,14 +3250,6 @@ static void P_PlayerZMovement(mobj_t *mo) P_SetPlayerMobjState(mo, S_PLAY_FALL); clipmomz = false; } - else if (mo->player->powers[pw_shield] & SH_FORCE) // Force shield's dodge dash. - { - P_SetPlayerMobjState(mo, S_PLAY_WALK); - mo->flags &= ~MF_NOGRAVITY; - mo->player->pflags &= ~(PF_FULLSTASIS|PF_SPINNING); - mo->momx >>= 3; - mo->momy >>= 3; - } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; @@ -3619,7 +3611,7 @@ void P_MobjCheckWater(mobj_t *mobj) { if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability]))) { - if (p->powers[pw_shield] & SH_PROTECTELECTRICITY) + if (p->powers[pw_shield] & SH_PROTECTELECTRIC) { // Water removes electric shields... p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; P_FlashPal(p, PAL_WHITE, 1); @@ -6774,14 +6766,25 @@ void P_MobjThinker(mobj_t *mobj) && (mobj->target->target->player) && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mobj->target->target->player->pflags & PF_SHIELDABILITY) - && (mobj->state->nextstate < mobj->target->info->painstate)) // Special casing for elemental shield piercing attack. + && (mobj->state->nextstate < mobj->target->info->raisestate)) // Special casing for elemental shield piercing attack. { - P_SetMobjState(mobj, mobj->target->info->painstate); + P_SetMobjState(mobj, mobj->target->info->raisestate); + mobj->tics++; + } + else if ((mobj->target->type == MT_THUNDERCOIN_ORB) + && (mobj->target->target) + && (mobj->target->target->player) + && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN) + && (mobj->target->target->player->pflags & PF_SHIELDABILITY)) // Special casing for thundercoin shield jump.. + { + P_SetMobjState(mobj, mobj->target->info->raisestate); + P_SetMobjState(mobj->target, mobj->target->info->painstate); + mobj->target->target->player->pflags &= ~PF_SHIELDABILITY; mobj->tics++; } break; - case MT_BOMB_ORB: - case MT_JUMP_ORB: + case MT_ARMAGEDDON_ORB: + case MT_WHIRLWIND_ORB: case MT_ELEMENTAL_ORB: case MT_FORCE_ORB: case MT_PITY_ORB: diff --git a/src/p_user.c b/src/p_user.c index 589e5e3c7..85f640108 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -877,15 +877,6 @@ 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) { - if (player->mo - && player->powers[pw_shield] & SH_FORCE // Dash. - && player->pflags & PF_SHIELDABILITY) - { - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - player->mo->flags &= ~MF_NOGRAVITY; - player->pflags &= ~PF_FULLSTASIS; - } - player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; @@ -1351,8 +1342,8 @@ void P_SpawnShieldOrb(player_t *player) orbtype = MT_FORCE_ORB; else switch (player->powers[pw_shield] & SH_NOSTACK) { - case SH_JUMP: - orbtype = MT_JUMP_ORB; + case SH_WHIRLWIND: + orbtype = MT_WHIRLWIND_ORB; break; case SH_ATTRACT: orbtype = MT_ATTRACT_ORB; @@ -1360,8 +1351,8 @@ void P_SpawnShieldOrb(player_t *player) case SH_ELEMENTAL: orbtype = MT_ELEMENTAL_ORB; break; - case SH_BOMB: - orbtype = MT_BOMB_ORB; + case SH_ARMAGEDDON: + orbtype = MT_ARMAGEDDON_ORB; break; case SH_PITY: orbtype = MT_PITY_ORB; @@ -1473,14 +1464,6 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) { player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); // They'll still have PF_THOKKED... player->homing = 0; - if (player->powers[pw_shield] & SH_FORCE) // Dash. - { - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - player->mo->flags &= ~MF_NOGRAVITY; - player->pflags &= ~PF_FULLSTASIS; - player->mo->momx >>= 3; - player->mo->momy >>= 3; - } } if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER // it's implicit that the new shield isn't a fireflower @@ -3944,18 +3927,27 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) // void P_DoJumpShield(player_t *player) { + boolean electric = ((player->powers[pw_shield] & SH_PROTECTELECTRIC) == SH_PROTECTELECTRIC); + if (player->pflags & PF_THOKKED) return; player->pflags &= ~PF_JUMPED; P_DoJump(player, false); - player->pflags &= ~PF_JUMPED; - player->secondjump = 0; player->jumping = 0; + player->secondjump = 0; player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->pflags &= ~PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - S_StartSound(player->mo, sfx_wdjump); + if (electric) + { + S_StartSound(player->mo, sfx_s3k45); + } + else + { + player->pflags &= ~PF_JUMPED; + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + S_StartSound(player->mo, sfx_wdjump); + } } // @@ -4026,7 +4018,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) {} else if (onground || player->climbing || (player->mo->tracer && player->powers[pw_carry])) {} - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !(player->pflags & PF_JUMPED) && !(player->pflags & PF_USEDOWN)) P_DoJumpShield(player); @@ -4307,7 +4299,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) break; } } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP && !player->powers[pw_super]) + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !player->powers[pw_super]) P_DoJumpShield(player); } @@ -6993,79 +6985,58 @@ static void P_MovePlayer(player_t *player) { if (player->pflags & PF_JUMPED) // If the player is jumping { - if (!(player->pflags & PF_USEDOWN)) // If the player is not holding down BT_USE + pflags_t check = (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_THOKKED); + if (!(player->pflags & check)) // If the player is not holding down BT_USE, or having used an ability previously { - // Jump shield activation - if (!P_PlayerInPain(player) // If the player is not in pain - && !player->climbing // If the player is not climbing - && !(player->pflags & (PF_GLIDING|PF_SLIDING|PF_THOKKED)) // If the player is not gliding or sliding and hasn't used their ability - && !onground) // If the player isn't on the ground - { - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP && !player->powers[pw_super]) - P_DoJumpShield(player); - else if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_FLY) - { - P_DoJumpShield(player); - player->mo->momz *= 2; - } - } - // Bomb shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) - { - // Don't let Super Sonic or invincibility use it - if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) - P_BlackOw(player); - } - // Attract shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) - { - if (!(player->pflags & PF_THOKKED)) - { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->homing = 2; - if (P_LookForEnemies(player, false) && player->mo->tracer) - { - S_StartSound(player->mo, sfx_s3k40); - player->homing = 3*TICRATE; - } - else - S_StartSound(player->mo, sfx_s3k41); - } - } - // Elemental shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - { - if (!(player->pflags & PF_THOKKED)) - { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - S_StartSound(player->mo, sfx_s3k43); - player->mo->momx = player->mo->momy = 0; - P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); - } - } // Force shield activation if (player->powers[pw_shield] & SH_FORCE) + ; // TODO + else { - if (!(player->pflags & PF_THOKKED)) + switch (player->powers[pw_shield] & SH_NOSTACK) { - angle_t dashangle = player->mo->angle; -#if 1 // shadow.wad style redirection - hold down directional keys to set your path, go backwards by default - if (!(player->pflags & PF_ANALOGMODE) && (player->cmd.forwardmove || player->cmd.sidemove)) - dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<mo->momx || player->mo->momy) - dashangle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); -#endif - dashangle += ANGLE_180; - P_ResetPlayer(player); - player->homing = 2 + (player->powers[pw_shield] & SH_FORCEHP); // might get ridiculous with 256 hitpoints, don't you think? - S_StartSound(player->mo, sfx_s3k47); - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); - player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; - player->mo->flags |= MF_NOGRAVITY; - P_InstaThrust(player->mo, dashangle, 64*FRACUNIT); - player->mo->momz = 0; + // Whirlwind/Thundercoin shield activation + case SH_WHIRLWIND: + case SH_THUNDERCOIN: + if (!player->powers[pw_super]) + P_DoJumpShield(player); + break; + // Armageddon shield activation + case SH_ARMAGEDDON: + // Don't let Super Sonic or invincibility use it + if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) + P_BlackOw(player); + break; + // Attract shield activation + case SH_ATTRACT: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->homing = 2; + if (P_LookForEnemies(player, false) && player->mo->tracer) + { + S_StartSound(player->mo, sfx_s3k40); + player->homing = 3*TICRATE; + } + else + S_StartSound(player->mo, sfx_s3k45); + break; + // Elemental/Bubblewrap shield activation + case SH_ELEMENTAL: + case SH_BUBBLEWRAP: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momx = player->mo->momy = 0; + P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); + S_StartSound(player->mo, + ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + ? sfx_s3k43 + : sfx_s3k44); + break; + // Flame shield activation + case SH_FLAMEAURA: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + P_Thrust(player->mo, player->mo->angle, 30*player->mo->scale - FixedMul(FixedSqrt(player->speed), FixedSqrt(player->mo->scale))); + S_StartSound(player->mo, sfx_s3k43); + default: + break; } } } @@ -7084,26 +7055,7 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if (player->powers[pw_shield] & SH_FORCE // Dash. - && player->pflags & PF_SHIELDABILITY) - { - if (player->homing) - { - player->pflags |= PF_FULLSTASIS; - player->mo->momz = 0; - if (!(player->pflags & PF_SPINNING)) - player->homing = 0; - } - - if (player->homing == 0) - { - P_ResetPlayer(player); - player->pflags |= PF_THOKKED; // silly silly - player->mo->momx >>= 3; - player->mo->momy >>= 3; - } - } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT // Sonic 3D Blast. + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT // Sonic 3D Blast. && player->pflags & PF_SHIELDABILITY) { if (player->homing && player->mo->tracer) diff --git a/src/st_stuff.c b/src/st_stuff.c index 08d4204af..14c879c3e 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -811,9 +811,9 @@ static void ST_drawFirstPersonHUD(void) } else switch (player->powers[pw_shield] & SH_NOSTACK) { - case SH_JUMP: p = jumpshield; break; + case SH_WHIRLWIND: p = jumpshield; break; case SH_ELEMENTAL: p = watershield; break; - case SH_BOMB: p = bombshield; break; + case SH_ARMAGEDDON: p = bombshield; break; case SH_ATTRACT: p = ringshield; break; case SH_PITY: p = pityshield; break; case SH_FLAMEAURA: p = flameshield; break; From 76700241f675f900194e507a2a41feaf9ac6cc8b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 51/96] Leaky Mario mode bug fixed. --- src/p_inter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 822602fd8..3b8707e62 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2304,7 +2304,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) if (!mariodeathpit) { - target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + if (mariomode) + target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; target->momx = target->momy = target->momz = 0; } if (damagetype == DMG_DROWNED) // drowned From 76b30df52808bec5dff031b07527359b935d1f61 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 52/96] * Slower Bubblewrap animation. * Corrected bounce height for Elemental underwater. * Using Elemental ability in goo is cancelled. * Different Attract failure sound. --- src/info.c | 18 +++++++++--------- src/p_mobj.c | 9 ++++++++- src/p_user.c | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/info.c b/src/info.c index 56edd0b85..9aea3b3df 100644 --- a/src/info.c +++ b/src/info.c @@ -2175,15 +2175,15 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 - {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 - {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 - {SPR_BUBS, FF_TRANS30|2, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 - {SPR_BUBS, FF_TRANS30|3, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 - {SPR_BUBS, FF_TRANS30|4, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 - {SPR_BUBS, FF_TRANS30|5, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 - {SPR_BUBS, FF_TRANS30|6, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 - {SPR_BUBS, FF_TRANS30|7, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 - {SPR_BUBS, FF_TRANS30|8, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 + {SPR_BUBS, FF_TRANS30 , 3, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 + {SPR_BUBS, FF_TRANS30|1, 3, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 + {SPR_BUBS, FF_TRANS30|2, 3, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 + {SPR_BUBS, FF_TRANS30|3, 3, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 + {SPR_BUBS, FF_TRANS30|4, 3, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 + {SPR_BUBS, FF_TRANS30|5, 3, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 + {SPR_BUBS, FF_TRANS30|6, 3, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 + {SPR_BUBS, FF_TRANS30|7, 3, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 + {SPR_BUBS, FF_TRANS30|8, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 diff --git a/src/p_mobj.c b/src/p_mobj.c index 840d4aa49..8da0a2360 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3246,7 +3246,11 @@ static void P_PlayerZMovement(mobj_t *mo) S_StartSound(mo, sfx_s3k47); P_ElementalFire(mo->player, true); } - P_SetObjectMomZ(mo, 5*FRACUNIT/2, false); + P_SetObjectMomZ(mo, + (mo->eflags & MFE_UNDERWATER) + ? 6*FRACUNIT/5 + : 5*FRACUNIT/2, + false); P_SetPlayerMobjState(mo, S_PLAY_FALL); clipmomz = false; } @@ -3637,6 +3641,9 @@ void P_MobjCheckWater(mobj_t *mobj) // Then we'll set it! p->powers[pw_underwater] = underwatertics + 1; } + + if ((mobj->eflags & MFE_GOOWATER) && (p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (p->pflags & PF_SHIELDABILITY)) + p->pflags &= ~PF_SHIELDABILITY; } // The rest of this code only executes on a water state change. diff --git a/src/p_user.c b/src/p_user.c index 85f640108..adaacfaba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7017,7 +7017,7 @@ static void P_MovePlayer(player_t *player) player->homing = 3*TICRATE; } else - S_StartSound(player->mo, sfx_s3k45); + S_StartSound(player->mo, sfx_s3ka6); break; // Elemental/Bubblewrap shield activation case SH_ELEMENTAL: From c693af96b16bb1bdaf1e78b87d18e867fb7bcd13 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 14:03:32 +0100 Subject: [PATCH 53/96] * Bubble bounce completed (minus graphics). * Flame burst fixed with respect to scale. --- src/p_inter.c | 2 +- src/p_map.c | 3 ++- src/p_mobj.c | 10 +++++++++- src/p_user.c | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 3b8707e62..ce5209a41 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -295,7 +295,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; #endif - elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (player->pflags & PF_SHIELDABILITY)); + elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY)); if (special->flags & MF_BOSS) { diff --git a/src/p_map.c b/src/p_map.c index bb904cc3d..6c4ea979a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1052,7 +1052,8 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) { - boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL + || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (tmthing->player->pflags & PF_SHIELDABILITY)); if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) diff --git a/src/p_mobj.c b/src/p_mobj.c index 8da0a2360..87f40b2fc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3252,6 +3252,14 @@ static void P_PlayerZMovement(mobj_t *mo) : 5*FRACUNIT/2, false); P_SetPlayerMobjState(mo, S_PLAY_FALL); + mo->momx = mo->momy = 0; + clipmomz = false; + } + else if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) // Bubble shield's bounce attack. + { + S_StartSound(mo, sfx_s3k44); + P_DoJump(mo->player, false); + mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); clipmomz = false; } } @@ -3642,7 +3650,7 @@ void P_MobjCheckWater(mobj_t *mobj) p->powers[pw_underwater] = underwatertics + 1; } - if ((mobj->eflags & MFE_GOOWATER) && (p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (p->pflags & PF_SHIELDABILITY)) + if ((mobj->eflags & MFE_GOOWATER) && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)) p->pflags &= ~PF_SHIELDABILITY; } diff --git a/src/p_user.c b/src/p_user.c index adaacfaba..93823542d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7033,7 +7033,7 @@ static void P_MovePlayer(player_t *player) // Flame shield activation case SH_FLAMEAURA: player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - P_Thrust(player->mo, player->mo->angle, 30*player->mo->scale - FixedMul(FixedSqrt(player->speed), FixedSqrt(player->mo->scale))); + P_Thrust(player->mo, player->mo->angle, FixedMul(30*FRACUNIT - FixedSqrt(FixedDiv(player->speed, player->mo->scale)), player->mo->scale)); S_StartSound(player->mo, sfx_s3k43); default: break; From 366e282495ecec867b640fab0b8f705563adee66 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 14:39:32 +0100 Subject: [PATCH 54/96] Cleaned up the shield-ability stuff to be cleaner (and reduce MT_OVERLAY thinking). --- src/p_mobj.c | 63 +++++++++++++++++++++++++++++----------------------- src/p_user.c | 1 + 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 87f40b2fc..ba6e7cd41 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6776,50 +6776,57 @@ void P_MobjThinker(mobj_t *mobj) } else P_AddOverlay(mobj); - if ((mobj->target->type == MT_ELEMENTAL_ORB) - && (mobj->target->target) - && (mobj->target->target->player) - && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - && (mobj->target->target->player->pflags & PF_SHIELDABILITY) - && (mobj->state->nextstate < mobj->target->info->raisestate)) // Special casing for elemental shield piercing attack. - { - P_SetMobjState(mobj, mobj->target->info->raisestate); - mobj->tics++; - } - else if ((mobj->target->type == MT_THUNDERCOIN_ORB) - && (mobj->target->target) - && (mobj->target->target->player) - && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN) - && (mobj->target->target->player->pflags & PF_SHIELDABILITY)) // Special casing for thundercoin shield jump.. - { - P_SetMobjState(mobj, mobj->target->info->raisestate); - P_SetMobjState(mobj->target, mobj->target->info->painstate); - mobj->target->target->player->pflags &= ~PF_SHIELDABILITY; - mobj->tics++; - } break; - case MT_ARMAGEDDON_ORB: - case MT_WHIRLWIND_ORB: - case MT_ELEMENTAL_ORB: - case MT_FORCE_ORB: case MT_PITY_ORB: + case MT_WHIRLWIND_ORB: + case MT_ARMAGEDDON_ORB: + case MT_FORCE_ORB: case MT_FLAMEAURA_ORB: case MT_BUBBLEWRAP_ORB: - case MT_THUNDERCOIN_ORB: if (!P_AddShield(mobj)) return; break; case MT_ATTRACT_ORB: if (!P_AddShield(mobj)) return; - if ((mobj->target) + if (/*(mobj->target) -- the following is implicit by P_AddShield && (mobj->target->player) - && (mobj->target->player->homing)) + &&*/ (mobj->target->player->homing)) { P_SetMobjState(mobj, mobj->info->painstate); mobj->tics++; } break; + case MT_ELEMENTAL_ORB: + if (!P_AddShield(mobj)) + return; + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL*/ + && (mobj->target->player->pflags & PF_SHIELDABILITY) + && (mobj->tracer->state->nextstate < mobj->info->raisestate)) + { + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + } + break; + case MT_THUNDERCOIN_ORB: + if (!P_AddShield(mobj)) + return; + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN*/ + && (mobj->target->player->pflags & PF_SHIELDABILITY)) + { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal spark + } + break; case MT_WATERDROP: P_SceneryCheckWater(mobj); if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop) diff --git a/src/p_user.c b/src/p_user.c index 93823542d..28ddd364b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1398,6 +1398,7 @@ void P_SpawnShieldOrb(player_t *player) ov = P_SpawnMobj(shieldobj->x, shieldobj->y, shieldobj->z, MT_OVERLAY); P_SetTarget(&ov->target, shieldobj); P_SetMobjState(ov, shieldobj->info->seestate); + P_SetTarget(&shieldobj->tracer, ov); } if (shieldobj->info->meleestate) { From e107fe498b3c1384b1a02776b652caad3dcfefce Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 18:01:43 +0100 Subject: [PATCH 55/96] Adding new sounds for SRB2 shields. --- src/info.c | 10 +++++----- src/sounds.c | 9 +++++++-- src/sounds.h | 5 +++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/info.c b/src/info.c index 9aea3b3df..097b288fa 100644 --- a/src/info.c +++ b/src/info.c @@ -7086,7 +7086,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_FORCE_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_forcsg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7113,7 +7113,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ARMAGEDDON_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_s3k3e, // seesound + sfx_armasg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7140,7 +7140,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_WHIRLWIND_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_wirlsg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7167,7 +7167,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ELEMENTAL_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_s3k3f, // seesound + sfx_elemsg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -10853,7 +10853,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - SH_ARMAGEDDON, // speed + SH_ARMAGEDDON, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height 2, // display offset diff --git a/src/sounds.c b/src/sounds.c index 75ee1358c..b551b73b5 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -165,8 +165,12 @@ sfxinfo_t S_sfx[NUMSFX] = {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // generic GET! + {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Whirlwind GET! + {"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Force GET! + {"elemsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Elemental GET! + {"armasg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Armaggeddon GET! + {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // You LOSE! {"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -183,6 +187,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR}, {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Menu, interface {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 532c61da6..42fa4c308 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -229,6 +229,10 @@ typedef enum sfx_rail2, sfx_rlaunc, sfx_shield, + sfx_wirlsg, + sfx_forcsg, + sfx_elemsg, + sfx_armasg, sfx_shldls, sfx_spdpad, sfx_spkdth, @@ -246,6 +250,7 @@ typedef enum sfx_wdjump, sfx_mswarp, sfx_mspogo, + sfx_boingf, // Menu, interface sfx_chchng, From beecd72a220c6dd967648e3620077ef6e43b4c9c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 20:39:22 +0100 Subject: [PATCH 56/96] BUBBLE BOUNCE ANIMATION --- src/dehacked.c | 6 ++++++ src/info.c | 22 +++++++++++++++------- src/info.h | 6 ++++++ src/p_mobj.c | 40 ++++++++++++++++++++++++++++++++++------ 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index cfaa7b526..239e1fe42 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5457,11 +5457,17 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BUBS8", "S_BUBS9", + "S_BUBS10", + "S_BUBS11", + "S_BUBSB1", "S_BUBSB2", "S_BUBSB3", "S_BUBSB4", + "S_BUBSB5", + "S_BUBSB6", + "S_ZAPS1", "S_ZAPS2", "S_ZAPS3", diff --git a/src/info.c b/src/info.c index 097b288fa..92d02a0a0 100644 --- a/src/info.c +++ b/src/info.c @@ -2096,6 +2096,7 @@ state_t states[NUMSTATES] = {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_MAGN11}, // S_MAGN10 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_MAGN12}, // S_MAGN11 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN12 + {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS10|12, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN13 {SPR_FORC, FF_TRANS50 , 3, {NULL}, 0, 0, S_FORC2 }, // S_FORC1 @@ -2141,6 +2142,7 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7 }, // S_ELEMF6 {SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8 }, // S_ELEMF7 {SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF8 + {SPR_ELEM, FF_FULLBRIGHT|20, 1, {NULL}, 0, 0, S_ELEMF10}, // S_ELEMF9 {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF10 @@ -2185,10 +2187,16 @@ state_t states[NUMSTATES] = {SPR_BUBS, FF_TRANS30|7, 3, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 {SPR_BUBS, FF_TRANS30|8, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 - {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 - {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 - {SPR_BUBS, FF_TRANS30|11, 2, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3 - {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4 + {SPR_NULL, 0, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS10 + {SPR_NULL, 0, 4*3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS11 + + {SPR_BUBS, FF_TRANS30| 9, 3, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 + {SPR_BUBS, FF_TRANS30|10, 3, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 + {SPR_BUBS, FF_TRANS30|11, 3, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3 + {SPR_BUBS, FF_TRANS30|10, 3, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4 + + {SPR_BUBS, FF_TRANS30|12, 3, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB5 + {SPR_BUBS, FF_TRANS30|13, 3, {NULL}, 0, 0, S_BUBSB5}, // S_BUBSB6 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2 @@ -10953,7 +10961,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_BUBSB5, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10964,12 +10972,12 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_BUBBLEWRAP, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - -2, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_BUBS10 // raisestate }, { // MT_THUNDERCOIN_ORB diff --git a/src/info.h b/src/info.h index a18a374d9..2ae93f4c1 100644 --- a/src/info.h +++ b/src/info.h @@ -2371,11 +2371,17 @@ typedef enum state S_BUBS8, S_BUBS9, + S_BUBS10, + S_BUBS11, + S_BUBSB1, S_BUBSB2, S_BUBSB3, S_BUBSB4, + S_BUBSB5, + S_BUBSB6, + S_ZAPS1, S_ZAPS2, S_ZAPS3, diff --git a/src/p_mobj.c b/src/p_mobj.c index ba6e7cd41..e929b8426 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6782,7 +6782,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_ARMAGEDDON_ORB: case MT_FORCE_ORB: case MT_FLAMEAURA_ORB: - case MT_BUBBLEWRAP_ORB: if (!P_AddShield(mobj)) return; break; @@ -6791,7 +6790,7 @@ void P_MobjThinker(mobj_t *mobj) return; if (/*(mobj->target) -- the following is implicit by P_AddShield && (mobj->target->player) - &&*/ (mobj->target->player->homing)) + && */ (mobj->target->player->homing)) { P_SetMobjState(mobj, mobj->info->painstate); mobj->tics++; @@ -6803,21 +6802,50 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield && mobj->target->player - && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL*/ - && (mobj->target->player->pflags & PF_SHIELDABILITY) - && (mobj->tracer->state->nextstate < mobj->info->raisestate)) + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL */ + && mobj->target->player->pflags & PF_SHIELDABILITY + && ((statenum_t)(mobj->tracer->state-states) < mobj->info->raisestate + || (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1))) { P_SetMobjState(mobj->tracer, mobj->info->raisestate); mobj->tracer->tics++; } break; + case MT_BUBBLEWRAP_ORB: + if (!P_AddShield(mobj)) + return; + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP */ + ) + { + if (mobj->target->player->pflags & PF_SHIELDABILITY + && ((statenum_t)(mobj->state-states) < mobj->info->painstate + || (mobj->state->nextstate < mobj->info->painstate && mobj->tics == 1))) + { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + } + else if (mobj->target->eflags & MFE_JUSTHITFLOOR + && (statenum_t)(mobj->state-states) == mobj->info->painstate) + { + P_SetMobjState(mobj, mobj->info->painstate+1); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate+1); + mobj->tracer->tics++; + } + } + break; case MT_THUNDERCOIN_ORB: if (!P_AddShield(mobj)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield && mobj->target->player - && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN*/ + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN */ && (mobj->target->player->pflags & PF_SHIELDABILITY)) { P_SetMobjState(mobj, mobj->info->painstate); From 51ffa6d5eaa50aee99a4953933da4052c4d9d45c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 21:23:58 +0100 Subject: [PATCH 57/96] Kill an overlay if the target is removed between P_AddOverlay and P_RunOverlays. --- src/p_mobj.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index e929b8426..1541ea79c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6499,6 +6499,13 @@ void P_RunOverlays(void) if (!mo->target) continue; + + if (P_MobjWasRemoved(mo->target)) + { + P_RemoveMobj(mo); + continue; + } + if (!splitscreen /*&& rendermode != render_soft*/) { angle_t viewingangle; From 0e73924ebbb52f5e19560bcde265c3c39c5db676 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 21:24:10 +0100 Subject: [PATCH 58/96] Changed the pity shield sound to one with a higher volume. --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 92d02a0a0..b563c71fd 100644 --- a/src/info.c +++ b/src/info.c @@ -7040,7 +7040,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_PITY_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3a, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate From 9b4c81ed0bbd4cd4115c796604b286f27c4e5d49 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 23:22:04 +0100 Subject: [PATCH 59/96] Thundercoin shield complete. --- src/dehacked.c | 6 +++++- src/info.c | 30 ++++++++++++++++++++++++++++++ src/info.h | 6 +++++- src/p_user.c | 18 +++++++++++++++++- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 239e1fe42..8c6147424 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5497,6 +5497,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ZAPSB10", "S_ZAPSB11", // blank frame + // Thunder spark + "S_THUNDERCOIN_SPARK", + // Invincibility Sparkles "S_IVSP", @@ -6523,7 +6526,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FLAMEAURA_ORB", // Flame shield mobj "MT_BUBBLEWRAP_ORB", // Bubble shield mobj "MT_THUNDERCOIN_ORB", // Thunder shield mobj - "MT_IVSP", // invincibility sparkles + "MT_THUNDERCOIN_SPARK", // Thunder spark + "MT_IVSP", // Invincibility sparkles "MT_SUPERSPARK", // Super Sonic Spark // Freed Animals diff --git a/src/info.c b/src/info.c index b563c71fd..85630766a 100644 --- a/src/info.c +++ b/src/info.c @@ -2227,6 +2227,9 @@ state_t states[NUMSTATES] = {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPSB11}, // S_ZAPSB10 {SPR_NULL, 0, 15*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB11 + // Thunder spark + {SPR_SSPK, FF_ANIMATE, 18, {NULL}, 1, 2, S_NULL}, // S_THUNDERCOIN_SPARK + // Invincibility Sparkles {SPR_IVSP, FF_ANIMATE, 32, {NULL}, 31, 1, S_NULL}, // S_IVSP @@ -11007,6 +11010,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ZAPS14 // raisestate }, + { // MT_THUNDERCOIN_SPARK + -1, // doomednum + S_THUNDERCOIN_SPARK, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 4*FRACUNIT, // radius + 4*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + { // MT_IVSP -1, // doomednum S_IVSP, // spawnstate diff --git a/src/info.h b/src/info.h index 2ae93f4c1..618e848c5 100644 --- a/src/info.h +++ b/src/info.h @@ -2411,6 +2411,9 @@ typedef enum state S_ZAPSB10, S_ZAPSB11, // blank frame + //Thunder spark + S_THUNDERCOIN_SPARK, + // Invincibility Sparkles S_IVSP, @@ -3456,7 +3459,8 @@ typedef enum mobj_type MT_FLAMEAURA_ORB, // Flame shield mobj MT_BUBBLEWRAP_ORB, // Bubble shield mobj MT_THUNDERCOIN_ORB, // Thunder shield mobj - MT_IVSP, // invincibility sparkles + MT_THUNDERCOIN_SPARK, // Thunder spark + MT_IVSP, // Invincibility sparkles MT_SUPERSPARK, // Super Sonic Spark // Freed Animals diff --git a/src/p_user.c b/src/p_user.c index 28ddd364b..2deda6d60 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3941,6 +3941,20 @@ void P_DoJumpShield(player_t *player) player->pflags &= ~PF_SPINNING; if (electric) { + mobj_t *spark; + INT32 i; +#define numangles 6 +#define limitangle (360/numangles) + angle_t travelangle = player->mo->angle + P_RandomRange(-limitangle, limitangle)*ANG1; + for (i = 0; i < numangles; i++) + { + spark = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_THUNDERCOIN_SPARK); + P_InstaThrust(spark, travelangle + i*(ANGLE_MAX/numangles), FixedMul(4*FRACUNIT, spark->scale)); + if (i % 2) + P_SetObjectMomZ(spark, -4*FRACUNIT, false); + } +#undef limitangle +#undef numangles S_StartSound(player->mo, sfx_s3k45); } else @@ -6304,8 +6318,9 @@ void P_ElementalFire(player_t *player, boolean cropcircle) if (cropcircle) { - travelangle = player->mo->angle + P_RandomRange(-ANGLE_45, ANGLE_45); #define numangles 8 +#define limitangle (180/numangles) + travelangle = player->mo->angle + P_RandomRange(-limitangle, limitangle)*ANG1; for (i = 0; i < numangles; i++) { flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_SPINFIRE); @@ -6319,6 +6334,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) P_InstaThrust(flame, flame->angle, FixedMul(3*FRACUNIT, flame->scale)); P_SetObjectMomZ(flame, 3*FRACUNIT, false); } +#undef limitangle #undef numangles } else From 8fe932b0e7656ce3541713d77aa9ea6373961b65 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 00:33:12 +0100 Subject: [PATCH 60/96] * Force shield force stop completed * Bubblewrap shield bounce now no longer allows thokking post-bounce, but still allows bouncing * plus a bunch of tiny changes to clean up code around the place. --- src/d_player.h | 6 ++--- src/p_enemy.c | 2 +- src/p_inter.c | 2 +- src/p_mobj.c | 63 +++++++++++++++++++++++++++++++++++++------------- src/p_user.c | 17 +++++++++++--- 5 files changed, 66 insertions(+), 24 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 54960115f..e5e296f17 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -188,7 +188,7 @@ typedef enum SH_PROTECTELECTRIC = 0x1000, // Indivisible shields - SH_PITY = 1, + SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match SH_WHIRLWIND, SH_ARMAGEDDON, SH_FIREFLOWER, @@ -377,8 +377,8 @@ typedef struct player_s UINT8 gotcontinue; // Got continue from this stage? fixed_t speed; // Player's speed (distance formula of MOMX and MOMY values) - UINT8 jumping; // Jump counter - UINT8 secondjump; + UINT8 jumping; // Holding down jump button + UINT8 secondjump; // Jump counter UINT8 fly1; // Tails flying UINT8 scoreadd; // Used for multiple enemy attack bonus diff --git a/src/p_enemy.c b/src/p_enemy.c index cde3f6310..e94a936a2 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3348,7 +3348,7 @@ void A_ForceShield(mobj_t *actor) return; } - if (locvar1 < 0 || locvar1 > SH_FORCEHP) + if (locvar1 & ~SH_FORCEHP) { CONS_Debug(DBG_GAMELOGIC, "Invalid number of additional hitpoints.\n"); return; diff --git a/src/p_inter.c b/src/p_inter.c index ce5209a41..e3523d29d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2784,7 +2784,7 @@ void P_RemoveShield(player_t *player) if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit if ((player->powers[pw_shield] & SH_FORCEHP) == 0) - player->powers[pw_shield] &= ~SH_FORCE; + player->powers[pw_shield] &= SH_STACK; else player->powers[pw_shield]--; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 1541ea79c..5af16f0ff 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3235,8 +3235,16 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; + mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); + mo->player->secondjump = 0; + mo->player->glidetime = 0; + mo->player->climbing = 0; + mo->player->powers[pw_tailsfly] = 0; + if (mo->player->pflags & PF_SHIELDABILITY) { + mo->player->pflags &= ~PF_SHIELDABILITY; + if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) // Elemental shield's stomp attack. { if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound @@ -3259,16 +3267,14 @@ static void P_PlayerZMovement(mobj_t *mo) { S_StartSound(mo, sfx_s3k44); P_DoJump(mo->player, false); + mo->player->pflags |= PF_THOKKED; + mo->player->secondjump = UINT8_MAX; mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); clipmomz = false; } } - mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); - mo->player->jumping = 0; - mo->player->secondjump = 0; - mo->player->glidetime = 0; - mo->player->climbing = 0; - mo->player->powers[pw_tailsfly] = 0; + + mo->player->jumping = 0; // done down here because of bubblewrap } } if (!(mo->player->pflags & PF_SPINNING)) @@ -3623,15 +3629,19 @@ void P_MobjCheckWater(mobj_t *mobj) { if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability]))) { - if (p->powers[pw_shield] & SH_PROTECTELECTRIC) - { // Water removes electric shields... + boolean electric = !!(p->powers[pw_shield] & SH_PROTECTELECTRIC); +#define SH_OP (SH_PROTECTFIRE|SH_PROTECTWATER|SH_PROTECTELECTRIC) + if ((p->powers[pw_shield] & SH_OP) == SH_OP) // No. + P_KillMobj(mobj, NULL, NULL, DMG_INSTAKILL); +#undef SH_OP + else if (electric || ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER))) + { // Water removes electric and non-water fire shields... + P_FlashPal(p, + electric + ? PAL_WHITE + : PAL_NUKE, + 1); p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; - P_FlashPal(p, PAL_WHITE, 1); - } - else if ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER)) - { // ...and fire-only shields. - p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; - P_FlashPal(p, PAL_NUKE, 1); } } @@ -3651,7 +3661,10 @@ void P_MobjCheckWater(mobj_t *mobj) } if ((mobj->eflags & MFE_GOOWATER) && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)) + { p->pflags &= ~PF_SHIELDABILITY; + mobj->momz >>= 1; + } } // The rest of this code only executes on a water state change. @@ -6683,7 +6696,7 @@ void P_MobjThinker(mobj_t *mobj) fixed_t oldheight = mobj->height; UINT8 correctionType = 0; // Don't correct Z position, just gain height - if (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz + if ((mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz)) && mobj->type != MT_EGGMOBILE_FIRE) correctionType = 1; // Correct Z position by centering else if (mobj->eflags & MFE_VERTICALFLIP) @@ -6787,7 +6800,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_PITY_ORB: case MT_WHIRLWIND_ORB: case MT_ARMAGEDDON_ORB: - case MT_FORCE_ORB: case MT_FLAMEAURA_ORB: if (!P_AddShield(mobj)) return; @@ -6818,6 +6830,25 @@ void P_MobjThinker(mobj_t *mobj) mobj->tracer->tics++; } break; + case MT_FORCE_ORB: + if (!P_AddShield(mobj)) + return; + if (/* + && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_FORCE) + && */ (mobj->target->player->pflags & PF_SHIELDABILITY)) + { + mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); + whoosh->sprite = SPR_FORC; + whoosh->frame = 20|(tr_trans50<destscale = whoosh->scale<<1; + whoosh->fuse = 10; + whoosh->tics = -1; + whoosh->flags |= MF_NOCLIPHEIGHT; + whoosh->height = 42*FRACUNIT; + mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh + } case MT_BUBBLEWRAP_ORB: if (!P_AddShield(mobj)) return; diff --git a/src/p_user.c b/src/p_user.c index 2deda6d60..18f804a9e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7002,12 +7002,22 @@ static void P_MovePlayer(player_t *player) { if (player->pflags & PF_JUMPED) // If the player is jumping { - pflags_t check = (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_THOKKED); - if (!(player->pflags & check)) // If the player is not holding down BT_USE, or having used an ability previously + if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously + && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { // Force shield activation if (player->powers[pw_shield] & SH_FORCE) - ; // TODO + { +//#define PERFECTFORCESTOP + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momx = player->mo->momy = 0; +#if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible + P_SetObjectMomZ(player->mo, -4*P_GetMobjGravity(player->mo), false); +#else + player->mo->momz = 0; +#endif + S_StartSound(player->mo, sfx_ngskid); + } else { switch (player->powers[pw_shield] & SH_NOSTACK) @@ -7040,6 +7050,7 @@ static void P_MovePlayer(player_t *player) case SH_ELEMENTAL: case SH_BUBBLEWRAP: player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->secondjump = 0; player->mo->momx = player->mo->momy = 0; P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); S_StartSound(player->mo, From c1a8dd9a371816374c03a0029502313785b3bbc4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 13:44:03 +0100 Subject: [PATCH 61/96] Minor refactor of what I did last night - as a modifiable state instead of hardcoded references. --- src/dehacked.c | 2 ++ src/info.c | 4 +++- src/info.h | 2 ++ src/p_mobj.c | 6 ++---- src/p_user.c | 5 ++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8c6147424..e8f29e03e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5392,6 +5392,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FORC19", "S_FORC20", + "S_FORC21", + "S_ELEM1", "S_ELEM2", "S_ELEM3", diff --git a/src/info.c b/src/info.c index 85630766a..42706cc8d 100644 --- a/src/info.c +++ b/src/info.c @@ -2121,6 +2121,8 @@ state_t states[NUMSTATES] = {SPR_FORC, FF_TRANS50|18, 3, {NULL}, 0, 0, S_FORC20}, // S_FORC19 {SPR_FORC, FF_TRANS50|19, 3, {NULL}, 0, 0, S_FORC11}, // S_FORC20 + {SPR_FORC, FF_TRANS50|20, -1, {NULL}, 0, 0, S_NULL}, // S_FORC21 + {SPR_ELEM, FF_TRANS50 , 4, {NULL}, 0, 0, S_ELEM2 }, // S_ELEM1 {SPR_ELEM, FF_TRANS50| 1, 4, {NULL}, 0, 0, S_ELEM3 }, // S_ELEM2 {SPR_ELEM, FF_TRANS50| 2, 4, {NULL}, 0, 0, S_ELEM4 }, // S_ELEM3 @@ -10845,7 +10847,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_FORC21 // raisestate }, { // MT_ARMAGEDDON_ORB diff --git a/src/info.h b/src/info.h index 618e848c5..8624f13a0 100644 --- a/src/info.h +++ b/src/info.h @@ -2306,6 +2306,8 @@ typedef enum state S_FORC19, S_FORC20, + S_FORC21, + S_ELEM1, S_ELEM2, S_ELEM3, diff --git a/src/p_mobj.c b/src/p_mobj.c index 5af16f0ff..77952c269 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6839,12 +6839,10 @@ void P_MobjThinker(mobj_t *mobj) && (mobj->target->player->powers[pw_shield] & SH_FORCE) && */ (mobj->target->player->pflags & PF_SHIELDABILITY)) { - mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); - whoosh->sprite = SPR_FORC; - whoosh->frame = 20|(tr_trans50<info->raisestate); whoosh->destscale = whoosh->scale<<1; whoosh->fuse = 10; - whoosh->tics = -1; whoosh->flags |= MF_NOCLIPHEIGHT; whoosh->height = 42*FRACUNIT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh diff --git a/src/p_user.c b/src/p_user.c index 18f804a9e..8b871f72b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7008,14 +7008,13 @@ static void P_MovePlayer(player_t *player) // Force shield activation if (player->powers[pw_shield] & SH_FORCE) { -//#define PERFECTFORCESTOP player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->mo->momx = player->mo->momy = 0; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible P_SetObjectMomZ(player->mo, -4*P_GetMobjGravity(player->mo), false); #else - player->mo->momz = 0; + player->mo->momz = // intentionally carries to post-endif line as multiple-assignment #endif + player->mo->momx = player->mo->momy = 0; S_StartSound(player->mo, sfx_ngskid); } else From 59fccab8e50aa4cc2227952e6af35357dd625d3d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 20:55:15 +0100 Subject: [PATCH 62/96] Restructured things so nojumpdamage characters can use the elemental, bubblewrap and attract shields. --- src/d_player.h | 5 ++++- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 1 + src/p_inter.c | 6 +++--- src/p_map.c | 8 ++++---- src/p_mobj.c | 4 +++- src/p_user.c | 14 ++++++++++++-- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index e5e296f17..4f9833fa0 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -154,7 +154,10 @@ typedef enum PF_CANCARRY = 1<<27, // Used shield ability - PF_SHIELDABILITY = 1<<28 + PF_SHIELDABILITY = 1<<28, + + // Do jump damage? + PF_JUMPDAMAGE = 1<<29 // free up to and including 1<<31 } pflags_t; diff --git a/src/lua_hook.h b/src/lua_hook.h index bed32edac..e0f08d175 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -43,6 +43,7 @@ enum hook { hook_PlayerMsg, hook_HurtMsg, hook_PlayerSpawn, + hook_ShieldSpawn, hook_MAX // last hook }; @@ -77,5 +78,6 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer +#define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1b9652571..1065f193a 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -54,6 +54,7 @@ const char *const hookNames[hook_MAX+1] = { "PlayerMsg", "HurtMsg", "PlayerSpawn", + "ShieldSpawn", NULL }; diff --git a/src/p_inter.c b/src/p_inter.c index e3523d29d..ddbac5ed3 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->charflags & SF_NOJUMPDAMAGE && !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (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->charflags & SF_NOJUMPDAMAGE && !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (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->charflags & SF_NOJUMPDAMAGE)) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (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 6c4ea979a..d924ad564 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1058,8 +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->charflags & SF_NOJUMPDAMAGE - && !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) + && (tmthing->player->pflags & PF_JUMPDAMAGE + || (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) && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)) @@ -1093,8 +1093,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->charflags & SF_NOJUMPDAMAGE - && !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) + && (tmthing->player->pflags & PF_JUMPDAMAGE + || (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) && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0))) diff --git a/src/p_mobj.c b/src/p_mobj.c index 77952c269..40683a991 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; + mo->player->pflags &= ~(PF_JUMPED|PF_JUMPDAMAGE); mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); mo->player->secondjump = 0; @@ -3267,6 +3267,8 @@ static void P_PlayerZMovement(mobj_t *mo) { S_StartSound(mo, sfx_s3k44); P_DoJump(mo->player, false); + if (mo->player->charflags & SF_NOJUMPSPIN) + P_SetPlayerMobjState(mo, S_PLAY_FALL); mo->player->pflags |= PF_THOKKED; mo->player->secondjump = UINT8_MAX; mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); diff --git a/src/p_user.c b/src/p_user.c index 8b871f72b..1ddb7a25c 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_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_JUMPDAMAGE|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; @@ -1338,6 +1338,11 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif +#ifdef HAVE_BLUA + if (LUAh_ShieldSpawn(player)) + return; +#endif + if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_FORCE_ORB; else switch (player->powers[pw_shield] & SH_NOSTACK) @@ -3761,6 +3766,8 @@ 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) { @@ -7039,6 +7046,8 @@ static void P_MovePlayer(player_t *player) player->homing = 2; if (P_LookForEnemies(player, false) && player->mo->tracer) { + player->pflags |= PF_JUMPDAMAGE; + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); S_StartSound(player->mo, sfx_s3k40); player->homing = 3*TICRATE; } @@ -7048,7 +7057,8 @@ static void P_MovePlayer(player_t *player) // Elemental/Bubblewrap shield activation case SH_ELEMENTAL: case SH_BUBBLEWRAP: - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->pflags |= PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY; + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->secondjump = 0; player->mo->momx = player->mo->momy = 0; P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); From 769962c884e025f1ad1aaf7ed325f2cfc8eb0cdf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 21:15:41 +0100 Subject: [PATCH 63/96] Minor cleanup. --- src/p_user.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 1ddb7a25c..c4b810414 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1446,10 +1446,6 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) ? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE)) : ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype); - boolean stopshieldability = (shieldtype & SH_FORCE) - ? (!(player->powers[pw_shield] & SH_FORCE)) - : true; - if (mariomode) { mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); @@ -1459,6 +1455,10 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) if (donthavealready) { + boolean stopshieldability = (shieldtype & SH_FORCE) + ? (!(player->powers[pw_shield] & SH_FORCE)) + : true; + if (mariomode) { player->mo->movecount = player->powers[pw_shield]; @@ -7013,7 +7013,7 @@ static void P_MovePlayer(player_t *player) && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { // Force shield activation - if (player->powers[pw_shield] & SH_FORCE) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible @@ -8177,9 +8177,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); } - if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) - camspeed <<= 1; - #ifdef REDSANALOG if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) { camstill = true; From f145898ca4c60cf9ad7c18c16979b4e6c8bb9648 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 21:39:58 +0100 Subject: [PATCH 64/96] Woops. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index c4b810414..c2115ff7d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7013,7 +7013,7 @@ static void P_MovePlayer(player_t *player) && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { // Force shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FORCE) + if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible From a053b117e18bb806753632551c4c82b13728cc48 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:08:32 +0100 Subject: [PATCH 65/96] Moved the Super Sonic hover over to holding down the jump button (which conveniently links it pretty closely to the thok, which could be called the Float Thok or something I dunno.) Also, only one shield ability is selectively blocked by being Super now, and that's because Invincibility does it too and therefore I assume that's a match balance thing instead of a keyboard clash. --- src/p_user.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index c2115ff7d..794f2b5a8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4361,10 +4361,10 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->secondjump = 2; - // If letting go of the jump button while still on ascent, cut the jump height. - if (player->pflags & PF_JUMPED && P_MobjFlip(player->mo)*player->mo->momz > 0 && player->jumping == 1) + if (player->pflags & PF_JUMPED && player->jumping == 1) { - player->mo->momz >>= 1; + if (P_MobjFlip(player->mo)*player->mo->momz > 0) + player->mo->momz >>= 1; // If letting go of the jump button while still on ascent, cut the jump height. player->jumping = 0; } } @@ -7005,9 +7005,9 @@ static void P_MovePlayer(player_t *player) //STUFF! // /////////////////////////// - if (cmd->buttons & BT_USE) // Spin button effects + if (player->pflags & PF_JUMPED) { - if (player->pflags & PF_JUMPED) // If the player is jumping + if (cmd->buttons & BT_USE) // Spin button effects { if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped @@ -7031,8 +7031,7 @@ static void P_MovePlayer(player_t *player) // Whirlwind/Thundercoin shield activation case SH_WHIRLWIND: case SH_THUNDERCOIN: - if (!player->powers[pw_super]) - P_DoJumpShield(player); + P_DoJumpShield(player); break; // Armageddon shield activation case SH_ARMAGEDDON: @@ -7077,7 +7076,9 @@ static void P_MovePlayer(player_t *player) } } } - // Super Sonic move + } + else if (cmd->buttons & BT_JUMP && !player->jumping) // Super Sonic move + { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { From b34dc93a18c6fa3f3aeda4474a2dd855089ebd88 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:31:44 +0100 Subject: [PATCH 66/96] Fix to the previous commit to basically do what I wanted it to do as opposed to accidentially altering behaviour of jumping on crawlas. --- src/p_user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 794f2b5a8..b7e847619 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4361,10 +4361,10 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->secondjump = 2; - if (player->pflags & PF_JUMPED && player->jumping == 1) + // If letting go of the jump button while still on ascent, cut the jump height. + if (player->pflags & PF_JUMPED && P_MobjFlip(player->mo)*player->mo->momz > 0 && player->jumping == 1) { - if (P_MobjFlip(player->mo)*player->mo->momz > 0) - player->mo->momz >>= 1; // If letting go of the jump button while still on ascent, cut the jump height. + player->mo->momz >>= 1; player->jumping = 0; } } @@ -7077,7 +7077,7 @@ static void P_MovePlayer(player_t *player) } } } - else if (cmd->buttons & BT_JUMP && !player->jumping) // Super Sonic move + else if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) From 4c0ef9f0a35c6c799c03d09a65e215072d396c3c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:48:41 +0100 Subject: [PATCH 67/96] * No ridiculously-fast float animation. * No falling when you accidentially press spin. --- src/p_user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index b7e847619..71e6ad021 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7077,12 +7077,13 @@ static void P_MovePlayer(player_t *player) } } } - else if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move + + if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { - if (player->panim == PA_ROLL || player->panim == PA_JUMP || player->mo->state-states == S_PLAY_PAIN || player->panim == PA_WALK) + if (player->panim == PA_JUMP || player->panim == PA_FALL) P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); player->mo->momz = 0; From bda630ce41b1791e271e132160028e575d64abc5 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:57:59 +0100 Subject: [PATCH 68/96] I could do better than the previous commit. --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 71e6ad021..705a797c2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7083,7 +7083,8 @@ static void P_MovePlayer(player_t *player) if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { - if (player->panim == PA_JUMP || player->panim == PA_FALL) + if (player->mo->state-states == S_PLAY_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL + || (player->panim == PA_WALK && player->mo->state-states != S_PLAY_SUPER_FLOAT)) P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); player->mo->momz = 0; From 6abd4d20d3a724c661118b734b6606b89d883f08 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 12:31:06 +0100 Subject: [PATCH 69/96] Further tightening. --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 705a797c2..10476a5d3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7078,7 +7078,7 @@ static void P_MovePlayer(player_t *player) } } - if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move + if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED) && !player->homing) // Super Sonic move { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) @@ -7088,7 +7088,7 @@ static void P_MovePlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); player->mo->momz = 0; - player->pflags &= ~PF_SPINNING; + player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); player->jumping = 0; // don't cut jump height after bouncing off something } } From 5ad7fc8495da56b6566b4195644ad496189b8904 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 12:34:16 +0100 Subject: [PATCH 70/96] A better check than for skin==0. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 10476a5d3..6bf5b80b2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7080,7 +7080,7 @@ static void P_MovePlayer(player_t *player) if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED) && !player->homing) // Super Sonic move { - if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) + if ((player->charability == CA_THOK) && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { if (player->mo->state-states == S_PLAY_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL From 8720252059542523a895a22a207d157925cb965f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 14:42:37 +0100 Subject: [PATCH 71/96] Thorough jumpdamage setting. --- src/p_map.c | 4 +++- src/p_spec.c | 4 ++++ src/p_user.c | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d924ad564..fe9cecdba 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -203,7 +203,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } } - pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. + pflags = object->player->pflags & (PF_JUMPED|PF_JUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. jumping = object->player->jumping; secondjump = object->player->secondjump; P_ResetPlayer(object->player); @@ -211,6 +211,8 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->info->painchance) { object->player->pflags |= PF_JUMPED; + if (!(object->player->charflags & SF_NOJUMPDAMAGE)) + object->player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(object, S_PLAY_JUMP); } else if (P_MobjFlip(object)*vertispeed > 0) diff --git a/src/p_spec.c b/src/p_spec.c index 617bc6abe..2284fdadf 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7533,7 +7533,11 @@ void T_Pusher(pusher_t *p) P_ResetPlayer (thing->player); if (jumped) + { thing->player->pflags |= PF_JUMPED; + if (!(thing->player->charflags & SF_NOJUMPDAMAGE)) + thing->player->pflags |= PF_JUMPDAMAGE; + } thing->player->pflags |= PF_SLIDING; P_SetPlayerMobjState (thing, thing->info->painstate); // Whee! diff --git a/src/p_user.c b/src/p_user.c index 6bf5b80b2..4c0b23aca 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -577,7 +577,7 @@ static void P_DeNightserizePlayer(player_t *player) player->pflags &= ~PF_NIGHTSMODE; player->powers[pw_underwater] = 0; - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); player->secondjump = 0; player->jumping = 0; player->homing = 0; @@ -650,7 +650,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) if (!(player->pflags & PF_NIGHTSMODE)) player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox. - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); player->homing = 0; player->mo->fuse = 0; player->speed = 0; @@ -1677,6 +1677,8 @@ void P_DoPlayerExit(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->powers[pw_underwater] = 0; @@ -1997,6 +1999,8 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; player->pflags |= PF_THOKKED; } } @@ -2008,8 +2012,9 @@ static void P_CheckBouncySectors(player_t *player) if (player->pflags & PF_SPINNING) { player->pflags &= ~PF_SPINNING; - player->pflags |= PF_JUMPED; - player->pflags |= PF_THOKKED; + player->pflags |= (PF_JUMPED|PF_THOKKED); + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; } } @@ -2017,6 +2022,8 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; } goto bouncydone; @@ -2760,6 +2767,8 @@ static void P_DoClimbing(player_t *player) player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2767,6 +2776,8 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -2774,6 +2785,8 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2792,6 +2805,8 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); P_SetObjectMomZ(player->mo, 4*FRACUNIT, false); P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale)); @@ -6712,6 +6727,8 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->pflags &= ~PF_GLIDING; @@ -6769,6 +6786,8 @@ static void P_MovePlayer(player_t *player) || (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_GLIDEANDCLIMB)) { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } else @@ -6839,6 +6858,8 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -7488,6 +7509,8 @@ static void P_DoRopeHang(player_t *player) P_SetTarget(&player->mo->tracer, NULL); player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; player->powers[pw_carry] = CR_NONE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) @@ -7586,6 +7609,8 @@ static void P_DoRopeHang(player_t *player) if (player->mo->tracer->flags & MF_SLIDEME) { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) && !(player->panim == PA_JUMP)) @@ -9681,6 +9706,8 @@ void P_PlayerAfterThink(player_t *player) player->mo->momz = (player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2) - player->mo->z)*2; P_TeleportMove(player->mo, player->mo->tracer->x, player->mo->tracer->y, player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2)); player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; player->secondjump = 0; player->pflags &= ~PF_THOKKED; From 76ff26e6fb4aa71c88c6841d0e0f42851f295685 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 15:53:12 +0100 Subject: [PATCH 72/96] Revert "Thorough jumpdamage setting." This reverts commit 8720252059542523a895a22a207d157925cb965f. --- src/p_map.c | 4 +--- src/p_spec.c | 4 ---- src/p_user.c | 35 ++++------------------------------- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index fe9cecdba..d924ad564 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -203,7 +203,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } } - pflags = object->player->pflags & (PF_JUMPED|PF_JUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. + pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. jumping = object->player->jumping; secondjump = object->player->secondjump; P_ResetPlayer(object->player); @@ -211,8 +211,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->info->painchance) { object->player->pflags |= PF_JUMPED; - if (!(object->player->charflags & SF_NOJUMPDAMAGE)) - object->player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(object, S_PLAY_JUMP); } else if (P_MobjFlip(object)*vertispeed > 0) diff --git a/src/p_spec.c b/src/p_spec.c index a52e63104..d0c268c86 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7508,11 +7508,7 @@ void T_Pusher(pusher_t *p) P_ResetPlayer (thing->player); if (jumped) - { thing->player->pflags |= PF_JUMPED; - if (!(thing->player->charflags & SF_NOJUMPDAMAGE)) - thing->player->pflags |= PF_JUMPDAMAGE; - } thing->player->pflags |= PF_SLIDING; P_SetPlayerMobjState (thing, thing->info->painstate); // Whee! diff --git a/src/p_user.c b/src/p_user.c index afd193066..5533ed619 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -577,7 +577,7 @@ static void P_DeNightserizePlayer(player_t *player) player->pflags &= ~PF_NIGHTSMODE; player->powers[pw_underwater] = 0; - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); player->secondjump = 0; player->jumping = 0; player->homing = 0; @@ -650,7 +650,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) if (!(player->pflags & PF_NIGHTSMODE)) player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox. - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); player->homing = 0; player->mo->fuse = 0; player->speed = 0; @@ -1677,8 +1677,6 @@ void P_DoPlayerExit(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->powers[pw_underwater] = 0; @@ -1999,8 +1997,6 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; player->pflags |= PF_THOKKED; } } @@ -2012,9 +2008,8 @@ static void P_CheckBouncySectors(player_t *player) if (player->pflags & PF_SPINNING) { player->pflags &= ~PF_SPINNING; - player->pflags |= (PF_JUMPED|PF_THOKKED); - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; + player->pflags |= PF_JUMPED; + player->pflags |= PF_THOKKED; } } @@ -2022,8 +2017,6 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; } goto bouncydone; @@ -2767,8 +2760,6 @@ static void P_DoClimbing(player_t *player) player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2776,8 +2767,6 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -2785,8 +2774,6 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2805,8 +2792,6 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); P_SetObjectMomZ(player->mo, 4*FRACUNIT, false); P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale)); @@ -6727,8 +6712,6 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->pflags &= ~PF_GLIDING; @@ -6786,8 +6769,6 @@ static void P_MovePlayer(player_t *player) || (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_GLIDEANDCLIMB)) { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } else @@ -6858,8 +6839,6 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -7509,8 +7488,6 @@ static void P_DoRopeHang(player_t *player) P_SetTarget(&player->mo->tracer, NULL); player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; player->powers[pw_carry] = CR_NONE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) @@ -7609,8 +7586,6 @@ static void P_DoRopeHang(player_t *player) if (player->mo->tracer->flags & MF_SLIDEME) { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) && !(player->panim == PA_JUMP)) @@ -9706,8 +9681,6 @@ void P_PlayerAfterThink(player_t *player) player->mo->momz = (player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2) - player->mo->z)*2; P_TeleportMove(player->mo, player->mo->tracer->x, player->mo->tracer->y, player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2)); player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; player->secondjump = 0; player->pflags &= ~PF_THOKKED; From c54d62851cad7f2e4a042397d8dab3205d0048ee Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 16:04:02 +0100 Subject: [PATCH 73/96] 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; From 956a8358c274f912b6817cf454a914abfdba8296 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 16:26:36 +0100 Subject: [PATCH 74/96] Important component for nojumpspin characters. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index fc7ea2159..03f91a7cd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9678,7 +9678,7 @@ void P_PlayerAfterThink(player_t *player) player->mo->momy = (player->mo->tracer->y - player->mo->y)*2; player->mo->momz = (player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2) - player->mo->z)*2; P_TeleportMove(player->mo, player->mo->tracer->x, player->mo->tracer->y, player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2)); - player->pflags |= PF_JUMPED; + player->pflags |= PF_JUMPED|PF_FORCEJUMPDAMAGE; player->secondjump = 0; player->pflags &= ~PF_THOKKED; From cfc9302bd32ebd5ecc6cc6738ad19f6ad063c861 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 17:05:17 +0100 Subject: [PATCH 75/96] Minor fix to ensure PF_FORCEJUMPDAMAGE is always known. --- src/p_user.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 03f91a7cd..8cb1b7607 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6673,7 +6673,7 @@ static void P_MovePlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_WALK); } - // If Springing (or nojumpspinning), but travelling DOWNWARD, change back! (nojumpspin also turns to fall once PF_THOKKED is added.) + // If Springing (or nojumpspinning), but travelling DOWNWARD, change back! if ((player->panim == PA_SPRING && P_MobjFlip(player->mo)*player->mo->momz < 0) || ((((player->charflags & SF_NOJUMPSPIN) && (player->pflags & PF_JUMPED) && player->panim == PA_JUMP)) && (P_MobjFlip(player->mo)*player->mo->momz < 0))) @@ -8929,8 +8929,13 @@ void P_PlayerThink(player_t *player) if (player->panim != PA_ABILITY) P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); } - else if ((player->pflags & PF_JUMPED) && !player->powers[pw_super] && player->panim != PA_JUMP && !(player->charflags & SF_NOJUMPSPIN)) - P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); + else if ((player->pflags & PF_JUMPED) && !player->powers[pw_super] && ((player->charflags & SF_NOJUMPSPIN && player->pflags & PF_FORCEJUMPDAMAGE && player->panim != PA_ROLL) || (!(player->charflags & SF_NOJUMPSPIN) && player->panim != PA_JUMP))) + { + if (!(player->charflags & SF_NOJUMPSPIN)) + P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); + else if (player->pflags & PF_FORCEJUMPDAMAGE) + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + } if (player->flashcount) player->flashcount--; From 45d32b7f7cd3e54a1d6fd1df8f7adcc54f000c27 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 20:34:43 +0100 Subject: [PATCH 76/96] * Flameaura shield now has boosh sprites. * MF2_SHIELD calls shield thinker (P_AddShield/P_ShieldLook). * Multiple types of force shields now handled. --- src/dehacked.c | 67 ++++++++++++++++++++++++++++---------------------- src/info.c | 14 ++++++++--- src/info.h | 8 ++++++ src/p_mobj.c | 48 +++++++++++++++++++++++++++--------- src/p_mobj.h | 1 + src/p_user.c | 2 ++ 6 files changed, 96 insertions(+), 44 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index a0eee8229..224b4393d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5407,6 +5407,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ELEM11", "S_ELEM12", + "S_ELEM13", + "S_ELEM14", + "S_ELEMF1", "S_ELEMF2", "S_ELEMF3", @@ -5439,6 +5442,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIRS8", "S_FIRS9", + "S_FIRS10", + "S_FIRS11", + "S_FIRSB1", "S_FIRSB2", "S_FIRSB3", @@ -5449,6 +5455,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIRSB8", "S_FIRSB9", + "S_FIRSB10", + "S_BUBS1", "S_BUBS2", "S_BUBS3", @@ -6653,35 +6661,36 @@ static const char *const MOBJFLAG_LIST[] = { // \tMF2_(\S+).*// (.+) --> \t"\1", // \2 static const char *const MOBJFLAG2_LIST[] = { - "AXIS", // It's a NiGHTS axis! (For faster checking) - "TWOD", // Moves like it's in a 2D level - "DONTRESPAWN", // Don't respawn this object! - "DONTDRAW", // Don't generate a vissprite - "AUTOMATIC", // Thrown ring has automatic properties - "RAILRING", // Thrown ring has rail properties - "BOUNCERING", // Thrown ring has bounce properties - "EXPLOSION", // Thrown ring has explosive properties - "SCATTER", // Thrown ring has scatter properties - "BEYONDTHEGRAVE",// Source of this missile has died and has since respawned. - "SLIDEPUSH", // MF_PUSHABLE that pushes continuously. - "CLASSICPUSH", // Drops straight down when object has negative Z. - "STANDONME", // While not pushable, stand on me anyway. - "INFLOAT", // Floating to a height for a move, don't auto float to target's height. - "DEBRIS", // Splash ring from explosion ring - "NIGHTSPULL", // Attracted from a paraloop - "JUSTATTACKED", // can be pushed by other moving mobjs - "FIRING", // turret fire - "SUPERFIRE", // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it. - "SHADOW", // Fuzzy draw, makes targeting harder. - "STRONGBOX", // Flag used for "strong" random monitors. - "OBJECTFLIP", // Flag for objects that always have flipped gravity. - "SKULLFLY", // Special handling: skull in flight. - "FRET", // Flashing from a previous hit - "BOSSNOTRAP", // No Egg Trap after boss - "BOSSFLEE", // Boss is fleeing! - "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) - "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH - "LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) + "AXIS", // It's a NiGHTS axis! (For faster checking) + "TWOD", // Moves like it's in a 2D level + "DONTRESPAWN", // Don't respawn this object! + "DONTDRAW", // Don't generate a vissprite + "AUTOMATIC", // Thrown ring has automatic properties + "RAILRING", // Thrown ring has rail properties + "BOUNCERING", // Thrown ring has bounce properties + "EXPLOSION", // Thrown ring has explosive properties + "SCATTER", // Thrown ring has scatter properties + "BEYONDTHEGRAVE", // Source of this missile has died and has since respawned. + "SLIDEPUSH", // MF_PUSHABLE that pushes continuously. + "CLASSICPUSH", // Drops straight down when object has negative Z. + "STANDONME", // While not pushable, stand on me anyway. + "INFLOAT", // Floating to a height for a move, don't auto float to target's height. + "DEBRIS", // Splash ring from explosion ring + "NIGHTSPULL", // Attracted from a paraloop + "JUSTATTACKED", // can be pushed by other moving mobjs + "FIRING", // turret fire + "SUPERFIRE", // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it. + "SHADOW", // Fuzzy draw, makes targeting harder. + "STRONGBOX", // Flag used for "strong" random monitors. + "OBJECTFLIP", // Flag for objects that always have flipped gravity. + "SKULLFLY", // Special handling: skull in flight. + "FRET", // Flashing from a previous hit + "BOSSNOTRAP", // No Egg Trap after boss + "BOSSFLEE", // Boss is fleeing! + "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) + "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH + "LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) + "SHIELD", // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use) NULL }; diff --git a/src/info.c b/src/info.c index 2c0514634..802f90f26 100644 --- a/src/info.c +++ b/src/info.c @@ -2119,6 +2119,9 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_TRANS50|10, 4, {NULL}, 0, 0, S_ELEM12}, // S_ELEM11 {SPR_ELEM, FF_TRANS50|11, 4, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM12 + {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEM14}, // S_ELEM13 + {SPR_ELEM, FF_TRANS50|11, 1, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM14 + {SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2 }, // S_ELEMF1 {SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3 }, // S_ELEMF2 {SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4 }, // S_ELEMF3 @@ -2152,6 +2155,9 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|7, 2, {NULL}, 0, 0, S_FIRS9}, // S_FIRS8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|8, 2, {NULL}, 0, 0, S_FIRS1}, // S_FIRS9 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|18, 1, {NULL}, 0, 0, S_FIRS11}, // S_FIRS10 + {SPR_NULL, 0, 1, {NULL}, 0, 0, S_FIRS1 }, // S_FIRS11 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_FIRSB2}, // S_FIRSB1 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_FIRSB3}, // S_FIRSB2 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_FIRSB4}, // S_FIRSB3 @@ -2162,6 +2168,8 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 + {SPR_NULL, 0, 2, {NULL}, 0, 0, S_FIRSB1 }, // S_FIRSB10 + {SPR_BUBS, FF_TRANS30 , 3, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 {SPR_BUBS, FF_TRANS30|1, 3, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 {SPR_BUBS, FF_TRANS30|2, 3, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 @@ -10697,7 +10705,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_ELEM13, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10859,7 +10867,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_FIRSB10, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10875,7 +10883,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_FIRS10 // raisestate }, { // MT_BUBBLEWRAP_ORB diff --git a/src/info.h b/src/info.h index 914d04d16..b9dc034bf 100644 --- a/src/info.h +++ b/src/info.h @@ -2304,6 +2304,9 @@ typedef enum state S_ELEM11, S_ELEM12, + S_ELEM13, + S_ELEM14, + S_ELEMF1, S_ELEMF2, S_ELEMF3, @@ -2336,6 +2339,9 @@ typedef enum state S_FIRS8, S_FIRS9, + S_FIRS10, + S_FIRS11, + S_FIRSB1, S_FIRSB2, S_FIRSB3, @@ -2346,6 +2352,8 @@ typedef enum state S_FIRSB8, S_FIRSB9, + S_FIRSB10, + S_BUBS1, S_BUBS2, S_BUBS3, diff --git a/src/p_mobj.c b/src/p_mobj.c index ecf0133f1..e49c3e797 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6392,7 +6392,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) // TODO: Make an MT_SHIELDORB which changes color/states to always match the appropriate shield, // instead of having completely seperate mobjtypes. - if (shield != SH_FORCE) + if (!(shield & SH_FORCE)) { // Regular shields check for themselves only if ((shieldtype_t)(thing->target->player->powers[pw_shield] & SH_NOSTACK) != shield) { @@ -6406,7 +6406,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return false; } - if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP)) + if (shield & SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP)) { thing->movecount = (thing->target->player->powers[pw_shield] & SH_FORCEHP); if (thing->movecount < 1) @@ -6458,7 +6458,7 @@ void P_RunShields(void) // run shields for (i = 0; i < numshields; i++) { - P_ShieldLook(shields[i], shields[i]->info->speed); + P_ShieldLook(shields[i], shields[i]->threshold); P_SetTarget(&shields[i], NULL); } numshields = 0; @@ -6466,7 +6466,7 @@ void P_RunShields(void) static boolean P_AddShield(mobj_t *thing) { - shieldtype_t shield = thing->info->speed; + shieldtype_t shield = thing->threshold; if (!thing->target || thing->target->health <= 0 || !thing->target->player || (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super] @@ -6476,7 +6476,7 @@ static boolean P_AddShield(mobj_t *thing) return false; } - if (shield != SH_FORCE) + if (!(shield & SH_FORCE)) { // Regular shields check for themselves only if ((shieldtype_t)(thing->target->player->powers[pw_shield] & SH_NOSTACK) != shield) { @@ -6743,6 +6743,11 @@ void P_MobjThinker(mobj_t *mobj) if (P_MobjWasRemoved(mobj)) return; #endif + + if (mobj->flags2 & MF2_SHIELD) + if (!P_AddShield(mobj)) + return; + switch (mobj->type) { case MT_HOOP: @@ -6802,12 +6807,11 @@ void P_MobjThinker(mobj_t *mobj) case MT_PITY_ORB: case MT_WHIRLWIND_ORB: case MT_ARMAGEDDON_ORB: - case MT_FLAMEAURA_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; break; case MT_ATTRACT_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (/*(mobj->target) -- the following is implicit by P_AddShield && (mobj->target->player) @@ -6818,7 +6822,7 @@ void P_MobjThinker(mobj_t *mobj) } break; case MT_ELEMENTAL_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield @@ -6828,12 +6832,14 @@ void P_MobjThinker(mobj_t *mobj) && ((statenum_t)(mobj->tracer->state-states) < mobj->info->raisestate || (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1))) { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; P_SetMobjState(mobj->tracer, mobj->info->raisestate); mobj->tracer->tics++; } break; case MT_FORCE_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (/* && mobj->target -- the following is implicit by P_AddShield @@ -6849,8 +6855,26 @@ void P_MobjThinker(mobj_t *mobj) whoosh->height = 42*FRACUNIT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh } + case MT_FLAMEAURA_ORB: + if (!(mobj->flags2 & MF2_SHIELD)) + return; + mobj->angle = mobj->target->angle; // implicitly okay because of P_AddShield + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_FLAMEAURA */ + && mobj->target->player->pflags & PF_SHIELDABILITY + && ((statenum_t)(mobj->tracer->state-states) < mobj->info->raisestate + || (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1))) + { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + } + break; case MT_BUBBLEWRAP_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield @@ -6878,7 +6902,7 @@ void P_MobjThinker(mobj_t *mobj) } break; case MT_THUNDERCOIN_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield diff --git a/src/p_mobj.h b/src/p_mobj.h index 69e0e11aa..40d5a732e 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -193,6 +193,7 @@ typedef enum MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) MF2_AMBUSH = 1<<27, // Alternate behaviour typically set by MTF_AMBUSH MF2_LINKDRAW = 1<<28, // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) + MF2_SHIELD = 1<<29, // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use) // free: to and including 1<<31 } mobjflag2_t; diff --git a/src/p_user.c b/src/p_user.c index 8cb1b7607..c5490abe0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1395,8 +1395,10 @@ void P_SpawnShieldOrb(player_t *player) } shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); + shieldobj->flags2 |= MF2_SHIELD; P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; + shieldobj->threshold = (player->powers[pw_shield] & SH_FORCE) ? SH_FORCE : (player->powers[pw_shield] & SH_NOSTACK); if (shieldobj->info->seestate) { From a5a6ceff7149b1b768e868d4ec3b391fe8aba592 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 22:21:42 +0100 Subject: [PATCH 77/96] More thorough Mario soundification for new shield sounds. --- src/s_sound.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/s_sound.c b/src/s_sound.c index 47a955561..971961897 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -607,6 +607,13 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id) sfx_id = sfx_mario6; break; case sfx_shield: + case sfx_wirlsg: + case sfx_forcsg: + case sfx_elemsg: + case sfx_armasg: + case sfx_s3k3e: + case sfx_s3k3f: + case sfx_s3k41: sfx_id = sfx_mario3; break; case sfx_itemup: From 3ce411b62a7a3df42a95dcf71d6a20291b1107cb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 12:35:40 +0100 Subject: [PATCH 78/96] Mario mode is boring again. (I'm going to revert this commit as soon as possible, but shield_actions needs to be clean of Mario stuff for now.) --- src/d_player.h | 6 ++-- src/dehacked.c | 3 +- src/g_game.c | 3 -- src/p_enemy.c | 59 +++++++++++++++------------------ src/p_inter.c | 89 +++++++++++++------------------------------------- src/p_local.h | 9 ++--- src/p_mobj.c | 35 ++------------------ src/p_user.c | 61 +++++----------------------------- src/r_things.c | 13 +------- 9 files changed, 66 insertions(+), 212 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4f3e37e59..13729eebe 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -194,7 +194,6 @@ typedef enum SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match SH_WHIRLWIND, SH_ARMAGEDDON, - SH_FIREFLOWER, // normal shields that use flags SH_ATTRACT = SH_PROTECTELECTRIC, @@ -210,9 +209,9 @@ typedef enum SH_FORCEHP = 0xFF, // to be used as a bitmask only // Mostly for use with Mario mode. - SH_MUSHROOM = 0x200, + SH_FIREFLOWER = 0x200, - SH_STACK = SH_MUSHROOM, // second-layer shields + SH_STACK = SH_FIREFLOWER, // second-layer shields SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield @@ -241,7 +240,6 @@ typedef enum pw_underwater, // underwater timer pw_spacetime, // In space, no one can hear you spin! pw_extralife, // Extra Life timer - pw_marioflashing, // Getting/losing powerup pw_super, // Are you super? pw_gravityboots, // gravity boots diff --git a/src/dehacked.c b/src/dehacked.c index 224b4393d..7667ead82 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7126,7 +7126,6 @@ struct { {"SH_PITY",SH_PITY}, {"SH_WHIRLWIND",SH_WHIRLWIND}, {"SH_ARMAGEDDON",SH_ARMAGEDDON}, - {"SH_FIREFLOWER",SH_FIREFLOWER}, // normal shields that use flags {"SH_ATTRACT",SH_ATTRACT}, {"SH_ELEMENTAL",SH_ELEMENTAL}, @@ -7138,7 +7137,7 @@ struct { {"SH_FORCE",SH_FORCE}, {"SH_FORCEHP",SH_FORCEHP}, // to be used as a bitmask only // Mostly for use with Mario mode. - {"SH_MUSHROOM", SH_MUSHROOM}, + {"SH_FIREFLOWER", SH_FIREFLOWER}, {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/g_game.c b/src/g_game.c index 200a0f45b..5e45921b7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2196,9 +2196,6 @@ void G_PlayerReborn(INT32 player) p->health = 1; // 0 rings p->panim = PA_IDLE; // standing animation - if (mariomode) - p->powers[pw_shield] = SH_MUSHROOM; // start big - if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent diff --git a/src/p_enemy.c b/src/p_enemy.c index 7212bd8c8..fb0e41903 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3061,10 +3061,9 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_WHIRLWIND)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_WHIRLWIND); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_RingShield @@ -3090,10 +3089,9 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_ATTRACT)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_ATTRACT); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_RingBox @@ -3293,7 +3291,8 @@ void A_BombShield(mobj_t *actor) P_BlackOw(player); // Now we know for certain that we don't have a bomb shield, so add one. :3 - P_SwitchShield(player, SH_ARMAGEDDON); // will never return false, so no need for sound test + P_SwitchShield(player, SH_ARMAGEDDON); + S_StartSound(player->mo, actor->info->seesound); } @@ -3320,10 +3319,9 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_ELEMENTAL)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_ELEMENTAL); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_ForceShield @@ -3356,10 +3354,9 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_FORCE|locvar1)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_FORCE|locvar1); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_PityShield @@ -3389,10 +3386,9 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_PITY)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_PITY); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_FlameShield @@ -3418,10 +3414,9 @@ void A_FlameShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_FLAMEAURA)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_FLAMEAURA); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_BubbleShield @@ -3447,10 +3442,9 @@ void A_BubbleShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_BUBBLEWRAP)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_BUBBLEWRAP); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_ThunderShield @@ -3476,10 +3470,9 @@ void A_ThunderShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_THUNDERCOIN)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_THUNDERCOIN); + + S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index 4bf600c51..d038677db 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1141,27 +1141,16 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_FIREFLOWER: if (player->bot) return; - { - mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 - P_AddPlayerScore(player, 1000); - } - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) - { - S_StartSound(toucher, sfx_itemup); - break; - } - else - S_StartSound(toucher, sfx_mario3); + S_StartSound(toucher, sfx_mario3); - if (mariomode) + player->powers[pw_shield] = (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; + + if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) { - toucher->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->mo->color = SKINCOLOR_WHITE; + G_GhostAddColor(GHC_FIREFLOWER); } - player->powers[pw_shield] = (mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; - P_SpawnShieldOrb(player); break; @@ -1226,21 +1215,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, special->info->painsound); - if (mariomode) - { - mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+7); // 2000 - P_AddPlayerScore(player, 2000); - if (!player->powers[pw_shield]) - { - S_StartSound(toucher, sfx_mario3); - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_MUSHROOM; - P_SpawnShieldOrb(player); - } - } - if (!(netgame && circuitmap && player != &players[consoleplayer])) P_SetMobjState(special, special->info->painstate); return; @@ -2300,14 +2274,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget case MT_PLAYER: { - boolean mariodeathpit = (mariomode && damagetype == DMG_DEATHPIT); target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) - if (!mariodeathpit) - { - if (mariomode) - target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - target->momx = target->momy = target->momz = 0; - } + target->momx = target->momy = target->momz = 0; + if (damagetype == DMG_DROWNED) // drowned { target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack. @@ -2319,8 +2288,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget } else { - if (!mariodeathpit) - P_SetObjectMomZ(target, 14*FRACUNIT, false); + P_SetObjectMomZ(target, 14*FRACUNIT, false); if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes S_StartSound(target, sfx_spkdth); else @@ -2680,11 +2648,8 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) P_PlayerRingBurst(player, player->health - 1); - if (!mariomode) // Get rid of shield - { - player->powers[pw_shield] = SH_NONE; - player->mo->color = player->skincolor; - } + player->powers[pw_shield] = SH_NONE; + player->mo->color = player->skincolor; // Get rid of emeralds player->powers[pw_emeralds] = 0; @@ -2780,16 +2745,20 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { - boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit - if ((player->powers[pw_shield] & SH_FORCEHP) == 0) - player->powers[pw_shield] &= SH_STACK; - else + if (player->powers[pw_shield] & SH_FORCEHP) player->powers[pw_shield]--; + else + player->powers[pw_shield] &= SH_STACK; } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE) { // Second layer shields + if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } player->powers[pw_shield] = SH_NONE; } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them! @@ -2799,11 +2768,6 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) @@ -2815,14 +2779,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - if (mariomode) - { - S_StartSound(player->mo, sfx_mario8); - // Burst weapons and emeralds in Match/CTF only - if (!player->powers[pw_shield] && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) - P_PlayerRingBurst(player, 0); - } - else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes + if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes S_StartSound(player->mo, sfx_spkdth); else S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss. @@ -3133,7 +3090,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_ShieldDamage(player, inflictor, source, damage); damage = 0; } - else if (!mariomode && player->mo->health > 1) // No shield but have rings. + else if (player->mo->health > 1) // No shield but have rings. { damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage, damagetype); @@ -3295,11 +3252,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) // Spill the ammo P_PlayerWeaponAmmoBurst(player); - if (mariomode) return; - for (i = 0; i < num_rings; i++) { INT32 objType = mobjinfo[MT_RING].reactiontime; + if (mariomode) + objType = mobjinfo[MT_COIN].reactiontime; z = player->mo->z; if (player->mo->eflags & MFE_VERTICALFLIP) diff --git a/src/p_local.h b/src/p_local.h index 7107432ef..ee61d3389 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,12 +62,9 @@ #define twodlevel (maptol & TOL_2D) #define mariomode (maptol & TOL_MARIO) -#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) -#define MARIOFLASHINGTICS 21 - -#define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) -#define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) +#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale) +#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale) // // P_TICK @@ -146,7 +143,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); -boolean P_SwitchShield(player_t *player, UINT16 shieldtype); +void P_SwitchShield(player_t *player, UINT16 shieldtype); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerLives(player_t *player, INT32 numlives); diff --git a/src/p_mobj.c b/src/p_mobj.c index e49c3e797..c94587ab4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4088,32 +4088,6 @@ static void P_PlayerMobjThinker(mobj_t *mobj) I_Assert(mobj->player != NULL); I_Assert(!P_MobjWasRemoved(mobj)); - if (mobj->player->powers[pw_marioflashing]) - { - if (!mobj->player->powers[pw_nocontrol]++) - mobj->player->powers[pw_nocontrol]++; - - if (!(--mobj->player->powers[pw_marioflashing] % 4)) - { - UINT16 shieldswitch = mobj->player->powers[pw_shield]; - mobj->player->powers[pw_shield] = mobj->movecount; - mobj->movecount = shieldswitch; - if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK)) - P_SpawnShieldOrb(mobj->player); - if ((mobj->player->powers[pw_shield] & SH_NOSTACK) != SH_FIREFLOWER && (mobj->movecount & SH_NOSTACK) == SH_FIREFLOWER - && !(mobj->player->powers[pw_super] || (mariomode && mobj->player->powers[pw_invulnerability]))) - { - mobj->color = mobj->player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - } - - if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) - if (--(mobj->player->powers[pw_flashing]) == flashingtics) - mobj->player->powers[pw_flashing]--; - return; - } - P_MobjCheckWater(mobj); #ifdef ESLOPE @@ -6433,9 +6407,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->x = thing->target->x; thing->y = thing->target->y; if (thing->eflags & MFE_VERTICALFLIP) - thing->z = thing->target->z + ((thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) - FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z + (thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) - FixedMul(2*FRACUNIT, thing->target->scale); else - thing->z = thing->target->z - ((FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) + FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z - (FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) + FixedMul(2*FRACUNIT, thing->target->scale); P_SetThingPosition(thing); P_CheckPosition(thing, thing->x, thing->y); @@ -7240,11 +7214,6 @@ void P_MobjThinker(mobj_t *mobj) break; case MT_PLAYER: /// \todo Have the player's dead body completely finish its animation even if they've already respawned. - if (mobj->player && mobj->player->powers[pw_marioflashing]) - { - mobj->player->powers[pw_marioflashing]--; - return; // don't do any momz - } if (!(mobj->flags2 & MF2_DONTDRAW)) { if (!mobj->fuse) diff --git a/src/p_user.c b/src/p_user.c index c5490abe0..3754623de 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -793,7 +793,6 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) if (player->powers[pw_carry] == CR_ROPEHANG) P_SetTarget(&player->mo->tracer, NULL); - if (!mariomode) { angle_t ang; fixed_t fallbackspeed; @@ -860,12 +859,6 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) } player->powers[pw_flashing] = flashingtics; - if (mariomode) - { - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_flashing] += MARIOFLASHINGTICS; - player->mo->movecount = player->powers[pw_shield]; - } if (player->timeshit != UINT8_MAX) ++player->timeshit; @@ -928,7 +921,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) { INT32 gainlives = 0; - while ((mariomode || player->xtralife < maxXtraLife) && player->health > 100 * (player->xtralife+1)) + while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1)) { ++gainlives; ++player->xtralife; @@ -940,13 +933,6 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) P_PlayLivesJingle(player); } } - - if (mariomode && player->health > 100 && !G_RingSlingerGametype() && !G_TagGametype()) - { - player->mo->health = 1 + (player->health - 1) % 100; - player->health = player->mo->health; - player->xtralife = 0; - } } // @@ -1371,13 +1357,6 @@ void P_SpawnShieldOrb(player_t *player) case SH_THUNDERCOIN: orbtype = MT_THUNDERCOIN_ORB; break; - case SH_FIREFLOWER: - if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - return; default: return; } @@ -1440,33 +1419,18 @@ void P_SpawnShieldOrb(player_t *player) // the non-stack layer of shields thoroughly, // then adds the desired one. // -// Returns whether to play a normal sound or an itemup. -// -boolean P_SwitchShield(player_t *player, UINT16 shieldtype) +void P_SwitchShield(player_t *player, UINT16 shieldtype) { boolean donthavealready = (shieldtype & SH_FORCE) ? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE)) : ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype); - if (mariomode) - { - mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 - P_AddPlayerScore(player, 1000); - } - if (donthavealready) { boolean stopshieldability = (shieldtype & SH_FORCE) ? (!(player->powers[pw_shield] & SH_FORCE)) : true; - if (mariomode) - { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - } - // Just in case. if (stopshieldability && player->pflags & PF_SHIELDABILITY) { @@ -1474,14 +1438,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) player->homing = 0; } - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER // it's implicit that the new shield isn't a fireflower - && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); + player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); if (shieldtype & SH_PROTECTWATER) @@ -1497,9 +1454,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) P_RestoreMusic(player); } } - return true; } - return (!mariomode); } // @@ -2203,7 +2158,7 @@ static void P_CheckInvincibilityTimer(player_t *player) { if (mariomode) { - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -3227,7 +3182,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_ATTACK || cmd->buttons & BT_FIRENORMAL) { - if (!(player->pflags & PF_ATTACKDOWN) && (player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER && !player->climbing) + if (!(player->pflags & PF_ATTACKDOWN) && (player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER && !player->climbing) { player->pflags |= PF_ATTACKDOWN; P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); @@ -8594,9 +8549,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist = FixedHypot(f1, f2); if (mo->eflags & MFE_VERTICALFLIP) - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - (P_GetPlayerHeight(player) << shortmario(player))); + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); else - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + (P_GetPlayerHeight(player) << shortmario(player))); + angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); if (player->playerstate != PST_DEAD) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' @@ -9335,7 +9290,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1) && !player->powers[pw_marioflashing]) + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; diff --git a/src/r_things.c b/src/r_things.c index eb1a3cb25..e8aa2956f 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1128,8 +1128,6 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t offset, offset2; boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); - fixed_t shortmarioshift = (objectplacing ? 0 : shortmario(thing->player)); - INT32 dispoffset = thing->info->dispoffset; //SoM: 3/17/2000 @@ -1364,12 +1362,6 @@ static void R_ProjectSprite(mobj_t *thing) return; } - if (shortmarioshift) // squish mario - { - yscale >>= shortmarioshift; - this_scale >>= shortmarioshift; - } - //SoM: 3/17/2000: Disregard sprites that are out of view.. if (vflip) { @@ -1385,9 +1377,6 @@ static void R_ProjectSprite(mobj_t *thing) gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale); } - if (shortmarioshift) // unsquish the x component - this_scale <<= shortmarioshift; - if (thing->subsector->sector->cullheight) { if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt)) @@ -1453,7 +1442,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->thingheight = thing->height; vis->pz = thing->z; vis->pzt = vis->pz + vis->thingheight; - vis->texturemid = (vis->gzt - viewz) << shortmarioshift; + vis->texturemid = vis->gzt - viewz; vis->scalestep = scalestep; vis->mobj = thing; // Easy access! Tails 06-07-2002 From 0ccf6fe6a95ff651fc02f672a4f06ebccb3fa01e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 12:43:54 +0100 Subject: [PATCH 79/96] I commented out this line a while ago because it didn't seem to be important, and flashingtics seems to be thoroughly set elsewhere. Here's an actual removal so it stands out on the git diff. --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index d038677db..3abb9aaca 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3135,7 +3135,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else { player->health -= damage; // mirror mobj health here - //target->player->powers[pw_flashing] = flashingtics; + if (damage > 0) // don't spill emeralds/ammo/panels for shield damage P_PlayerRingBurst(player, damage); } From 162c04c37066d937193811e1f1020645590820ac Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:33:10 +0100 Subject: [PATCH 80/96] Bubblewrap shield now bounces on enemies and monitors instead of piercing through them. --- src/lua_baselib.c | 11 +++++++++++ src/p_inter.c | 25 +++++++++++++++++++------ src/p_local.h | 1 + src/p_map.c | 19 +++++++++++++------ src/p_mobj.c | 11 ++--------- src/p_user.c | 18 ++++++++++++++++++ 6 files changed, 64 insertions(+), 21 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index fca8050a9..33e54123d 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -777,6 +777,16 @@ static int lib_pDoJumpShield(lua_State *L) return 0; } +static int lib_pDoBubbleBounce(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_DoBubbleBounce(player); + return 0; +} + static int lib_pBlackOw(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2048,6 +2058,7 @@ static luaL_Reg lib[] = { {"P_GivePlayerLives",lib_pGivePlayerLives}, {"P_ResetScore",lib_pResetScore}, {"P_DoJumpShield",lib_pDoJumpShield}, + {"P_DoBubbleBounce",lib_pDoBubbleBounce}, {"P_BlackOw",lib_pBlackOw}, {"P_ElementalFire",lib_pElementalFire}, {"P_DoPlayerExit",lib_pDoPlayerExit}, diff --git a/src/p_inter.c b/src/p_inter.c index 3abb9aaca..56e730017 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -240,7 +240,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { player_t *player; INT32 i; - boolean elementalpierce; + UINT8 elementalpierce; if (objectplacing) return; @@ -295,7 +295,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; #endif - elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY)); + // 0 = none, 1 = elemental pierce, 2 = bubble bounce + elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY) + ? (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) ? 1 : 2) + : 0); if (special->flags & MF_BOSS) { @@ -313,8 +316,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || player->powers[pw_invulnerability] || player->powers[pw_super] || elementalpierce) // Do you possess the ability to subdue the object? { - if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) - toucher->momz = -toucher->momz; + if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1)) + { + if (elementalpierce == 2) + P_DoBubbleBounce(player); + else + toucher->momz = -toucher->momz; + } toucher->momx = -toucher->momx; toucher->momy = -toucher->momy; P_DamageMobj(special, toucher, toucher, 1, 0); @@ -359,8 +367,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? { - if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) - toucher->momz = -toucher->momz; + if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1)) + { + if (elementalpierce == 2) + P_DoBubbleBounce(player); + else + toucher->momz = -toucher->momz; + } P_DamageMobj(special, toucher, toucher, 1, 0); } diff --git a/src/p_local.h b/src/p_local.h index ee61d3389..322675f03 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -153,6 +153,7 @@ void P_ResetScore(player_t *player); boolean P_AutoPause(void); void P_DoJumpShield(player_t *player); +void P_DoBubbleBounce(player_t *player); void P_BlackOw(player_t *player); void P_ElementalFire(player_t *player, boolean cropcircle); diff --git a/src/p_map.c b/src/p_map.c index 72668e478..54eecac7a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1052,9 +1052,10 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) { - boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL - || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) - && (tmthing->player->pflags & PF_SHIELDABILITY)); + // 0 = none, 1 = elemental pierce, 2 = bubble bounce + UINT8 elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (tmthing->player->pflags & PF_SHIELDABILITY) + ? (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) ? 1 : 2) + : 0); if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) @@ -1066,6 +1067,7 @@ static boolean PIT_CheckThing(mobj_t *thing) && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)) || elementalpierce)) { + player_t *player = tmthing->player; SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed. fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;; fixed_t *z = &tmthing->z; // aau. @@ -1074,9 +1076,14 @@ static boolean PIT_CheckThing(mobj_t *thing) if ((P_MobjWasRemoved(thing) // Monitor was removed || !thing->health) // or otherwise popped && (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up - && !elementalpierce) // you're not piercing through the monitor... - *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. - if (!(elementalpierce && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. + && (elementalpierce != 1)) // you're not piercing through the monitor... + { + if (elementalpierce == 2) + P_DoBubbleBounce(player); + else + *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. + } + if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. return false; else *z -= *momz; // to ensure proper collision. diff --git a/src/p_mobj.c b/src/p_mobj.c index c94587ab4..31e0d477c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3236,6 +3236,7 @@ static void P_PlayerZMovement(mobj_t *mo) mo->player->pflags &= ~(PF_JUMPED|PF_FORCEJUMPDAMAGE); mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); + mo->player->jumping = 0; mo->player->secondjump = 0; mo->player->glidetime = 0; mo->player->climbing = 0; @@ -3265,18 +3266,10 @@ static void P_PlayerZMovement(mobj_t *mo) } else if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) // Bubble shield's bounce attack. { - S_StartSound(mo, sfx_s3k44); - P_DoJump(mo->player, false); - if (mo->player->charflags & SF_NOJUMPSPIN) - P_SetPlayerMobjState(mo, S_PLAY_FALL); - mo->player->pflags |= PF_THOKKED; - mo->player->secondjump = UINT8_MAX; - mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); + P_DoBubbleBounce(mo->player); clipmomz = false; } } - - mo->player->jumping = 0; // done down here because of bubblewrap } } if (!(mo->player->pflags & PF_SPINNING)) diff --git a/src/p_user.c b/src/p_user.c index 3754623de..5aa50458e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3927,6 +3927,24 @@ void P_DoJumpShield(player_t *player) } } +// +// P_DoBubbleBounce +// +// Bubblewrap shield landing handling +// +void P_DoBubbleBounce(player_t *player) +{ + player->pflags &= ~(PF_JUMPED|PF_SHIELDABILITY); + S_StartSound(player->mo, sfx_s3k44); + P_DoJump(player, false); + if (player->charflags & SF_NOJUMPSPIN) + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + player->pflags |= PF_THOKKED; + player->jumping = 0; + player->secondjump = UINT8_MAX; + player->mo->momz = FixedMul(player->mo->momz, 5*FRACUNIT/4); +} + // // P_Telekinesis // From 0ee2937392a8f4072937d725643374d7744c4c34 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 81/96] Adding ShieldSpecial hook. (Activates under different circumstances to the JumpSpinSpecial hook, and can be used to cancel existing shield actions.) --- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 1 + src/p_user.c | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lua_hook.h b/src/lua_hook.h index e0f08d175..cbeaa6868 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -44,6 +44,7 @@ enum hook { hook_HurtMsg, hook_PlayerSpawn, hook_ShieldSpawn, + hook_ShieldSpecial, hook_MAX // last hook }; @@ -79,5 +80,6 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook fo boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb +#define LUAh_ShieldSpecial(player) LUAh_PlayerHook(player, hook_ShieldSpecial) // Hook for shield abilities #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1065f193a..ac0e555f7 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -55,6 +55,7 @@ const char *const hookNames[hook_MAX+1] = { "HurtMsg", "PlayerSpawn", "ShieldSpawn", + "ShieldSpecial", NULL }; diff --git a/src/p_user.c b/src/p_user.c index 5aa50458e..55d2ad544 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6978,10 +6978,14 @@ static void P_MovePlayer(player_t *player) //STUFF! // /////////////////////////// - if (player->pflags & PF_JUMPED) + if (player->pflags & PF_JUMPED && !player->exiting && player->mo->health) { if (cmd->buttons & BT_USE) // Spin button effects { +#ifdef HAVE_BLUA + if (LUAh_ShieldSpecial(player)) + return; +#endif if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { From ea30450180e46be303b58f8a65adcea2268f0fcc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 82/96] Minor correction to force-hud conditional. --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 7670f577b..49872c68c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -812,7 +812,7 @@ static void ST_drawFirstPersonHUD(void) return; // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right - if (player->powers[pw_shield] & SH_FORCE) + if ((player->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE) { if ((player->powers[pw_shield] & SH_FORCEHP) > 0 || leveltime & 1) p = forceshield; From bf873f8a9bbf15a46e566448cd54644afda8e3d5 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 83/96] Fixed a heinous modding bug with not properly updating dehacked.c, and added pf_SHieldability to debug. --- src/dehacked.c | 2 ++ src/st_stuff.c | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 7667ead82..eb7badd10 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6772,7 +6772,9 @@ static const char *const PLAYERFLAG_LIST[] = { /*** misc ***/ "FORCESTRAFE", // Translate turn inputs into strafe inputs "ANALOGMODE", // Analog mode? + "CANCARRY", // Can carry? "SHIELDABILITY", // Thokked with shield ability + "FORCEJUMPDAMAGE", // Force jump damage NULL // stop loop here. }; diff --git a/src/st_stuff.c b/src/st_stuff.c index 49872c68c..fb90bfe80 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -582,12 +582,13 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); // Flags - V_DrawRightAlignedString(304-74, height - 72, V_MONOSPACE, "PF:"); - V_DrawString(304-72, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); - V_DrawString(304-54, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); - V_DrawString(304-36, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); - V_DrawString(304-18, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); - V_DrawString(304, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH"); + V_DrawRightAlignedString(304-92, height - 72, V_MONOSPACE, "PF:"); + V_DrawString(304-90, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); + V_DrawString(304-72, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); + V_DrawString(304-54, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); + V_DrawString(304-36, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); + V_DrawString(304-18, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH"); + V_DrawString(304, height - 72, (stplyr->pflags & PF_SHIELDABILITY) ? V_GREENMAP : V_REDMAP, "SH"); V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS)); V_DrawRightAlignedString(320, height - 56, V_MONOSPACE, va("FLOORZ: %6d", stplyr->mo->floorz>>FRACBITS)); From cc4d780371e81a8668292b61c538e0ca49b49d01 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 84/96] Making things more scale-friendly (but it's not perfect...) --- src/p_mobj.c | 1 - src/p_user.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 31e0d477c..5d1af9c45 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6819,7 +6819,6 @@ void P_MobjThinker(mobj_t *mobj) whoosh->destscale = whoosh->scale<<1; whoosh->fuse = 10; whoosh->flags |= MF_NOCLIPHEIGHT; - whoosh->height = 42*FRACUNIT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh } case MT_FLAMEAURA_ORB: diff --git a/src/p_user.c b/src/p_user.c index 55d2ad544..1514fdef6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6994,7 +6994,7 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible - P_SetObjectMomZ(player->mo, -4*P_GetMobjGravity(player->mo), false); + P_SetObjectMomZ(player->mo, FixedDiv(-4*P_GetMobjGravity(player->mo), player->mo->scale), false); #else player->mo->momz = // intentionally carries to post-endif line as multiple-assignment #endif From a533701d859a8f44acaaebeb8a2136b2988f8f08 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 85/96] You know what, let's make this less hacky. --- src/p_user.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 1514fdef6..eddd0d9b8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6993,10 +6993,9 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momz = // would intentionally carry to post-endif line as multiple-assignment #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible - P_SetObjectMomZ(player->mo, FixedDiv(-4*P_GetMobjGravity(player->mo), player->mo->scale), false); -#else - player->mo->momz = // intentionally carries to post-endif line as multiple-assignment + -4*P_GetMobjGravity(player->mo); #endif player->mo->momx = player->mo->momy = 0; S_StartSound(player->mo, sfx_ngskid); From bfdaf5ee90ba81ab3b5659269883737093675cd1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 86/96] Fixed the Force stop's scaling properly. Woo! Branch is basically done now. --- src/p_mobj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d1af9c45..804b73372 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6396,6 +6396,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->eflags = (thing->eflags & ~MFE_VERTICALFLIP)|(thing->target->eflags & MFE_VERTICALFLIP); P_SetScale(thing, FixedMul(thing->target->scale, thing->target->player->shieldscale)); + thing->destscale = thing->scale; P_UnsetThingPosition(thing); thing->x = thing->target->x; thing->y = thing->target->y; @@ -6817,6 +6818,8 @@ void P_MobjThinker(mobj_t *mobj) mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); // done here so the offset is correct P_SetMobjState(whoosh, mobj->info->raisestate); whoosh->destscale = whoosh->scale<<1; + whoosh->scalespeed = FixedMul(whoosh->scalespeed, whoosh->scale); + whoosh->height = 38*whoosh->scale; whoosh->fuse = 10; whoosh->flags |= MF_NOCLIPHEIGHT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh From 08a4fc8382d80c0e76df24090ae4c497b5b7f4d3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 30 Oct 2016 14:01:56 +0000 Subject: [PATCH 87/96] Tweaks to the way the force whoosh is handled so it stays centered AND doesn't allow an infinitesimal jump. --- src/p_mobj.c | 1 + src/p_user.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2965fb7cc..10ebe9c5c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6824,6 +6824,7 @@ void P_MobjThinker(mobj_t *mobj) whoosh->height = 38*whoosh->scale; whoosh->fuse = 10; whoosh->flags |= MF_NOCLIPHEIGHT; + whoosh->momz = mobj->target->momz; // Stay reasonably centered for a few frames mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh } case MT_FLAMEAURA_ORB: diff --git a/src/p_user.c b/src/p_user.c index d34309855..f5e813274 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6992,11 +6992,7 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->mo->momz = // would intentionally carry to post-endif line as multiple-assignment -#if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible - -4*P_GetMobjGravity(player->mo); -#endif - player->mo->momx = player->mo->momy = 0; + player->mo->momx = player->mo->momy = player->mo->momz = 0; S_StartSound(player->mo, sfx_ngskid); } else From 6570912b1a5b6ceb72cf58649092cbc7727e96c8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 30 Oct 2016 14:09:51 +0000 Subject: [PATCH 88/96] Fixed gold monitor collision (which relied upon the shitty old collision blocking in order to not destroy your momentum) to work with my slopes_n_objects fixes from public next. --- src/p_map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index d4c9df5d1..7afd266fd 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1142,6 +1142,9 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->player && tmthing->z + tmthing->height > topz && tmthing->z + tmthing->height < tmthing->ceilingz) { + if (thing->flags & MF_GRENADEBOUNCE && (thing->flags & MF_MONITOR || thing->flags2 & MF2_STANDONME)) // Gold monitor hack... + return false; + tmfloorz = tmceilingz = INT32_MIN; // block while in air #ifdef ESLOPE tmceilingslope = NULL; @@ -1185,6 +1188,9 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->player && tmthing->z < topz && tmthing->z > tmthing->floorz) { + if (thing->flags & MF_GRENADEBOUNCE && (thing->flags & MF_MONITOR || thing->flags2 & MF2_STANDONME)) // Gold monitor hack... + return false; + tmfloorz = tmceilingz = INT32_MAX; // block while in air #ifdef ESLOPE tmfloorslope = NULL; From f77c3444a3c98304d563d0bc478e58a93c19bf9a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 30 Oct 2016 14:23:53 +0000 Subject: [PATCH 89/96] Don't use shield abilities after the armageddon's used up! --- src/p_user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index f5e813274..69334fe45 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7008,7 +7008,10 @@ static void P_MovePlayer(player_t *player) case SH_ARMAGEDDON: // Don't let Super Sonic or invincibility use it if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) + { + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; P_BlackOw(player); + } break; // Attract shield activation case SH_ATTRACT: From 286a8b0289c8c0c40190f66f2473b287788806f1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 12 Nov 2016 14:08:27 +0000 Subject: [PATCH 90/96] Nev3r wants to make barrels which are both shootable and die when you break them like you break monitors. To that end, I've made MF_MONITOR *without* MF_SHOOTABLE act like MF_MONITOR does, and MF_SHOOTABLE allow for both missiles AND players to destroy. This has had the side effect of allowing MF_ENEMY and MF_BOSS to use MF_MONITOR as a substitute for MF_SHOOTABLE that doesn't allow missiles to cause them damage, which might be useful for Jetty-syns. --- src/info.c | 70 +++++++++++++++++++++++++-------------------------- src/p_enemy.c | 2 +- src/p_inter.c | 4 +-- src/p_map.c | 3 --- 4 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/info.c b/src/info.c index 802f90f26..585d3e286 100644 --- a/src/info.c +++ b/src/info.c @@ -6019,7 +6019,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RING_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6046,7 +6046,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_PITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6073,7 +6073,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ATTRACT_ICON,// damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6100,7 +6100,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FORCE_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6127,7 +6127,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ARMAGEDDON_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6154,7 +6154,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_WHIRLWIND_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6181,7 +6181,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ELEMENTAL_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6208,7 +6208,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SNEAKERS_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6235,7 +6235,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_INVULN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6262,7 +6262,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_1UP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6289,7 +6289,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_EGGMAN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6316,7 +6316,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_MIXUP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6343,7 +6343,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_UNKNOWN, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6370,7 +6370,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_GRAVITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6397,7 +6397,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RECYCLER_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6424,7 +6424,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SCORE1K_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6451,7 +6451,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SCORE10K_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6478,7 +6478,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FLAMEAURA_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6505,7 +6505,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_BUBBLEWRAP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6532,7 +6532,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_THUNDERCOIN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6559,7 +6559,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_PITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6586,7 +6586,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ATTRACT_ICON,// damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6613,7 +6613,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FORCE_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6640,7 +6640,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ARMAGEDDON_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6667,7 +6667,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_WHIRLWIND_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6694,7 +6694,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ELEMENTAL_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6721,7 +6721,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SNEAKERS_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6748,7 +6748,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_INVULN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6775,7 +6775,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_EGGMAN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6802,7 +6802,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_GRAVITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6829,7 +6829,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FLAMEAURA_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6856,7 +6856,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_BUBBLEWRAP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6883,7 +6883,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_THUNDERCOIN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6910,7 +6910,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RING_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6937,7 +6937,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RING_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_MONITOR, // flags S_NULL // raisestate }, diff --git a/src/p_enemy.c b/src/p_enemy.c index fb0e41903..a9f340c98 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2744,7 +2744,7 @@ void A_GoldMonitorRestore(mobj_t *actor) return; #endif - actor->flags |= MF_MONITOR|MF_SHOOTABLE; + actor->flags |= MF_MONITOR|(mobjinfo[actor->type].flags & MF_SHOOTABLE); actor->flags2 &= ~MF2_STANDONME; actor->health = 1; // Just in case. } diff --git a/src/p_inter.c b/src/p_inter.c index 56e730017..2dba46592 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2907,14 +2907,14 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force) { - if (!(target->flags & MF_SHOOTABLE)) + if (!(target->flags & (MF_SHOOTABLE|MF_MONITOR))) return false; // shouldn't happen... if (target->type == MT_BLACKEGGMAN) return false; // Make sure that boxes cannot be popped by enemies, red rings, etc. - if (target->flags & MF_MONITOR && ((!source || !source->player || source->player->bot) || (inflictor && !inflictor->player))) + if (!(target->flags & MF_SHOOTABLE) && ((!source || !source->player || source->player->bot) || (inflictor && !inflictor->player))) return false; } diff --git a/src/p_map.c b/src/p_map.c index 7afd266fd..9223da730 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3357,9 +3357,6 @@ static boolean PIT_RadiusAttack(mobj_t *thing) if (thing->flags & MF_BOSS) return true; - if (thing->flags & MF_MONITOR) - return true; - dx = abs(thing->x - bombspot->x); dy = abs(thing->y - bombspot->y); dz = abs(thing->z + (thing->height>>1) - bombspot->z); From a88b21f70301e2dcc652ff4d4ddc9c4a67fe26e2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 12 Nov 2016 14:34:25 +0000 Subject: [PATCH 91/96] Correction of some other relevant places to the previous commit. --- src/p_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 9223da730..d80e1ff41 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -434,7 +434,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->type == MT_METALSONIC_RACE && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) { - if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) + if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & (MF_SHOOTABLE|MF_MONITOR)))) return true; blockdist = thing->radius + tmthing->radius; if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) @@ -463,12 +463,12 @@ static boolean PIT_CheckThing(mobj_t *thing) // CA_DASHMODE users destroy spikes and monitors, CA_TWINSPIN users and CA2_MELEE users destroy spikes. if ((tmthing->player) && (((tmthing->player->charability == CA_DASHMODE) && (tmthing->player->dashmode >= 3*TICRATE) - && (thing->flags & (MF_MONITOR) || thing->type == MT_SPIKE)) + && (thing->flags & MF_MONITOR || thing->type == MT_SPIKE)) || ((((tmthing->player->charability == CA_TWINSPIN) && (tmthing->player->panim == PA_ABILITY)) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)) && (thing->type == MT_SPIKE)))) { - if ((thing->flags & (MF_MONITOR)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) + if ((thing->flags & (MF_MONITOR)) && (thing->health <= 0)) return true; blockdist = thing->radius + tmthing->radius; if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) From 0cca852eb6cf665510a2f9cf00a0026b6228cde1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 12 Nov 2016 15:39:42 +0000 Subject: [PATCH 92/96] Revert "Correction of some other relevant places to the previous commit." This reverts commit a88b21f70301e2dcc652ff4d4ddc9c4a67fe26e2. --- src/p_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d80e1ff41..9223da730 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -434,7 +434,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->type == MT_METALSONIC_RACE && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) { - if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & (MF_SHOOTABLE|MF_MONITOR)))) + if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) return true; blockdist = thing->radius + tmthing->radius; if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) @@ -463,12 +463,12 @@ static boolean PIT_CheckThing(mobj_t *thing) // CA_DASHMODE users destroy spikes and monitors, CA_TWINSPIN users and CA2_MELEE users destroy spikes. if ((tmthing->player) && (((tmthing->player->charability == CA_DASHMODE) && (tmthing->player->dashmode >= 3*TICRATE) - && (thing->flags & MF_MONITOR || thing->type == MT_SPIKE)) + && (thing->flags & (MF_MONITOR) || thing->type == MT_SPIKE)) || ((((tmthing->player->charability == CA_TWINSPIN) && (tmthing->player->panim == PA_ABILITY)) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)) && (thing->type == MT_SPIKE)))) { - if ((thing->flags & (MF_MONITOR)) && (thing->health <= 0)) + if ((thing->flags & (MF_MONITOR)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) return true; blockdist = thing->radius + tmthing->radius; if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) From b7298a55742c7e249beb5cd6e34baff8fcb17360 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 12 Nov 2016 15:39:47 +0000 Subject: [PATCH 93/96] Revert "Nev3r wants to make barrels which are both shootable and die when you break them like you break monitors." This reverts commit 286a8b0289c8c0c40190f66f2473b287788806f1. --- src/info.c | 70 +++++++++++++++++++++++++-------------------------- src/p_enemy.c | 2 +- src/p_inter.c | 4 +-- src/p_map.c | 3 +++ 4 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/info.c b/src/info.c index 585d3e286..802f90f26 100644 --- a/src/info.c +++ b/src/info.c @@ -6019,7 +6019,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RING_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6046,7 +6046,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_PITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6073,7 +6073,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ATTRACT_ICON,// damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6100,7 +6100,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FORCE_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6127,7 +6127,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ARMAGEDDON_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6154,7 +6154,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_WHIRLWIND_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6181,7 +6181,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ELEMENTAL_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6208,7 +6208,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SNEAKERS_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6235,7 +6235,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_INVULN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6262,7 +6262,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_1UP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6289,7 +6289,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_EGGMAN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6316,7 +6316,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_MIXUP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6343,7 +6343,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_UNKNOWN, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6370,7 +6370,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_GRAVITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6397,7 +6397,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RECYCLER_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6424,7 +6424,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SCORE1K_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6451,7 +6451,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SCORE10K_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6478,7 +6478,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FLAMEAURA_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6505,7 +6505,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_BUBBLEWRAP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6532,7 +6532,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_THUNDERCOIN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6559,7 +6559,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_PITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6586,7 +6586,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ATTRACT_ICON,// damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6613,7 +6613,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FORCE_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6640,7 +6640,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ARMAGEDDON_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6667,7 +6667,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_WHIRLWIND_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6694,7 +6694,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ELEMENTAL_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6721,7 +6721,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SNEAKERS_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6748,7 +6748,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_INVULN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6775,7 +6775,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_EGGMAN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6802,7 +6802,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_GRAVITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6829,7 +6829,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FLAMEAURA_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6856,7 +6856,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_BUBBLEWRAP_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6883,7 +6883,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_THUNDERCOIN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR|MF_GRENADEBOUNCE, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, @@ -6910,7 +6910,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RING_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, @@ -6937,7 +6937,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_RING_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, diff --git a/src/p_enemy.c b/src/p_enemy.c index a9f340c98..fb0e41903 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2744,7 +2744,7 @@ void A_GoldMonitorRestore(mobj_t *actor) return; #endif - actor->flags |= MF_MONITOR|(mobjinfo[actor->type].flags & MF_SHOOTABLE); + actor->flags |= MF_MONITOR|MF_SHOOTABLE; actor->flags2 &= ~MF2_STANDONME; actor->health = 1; // Just in case. } diff --git a/src/p_inter.c b/src/p_inter.c index 2dba46592..56e730017 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2907,14 +2907,14 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force) { - if (!(target->flags & (MF_SHOOTABLE|MF_MONITOR))) + if (!(target->flags & MF_SHOOTABLE)) return false; // shouldn't happen... if (target->type == MT_BLACKEGGMAN) return false; // Make sure that boxes cannot be popped by enemies, red rings, etc. - if (!(target->flags & MF_SHOOTABLE) && ((!source || !source->player || source->player->bot) || (inflictor && !inflictor->player))) + if (target->flags & MF_MONITOR && ((!source || !source->player || source->player->bot) || (inflictor && !inflictor->player))) return false; } diff --git a/src/p_map.c b/src/p_map.c index 9223da730..7afd266fd 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3357,6 +3357,9 @@ static boolean PIT_RadiusAttack(mobj_t *thing) if (thing->flags & MF_BOSS) return true; + if (thing->flags & MF_MONITOR) + return true; + dx = abs(thing->x - bombspot->x); dy = abs(thing->y - bombspot->y); dz = abs(thing->z + (thing->height>>1) - bombspot->z); From 1424c3f6cd0be5460a51033803ed4cdacfd1c59c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 23 Nov 2016 22:20:47 +0000 Subject: [PATCH 94/96] Regardless of what I'm doing next, this removal of limits in this place still should've been done a while ago. --- src/p_user.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7acb37093..94e565214 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6982,12 +6982,8 @@ static void P_MovePlayer(player_t *player) break; // Armageddon shield activation case SH_ARMAGEDDON: - // Don't let Super Sonic or invincibility use it - if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) - { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - P_BlackOw(player); - } + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + P_BlackOw(player); break; // Attract shield activation case SH_ATTRACT: From 095a438e9e180f462bbe41e6ec584405ffa5350e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 24 Nov 2016 14:29:29 +0000 Subject: [PATCH 95/96] * Super float now back on spin button, again takes precedence over shield actives. * Fixed BIG mistake where ShieldSpecial hook bailed out of the entire function instead of just the shield section. --- src/p_user.c | 159 ++++++++++++++++++++++++++------------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 94e565214..b6645edac 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6947,95 +6947,96 @@ static void P_MovePlayer(player_t *player) localangle2 = player->mo->angle; } - /////////////////////////// - //BOMB SHIELD ACTIVATION,// - //HOMING, AND OTHER COOL // - //STUFF! // - /////////////////////////// + ////////////////// + //SHIELD ACTIVES// + //& SUPER FLOAT!// + ////////////////// if (player->pflags & PF_JUMPED && !player->exiting && player->mo->health) { if (cmd->buttons & BT_USE) // Spin button effects { -#ifdef HAVE_BLUA - if (LUAh_ShieldSpecial(player)) - return; -#endif - if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously - && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped + if (player->powers[pw_super]) // Super can't use shield actives, only passives { - // Force shield activation - if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) + if ((player->charability == CA_THOK) // Super Sonic float + && (player->speed > 5*player->mo->scale) // FixedMul(5<mo->scale), but scale is FRACUNIT-based + && (P_MobjFlip(player->mo)*player->mo->momz <= 0)) { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->mo->momx = player->mo->momy = player->mo->momz = 0; - S_StartSound(player->mo, sfx_ngskid); - } - else - { - switch (player->powers[pw_shield] & SH_NOSTACK) - { - // Whirlwind/Thundercoin shield activation - case SH_WHIRLWIND: - case SH_THUNDERCOIN: - P_DoJumpShield(player); - break; - // Armageddon shield activation - case SH_ARMAGEDDON: - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - P_BlackOw(player); - break; - // Attract shield activation - case SH_ATTRACT: - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->homing = 2; - if (P_LookForEnemies(player, false) && player->mo->tracer) - { - player->pflags |= PF_FORCEJUMPDAMAGE; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); - S_StartSound(player->mo, sfx_s3k40); - player->homing = 3*TICRATE; - } - else - S_StartSound(player->mo, sfx_s3ka6); - break; - // Elemental/Bubblewrap shield activation - case SH_ELEMENTAL: - case SH_BUBBLEWRAP: - 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; - P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); - S_StartSound(player->mo, - ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - ? sfx_s3k43 - : sfx_s3k44); - break; - // Flame shield activation - case SH_FLAMEAURA: - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - P_Thrust(player->mo, player->mo->angle, FixedMul(30*FRACUNIT - FixedSqrt(FixedDiv(player->speed, player->mo->scale)), player->mo->scale)); - S_StartSound(player->mo, sfx_s3k43); - default: - break; - } + if (player->panim == PA_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL + || (player->panim == PA_WALK && player->mo->state-states != S_PLAY_SUPER_FLOAT)) + P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); + + player->mo->momz = 0; + player->pflags &= ~PF_SPINNING; + player->jumping = 0; // don't cut jump height after bouncing off something } } - } - - if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED) && !player->homing) // Super Sonic move - { - if ((player->charability == CA_THOK) && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) - && P_MobjFlip(player->mo)*player->mo->momz <= 0) + else +#ifdef HAVE_BLUA + if (!LUAh_ShieldSpecial(player)) +#endif { - if (player->mo->state-states == S_PLAY_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL - || (player->panim == PA_WALK && player->mo->state-states != S_PLAY_SUPER_FLOAT)) - P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); - - player->mo->momz = 0; - player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); - player->jumping = 0; // don't cut jump height after bouncing off something + if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously + && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped + { + // Force shield activation + if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) + { + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momx = player->mo->momy = player->mo->momz = 0; + S_StartSound(player->mo, sfx_ngskid); + } + else + { + switch (player->powers[pw_shield] & SH_NOSTACK) + { + // Whirlwind/Thundercoin shield activation + case SH_WHIRLWIND: + case SH_THUNDERCOIN: + P_DoJumpShield(player); + break; + // Armageddon shield activation + case SH_ARMAGEDDON: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + P_BlackOw(player); + break; + // Attract shield activation + case SH_ATTRACT: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->homing = 2; + if (P_LookForEnemies(player, false) && player->mo->tracer) + { + player->pflags |= PF_FORCEJUMPDAMAGE; + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + S_StartSound(player->mo, sfx_s3k40); + player->homing = 3*TICRATE; + } + else + S_StartSound(player->mo, sfx_s3ka6); + break; + // Elemental/Bubblewrap shield activation + case SH_ELEMENTAL: + case SH_BUBBLEWRAP: + 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; + P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); + S_StartSound(player->mo, + ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + ? sfx_s3k43 + : sfx_s3k44); + break; + // Flame shield activation + case SH_FLAMEAURA: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + P_Thrust(player->mo, player->mo->angle, FixedMul(30*FRACUNIT - FixedSqrt(FixedDiv(player->speed, player->mo->scale)), player->mo->scale)); + S_StartSound(player->mo, sfx_s3k43); + default: + break; + } + } + } } } } From fe6b4c4875c48e88225a67468cfa675f1bf381b9 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 13 Dec 2016 21:48:16 +0000 Subject: [PATCH 96/96] Reduced momentum killing of groundpound into slime per Mystic's request. --- src/p_mobj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index d19d8e5fa..81d6de61f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3590,6 +3590,7 @@ void P_MobjCheckWater(mobj_t *mobj) ffloor_t *rover; player_t *p = mobj->player; // Will just be null if not a player. fixed_t height = (p ? P_GetPlayerHeight(p) : mobj->height); // for players, calculation height does not necessarily match actual height for gameplay reasons (spin, etc) + boolean wasgroundpounding = (p && (mobj->eflags & MFE_GOOWATER) && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)); // Default if no water exists. mobj->watertop = mobj->waterbottom = mobj->z - 1000*FRACUNIT; @@ -3691,7 +3692,7 @@ void P_MobjCheckWater(mobj_t *mobj) p->powers[pw_underwater] = underwatertics + 1; } - if ((mobj->eflags & MFE_GOOWATER) && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)) + if (wasgroundpounding) { p->pflags &= ~PF_SHIELDABILITY; mobj->momz >>= 1; @@ -3713,7 +3714,7 @@ void P_MobjCheckWater(mobj_t *mobj) || ((mobj->eflags & MFE_VERTICALFLIP) && mobj->ceilingz-mobj->waterbottom <= height>>1)) return; - if ((mobj->eflags & MFE_GOOWATER || wasingoo)) { // Decide what happens to your momentum when you enter/leave goopy water. + if (!wasgroundpounding && (mobj->eflags & MFE_GOOWATER || wasingoo)) { // Decide what happens to your momentum when you enter/leave goopy water. if (P_MobjFlip(mobj)*mobj->momz < 0) // You are entering the goo? mobj->momz = FixedMul(mobj->momz, FixedDiv(2*FRACUNIT, 5*FRACUNIT)); // kill momentum significantly, to make the goo feel thick. }