Minor refactor of what I did last night - as a modifiable state instead of hardcoded references.

This commit is contained in:
toasterbabe 2016-10-20 13:44:03 +01:00
parent 8fe932b0e7
commit c1a8dd9a37
5 changed files with 11 additions and 8 deletions

View File

@ -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",

View File

@ -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

View File

@ -2306,6 +2306,8 @@ typedef enum state
S_FORC19,
S_FORC20,
S_FORC21,
S_ELEM1,
S_ELEM2,
S_ELEM3,

View File

@ -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<<FF_TRANSSHIFT); // U at 50% transparency
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->fuse = 10;
whoosh->tics = -1;
whoosh->flags |= MF_NOCLIPHEIGHT;
whoosh->height = 42*FRACUNIT;
mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh

View File

@ -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