diff --git a/src/deh_tables.c b/src/deh_tables.c index 4c0a1c058..a524e7aa8 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -952,9 +952,10 @@ struct int_const_s const INT_CONST[] = { // for P_DamageMobj //// Damage types {"DMG_NORMAL",DMG_NORMAL}, - {"DMG_SQUISH",DMG_SQUISH}, {"DMG_WIPEOUT",DMG_WIPEOUT}, {"DMG_EXPLODE",DMG_EXPLODE}, + {"DMG_SQUISH",DMG_SQUISH}, + {"DMG_VOLTAGE",DMG_VOLTAGE}, {"DMG_KARMA",DMG_KARMA}, //// Death types {"DMG_INSTAKILL",DMG_INSTAKILL}, diff --git a/src/k_collide.c b/src/k_collide.c index 9a27a73d4..591a22615 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -665,10 +665,13 @@ static inline BlockItReturn_t PIT_ThunderShieldAttack(mobj_t *thing) return BMIT_CONTINUE; } - if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY)) + if (thing->type != MT_SPB) { - // Not shootable - return BMIT_CONTINUE; + if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY)) + { + // Not shootable + return BMIT_CONTINUE; + } } if (thing->player && thing->player->spectator) @@ -691,7 +694,7 @@ static inline BlockItReturn_t PIT_ThunderShieldAttack(mobj_t *thing) } #endif - P_DamageMobj(thing, lightningSource, lightningSource, 1, DMG_NORMAL|DMG_CANTHURTSELF); + P_DamageMobj(thing, lightningSource, lightningSource, 1, DMG_VOLTAGE|DMG_CANTHURTSELF); return BMIT_CONTINUE; } diff --git a/src/p_inter.c b/src/p_inter.c index 838aff900..97a852b42 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2083,6 +2083,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da { player_t *player; boolean force = false; + boolean spbpop = false; if (objectplacing) return false; @@ -2097,6 +2098,16 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (source && source->player && source->player->spectator) return false; + switch (target->type) + { + case MT_SPB: + spbpop = (damagetype & DMG_TYPEMASK) == DMG_VOLTAGE; + break; + + default: + break; + } + // Everything above here can't be forced. if (!metalrecording) { @@ -2111,8 +2122,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force) { - if (!(target->flags & MF_SHOOTABLE)) - return false; // shouldn't happen... + if (!spbpop) + { + if (!(target->flags & MF_SHOOTABLE)) + return false; // shouldn't happen... + } } if (target->flags2 & MF2_SKULLFLY) @@ -2317,6 +2331,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da LUA_HookPlayerSpin(target, inflictor, source, damage, damagetype); K_KartPainEnergyFling(player); break; + case DMG_VOLTAGE: case DMG_NORMAL: default: K_SpinPlayer(player, inflictor, source, KSPIN_SPINOUT); diff --git a/src/p_local.h b/src/p_local.h index 09f23b231..bfcccf4a4 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -559,7 +559,7 @@ struct BasicFF_t #define DMG_WIPEOUT 0x01 // Normal, but with extra flashy effects #define DMG_EXPLODE 0x02 #define DMG_SQUISH 0x03 -//#define free 0x04 +#define DMG_VOLTAGE 0x04 // Normal but for killing the spb #define DMG_KARMA 0x05 // Karma Bomb explosion -- works like DMG_EXPLODE, but steals half of their bumpers & deletes the rest //// Death types - cannot be combined with damage types #define DMG_INSTAKILL 0x80