Finish visuals

Sprites, animation, & speed lines
This commit is contained in:
TehRealSalt 2018-10-20 14:41:49 -04:00
parent 2021897972
commit e02a86ceae
4 changed files with 80 additions and 5 deletions

View file

@ -6476,7 +6476,26 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_BALLHOGBOOM16",
// Self-Propelled Bomb - just an explosion for now...
"S_SPB",
"S_SPB1",
"S_SPB2",
"S_SPB3",
"S_SPB4",
"S_SPB5",
"S_SPB6",
"S_SPB7",
"S_SPB8",
"S_SPB9",
"S_SPB10",
"S_SPB11",
"S_SPB12",
"S_SPB13",
"S_SPB14",
"S_SPB15",
"S_SPB16",
"S_SPB17",
"S_SPB18",
"S_SPB19",
"S_SPB20",
"S_SPB_DEAD",
// Thunder Shield

View file

@ -2777,8 +2777,27 @@ state_t states[NUMSTATES] =
{SPR_BHBM, FF_FULLBRIGHT|14, 1, {NULL}, 0, 0, S_BALLHOGBOOM16}, // S_BALLHOGBOOM15
{SPR_BHBM, FF_FULLBRIGHT|15, 1, {NULL}, 0, 0, S_NULL}, // S_BALLHOGBOOM16
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB}, // S_SPB
{SPR_SPBM, 0, 175, {NULL}, 0, 0, S_NULL}, // S_SPB_DEAD
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB2}, // S_SPB1
{SPR_SPBM, 1, 1, {A_SPBChase}, 0, 0, S_SPB3}, // S_SPB2
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB4}, // S_SPB3
{SPR_SPBM, 2, 1, {A_SPBChase}, 0, 0, S_SPB5}, // S_SPB4
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB6}, // S_SPB5
{SPR_SPBM, 3, 1, {A_SPBChase}, 0, 0, S_SPB7}, // S_SPB6
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB8}, // S_SPB7
{SPR_SPBM, 4, 1, {A_SPBChase}, 0, 0, S_SPB9}, // S_SPB8
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB10}, // S_SPB9
{SPR_SPBM, 5, 1, {A_SPBChase}, 0, 0, S_SPB11}, // S_SPB10
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB12}, // S_SPB11
{SPR_SPBM, 6, 1, {A_SPBChase}, 0, 0, S_SPB13}, // S_SPB12
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB14}, // S_SPB13
{SPR_SPBM, 7, 1, {A_SPBChase}, 0, 0, S_SPB15}, // S_SPB14
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB16}, // S_SPB15
{SPR_SPBM, 8, 1, {A_SPBChase}, 0, 0, S_SPB17}, // S_SPB16
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB18}, // S_SPB17
{SPR_SPBM, 8, 1, {A_SPBChase}, 0, 0, S_SPB19}, // S_SPB18
{SPR_SPBM, 0, 1, {A_SPBChase}, 0, 0, S_SPB20}, // S_SPB19
{SPR_SPBM, 8, 1, {A_SPBChase}, 0, 0, S_SPB1}, // S_SPB20
{SPR_SPBM, 8, 175, {NULL}, 0, 0, S_NULL}, // S_SPB_DEAD
{SPR_THNS, FF_FULLBRIGHT|9, 2, {NULL}, 0, 0, S_THUNDERSHIELD2}, // S_THUNDERSHIELD1
{SPR_THNS, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_THUNDERSHIELD3}, // S_THUNDERSHIELD2
@ -15342,7 +15361,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
{ // MT_SPB
-1, // doomednum
S_SPB, // spawnstate
S_SPB1, // spawnstate
1, // spawnhealth
S_NULL, // seestate
sfx_tossed, // seesound

View file

@ -3318,7 +3318,26 @@ typedef enum state
S_BALLHOGBOOM16,
// Self-Propelled Bomb
S_SPB,
S_SPB1,
S_SPB2,
S_SPB3,
S_SPB4,
S_SPB5,
S_SPB6,
S_SPB7,
S_SPB8,
S_SPB9,
S_SPB10,
S_SPB11,
S_SPB12,
S_SPB13,
S_SPB14,
S_SPB15,
S_SPB16,
S_SPB17,
S_SPB18,
S_SPB19,
S_SPB20,
S_SPB_DEAD,
// Thunder Shield

View file

@ -8412,6 +8412,24 @@ void A_SPBChase(mobj_t *actor)
actor->momx = FixedMul(FixedMul(xyspeed, FINECOSINE(actor->angle>>ANGLETOFINESHIFT)), FINECOSINE(actor->movedir>>ANGLETOFINESHIFT));
actor->momy = FixedMul(FixedMul(xyspeed, FINESINE(actor->angle>>ANGLETOFINESHIFT)), FINECOSINE(actor->movedir>>ANGLETOFINESHIFT));
actor->momz = FixedMul(zspeed, FINESINE(actor->movedir>>ANGLETOFINESHIFT));
// Red speed lines for when it's gaining on its target. A tell for when you're starting to lose too much speed!
if (R_PointToDist2(0, 0, actor->momx, actor->momy) > (actor->tracer->player ? (16*actor->tracer->player->speed)/15
: (16*R_PointToDist2(0, 0, actor->tracer->momx, actor->tracer->momy))/15) // Going faster than the target
&& xyspeed > K_GetKartSpeed(actor->tracer->player, false)/4) // Don't display speedup lines at pitifully low speeds
{
mobj_t *fast = P_SpawnMobj(actor->x + (P_RandomRange(-24,24) * actor->scale),
actor->y + (P_RandomRange(-24,24) * actor->scale),
actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale),
MT_FASTLINE);
fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy);
//fast->momx = 3*actor->momx/4;
//fast->momy = 3*actor->momy/4;
//fast->momz = 3*actor->momz/4;
fast->color = SKINCOLOR_RED;
fast->colorized = true;
}
return;
}
else // Target's gone, return to SEEKING