Updated player arrows

This commit is contained in:
TehRealSalt 2018-02-11 21:47:19 -05:00
parent b93ec25c83
commit 889e547550
5 changed files with 632 additions and 611 deletions

View file

@ -6466,20 +6466,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FIREDITEM4",
"S_PLAYERARROW", // Above player arrow
"S_PLAYERARROW_SNEAKER",
"S_PLAYERARROW_BANANA",
"S_PLAYERARROW_FAKEITEM",
"S_PLAYERARROW_HYUDORO",
"S_PLAYERARROW_POGOSPRING",
"S_PLAYERARROW_JAWZ",
"S_PLAYERARROW_MINE",
"S_PLAYERARROW_BALLHOG",
"S_PLAYERARROW_ORBINAUT",
"S_PLAYERARROW_BOX",
"S_PLAYERARROW_ITEM",
"S_PLAYERARROW_INVINCIBILITY",
"S_PLAYERARROW_GROW",
"S_PLAYERARROW_KITCHENSINK",
"S_PLAYERARROW_EMPTY",
"S_PLAYERARROW_ROULETTE",
"S_PLAYERARROW_NUMBER",
"S_PLAYERARROW_X",
"S_PLAYERBOMB", // Player bomb overlay
"S_PLAYERBOMB_WHEEL",

View file

