Stars in your eyes when you get hit by shells

This commit is contained in:
Sryder13 2017-10-24 13:15:20 +01:00
parent 4be15a9020
commit 0206a42ce6
3 changed files with 46 additions and 7 deletions

View file

@ -58,7 +58,7 @@ char sprnames[NUMSPRITES + 1][5] =
"SPRG","BSPR","RNDM","RPOP","KFRE","DRIF","DSMO","FITM","DFAK","BANA",
"DBAN","GSHE","GSTR","DGSH","RSHE","RSTR","DRSH","BOMB","BLIG","LIGH",
"SINK","SITR","LAKI","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS",
"BUZB","CHOM","SACO","CRAB", "SHAD", "BUMP"
"BUZB","CHOM","SACO","CRAB","SHAD","BUMP","FLEN"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -2855,6 +2855,10 @@ state_t states[NUMSTATES] =
{SPR_BUMP, 1, 5, {NULL}, 0, 0, S_BUMP3}, // S_BUMP2
{SPR_BUMP, 2, 5, {NULL}, 0, 0, S_NULL}, // S_BUMP3
{SPR_FLEN, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FLINGENERGY2}, // S_FLINGENERGY1,
{SPR_FLEN, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_FLINGENERGY3}, // S_FLINGENERGY2,
{SPR_FLEN, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_NULL}, // S_FLINGENERGY3,
#ifdef SEENAMES
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
#endif
@ -16540,6 +16544,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags
S_NULL // raisestate
},
{ // MT_FLINGENERGY
-1, // doomednum
S_FLINGENERGY1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
MT_FLINGENERGY, // 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
60*FRACUNIT, // speed
32*FRACUNIT, // radius
64*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags
S_NULL // raisestate
},
// ============================================================================================================================//
#ifdef SEENAMES

View file

@ -618,6 +618,7 @@ typedef enum sprite
SPR_SHAD, // TD shadows
SPR_BUMP, // Player/shell bump
SPR_FLEN, // Shell hit graphics stuff
SPR_FIRSTFREESLOT,
SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1,
@ -3370,6 +3371,10 @@ typedef enum state
S_BUMP2,
S_BUMP3,
S_FLINGENERGY1,
S_FLINGENERGY2,
S_FLINGENERGY3,
#ifdef SEENAMES
S_NAMECHECK,
#endif
@ -4009,6 +4014,8 @@ typedef enum mobj_type
MT_BUMP,
MT_FLINGENERGY,
#ifdef SEENAMES
MT_NAMECHECK,
#endif

View file

@ -3128,6 +3128,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
K_SpinPlayer(player, source);
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
if (inflictor->type == MT_GREENITEM || inflictor->type == MT_REDITEM)
P_PlayerRingBurst(player, 5);
player->mo->momx = player->mo->momy = 0;
return true;
}
@ -3319,9 +3321,9 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
if (!player)
return;
// If no health, don't spawn ring!
// Never have health in kart I think
if (player->mo->health <= 1)
num_rings = 0;
num_rings = 5;
if (num_rings > 32 && !(player->pflags & PF_NIGHTSFALL))
num_rings = 32;
@ -3336,11 +3338,10 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
// Spill the ammo
P_PlayerWeaponAmmoBurst(player);
// There's no ring spilling in kart, so I'm hijacking this for the same thing as TD
for (i = 0; i < num_rings; i++)
{
INT32 objType = mobjinfo[MT_RING].reactiontime;
if (mariomode)
objType = mobjinfo[MT_COIN].reactiontime;
INT32 objType = mobjinfo[MT_FLINGENERGY].reactiontime;
z = player->mo->z;
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -3381,7 +3382,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
}
else
{
momxy = 2*FRACUNIT;
momxy = 28*FRACUNIT;
momz = 3*FRACUNIT;
}