@ -58,7 +58,8 @@ char sprnames[NUMSPRITES + 1][5] =
"SPRG","BSPR","RNDM","KFRE","KINV","KINF","DRIF","DSMO","FITM","BANA",
"GSHE","RSHE","SSMN","KRBM","BLIG","LIGH","SINK","SITR","KBLN","LAKI",
"POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO",
"CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","PBOM"
"CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM","ITMI","ITMN",
"PBOM"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -2906,20 +2907,12 @@ state_t states[NUMSTATES] =
// Above player arrow
{SPR_ARRO, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW
{SPR_ARRO, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_SNEAKER
{SPR_ARRO, FF_FULLBRIGHT|3, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BANANA
{SPR_ARRO, FF_FULLBRIGHT|4, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_FAKEITEM
{SPR_ARRO, FF_FULLBRIGHT|5, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_HYUDORO
{SPR_ARRO, FF_FULLBRIGHT|6, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_POGOSPRING
{SPR_ARRO, FF_FULLBRIGHT|7, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_JAWZ
{SPR_ARRO, FF_FULLBRIGHT|8, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_MINE
{SPR_ARRO, FF_FULLBRIGHT|9, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BALLHOG
{SPR_ARRO, FF_FULLBRIGHT|10, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_ORBINAUT
{SPR_ARRO, FF_FULLBRIGHT|13, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_INVINCIBILITY
{SPR_ARRO, FF_FULLBRIGHT|14, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_GROW
{SPR_ARRO, FF_FULLBRIGHT|15, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_KITCHENSINK
{SPR_ARRO, FF_FULLBRIGHT|16, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_EMPTY
{SPR_ARRO, FF_FULLBRIGHT|FF_ANIMATE|1, -1, {NULL}, 5, 3, S_NULL}, // S_PLAYERARROW_ROULETTE
{SPR_ARRO, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BOX
{SPR_ITEM, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_ITEM
{SPR_ITMI, FF_FULLBRIGHT|FF_ANIMATE, -1, {NULL}, 6, 3, S_NULL}, // S_PLAYERARROW_INVINCIBILITY
{SPR_ITEM, FF_FULLBRIGHT|FF_ANIMATE, -1, {NULL}, 16, 3, S_NULL}, // S_PLAYERARROW_ROULETTE
{SPR_ITMN, FF_FULLBRIGHT, -1, {NULL}, 16, 3, S_NULL}, // S_PLAYERARROW_NUMBER
{SPR_ITMN, FF_FULLBRIGHT|10, -1, {NULL}, 16, 3, S_NULL}, // S_PLAYERARROW_X
{SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB
{SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERBOMB_WHEEL

View file

@ -620,6 +620,9 @@ typedef enum sprite
SPR_PSHW, // thrown indicator
SPR_ARRO, // player arrows
SPR_ITEM,
SPR_ITMI,
SPR_ITMN,
SPR_PBOM, // player bomb
@ -3428,20 +3431,12 @@ typedef enum state
S_FIREDITEM4,
S_PLAYERARROW, // Above player arrow
S_PLAYERARROW_SNEAKER,
S_PLAYERARROW_BANANA,
S_PLAYERARROW_FAKEITEM,
S_PLAYERARROW_HYUDORO,
S_PLAYERARROW_POGOSPRING,
S_PLAYERARROW_JAWZ,
S_PLAYERARROW_MINE,
S_PLAYERARROW_BALLHOG,
S_PLAYERARROW_ORBINAUT,
S_PLAYERARROW_BOX,
S_PLAYERARROW_ITEM,
S_PLAYERARROW_INVINCIBILITY,
S_PLAYERARROW_GROW,
S_PLAYERARROW_KITCHENSINK,
S_PLAYERARROW_EMPTY,
S_PLAYERARROW_ROULETTE,
S_PLAYERARROW_NUMBER,
S_PLAYERARROW_X,
S_PLAYERBOMB,
S_PLAYERBOMB_WHEEL,

View file

@ -6845,44 +6845,85 @@ void P_MobjThinker(mobj_t *mobj)
}
P_SetThingPosition(mobj);
// Set it to use the correct states for its condition
if (mobj->target->player->kartstuff[k_itemroulette])
{
if (mobj->state != &states[S_PLAYERARROW_ROULETTE]) // don't reset FF_ANIMATE
P_SetMobjState(mobj, S_PLAYERARROW_ROULETTE);
}
else
{
switch(mobj->target->player->kartstuff[k_itemtype])
{
case KITEM_KITCHENSINK: P_SetMobjState(mobj, S_PLAYERARROW_KITCHENSINK); break;
case KITEM_GROW: P_SetMobjState(mobj, S_PLAYERARROW_GROW); break;
case KITEM_INVINCIBILITY: P_SetMobjState(mobj, S_PLAYERARROW_INVINCIBILITY); break;
case KITEM_ORBINAUT: P_SetMobjState(mobj, S_PLAYERARROW_ORBINAUT); break;
case KITEM_BALLHOG: P_SetMobjState(mobj, S_PLAYERARROW_BALLHOG); break;
case KITEM_MINE: P_SetMobjState(mobj, S_PLAYERARROW_MINE); break;
case KITEM_JAWZ: P_SetMobjState(mobj, S_PLAYERARROW_JAWZ); break;
case KITEM_POGOSPRING: P_SetMobjState(mobj, S_PLAYERARROW_POGOSPRING); break;
case KITEM_HYUDORO: P_SetMobjState(mobj, S_PLAYERARROW_HYUDORO); break;
case KITEM_FAKE: P_SetMobjState(mobj, S_PLAYERARROW_FAKEITEM); break;
case KITEM_BANANA: P_SetMobjState(mobj, S_PLAYERARROW_BANANA); break;
case KITEM_SNEAKER: P_SetMobjState(mobj, S_PLAYERARROW_SNEAKER); break;
default: P_SetMobjState(mobj, S_PLAYERARROW); break; // S_INVISIBLE
}
}
if (mobj->target->player->kartstuff[k_growshrinktimer] > 1 && (leveltime & 1))
P_SetMobjState(mobj, S_PLAYERARROW_GROW);
else if (mobj->target->player->kartstuff[k_growshrinktimer] > 1 && !(leveltime & 1))
P_SetMobjState(mobj, S_PLAYERARROW_EMPTY); // S_INVISIBLE
scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale);
if (scale > 16*FRACUNIT)
{
scale = 16*FRACUNIT;
}
mobj->destscale = scale;
if (!(mobj->flags2 & MF2_DONTDRAW))
{
if (!mobj->tracer)
{
mobj->tracer = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
P_SetTarget(&mobj->tracer->target, mobj);
P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM);
P_SetScale(mobj->tracer, mobj->scale);
}
// Set it to use the correct states for its condition
if (mobj->target->player->kartstuff[k_itemroulette])
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
if (mobj->tracer->state != &states[S_PLAYERARROW_ROULETTE]) // don't reset FF_ANIMATE
P_SetMobjState(mobj->tracer, S_PLAYERARROW_ROULETTE);
}
else if (mobj->target->player->kartstuff[k_itemtype])
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
if (mobj->tracer->state != &states[S_PLAYERARROW_ITEM]
|| mobj->tracer->state != &states[S_PLAYERARROW_INVINCIBILITY])
P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM);
switch (mobj->target->player->kartstuff[k_itemtype])
{
case KITEM_INVINCIBILITY:
if (mobj->tracer->state != &states[S_PLAYERARROW_INVINCIBILITY])
P_SetMobjState(mobj->tracer, S_PLAYERARROW_INVINCIBILITY);
break;
case KITEM_SAD:
mobj->tracer->frame = FF_FULLBRIGHT;
break;
default:
mobj->tracer->frame = FF_FULLBRIGHT|(mobj->tracer->target->player->kartstuff[k_itemtype]);
break;
}
if (mobj->target->player->kartstuff[k_growshrinktimer] > 1 && (leveltime & 1))
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW;
else if (mobj->target->player->kartstuff[k_growshrinktimer] > 1 && !(leveltime & 1))
P_SetMobjState(mobj, S_INVISIBLE);
}
else
{
P_SetMobjState(mobj, S_PLAYERARROW);
P_SetMobjState(mobj->tracer, S_INVISIBLE);
}
mobj->tracer->destscale = scale;
if (mobj->target->player->kartstuff[k_itemamount] > 1
&& mobj->target->player->kartstuff[k_itemamount] < 10) // Meh, too difficult to support greater than this :V
{
mobj_t *number = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
mobj_t *numx = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
P_SetTarget(&number->target, mobj);
P_SetMobjState(number, S_PLAYERARROW_NUMBER);
P_SetScale(number, mobj->scale);
number->fuse = 1;
number->destscale = scale;
number->frame = FF_FULLBRIGHT|(mobj->target->player->kartstuff[k_itemamount]);
P_SetTarget(&numx->target, mobj);
P_SetMobjState(numx, S_PLAYERARROW_X);
P_SetScale(numx, mobj->scale);
numx->fuse = 1;
numx->destscale = scale;
}
}
}
else if (mobj->health > 0)
{

File diff suppressed because it is too large Load diff