From e02a86ceae8968e4506e8d661a299f3fd9235fd2 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 20 Oct 2018 14:41:49 -0400 Subject: [PATCH] Finish visuals Sprites, animation, & speed lines --- src/dehacked.c | 21 ++++++++++++++++++++- src/info.c | 25 ++++++++++++++++++++++--- src/info.h | 21 ++++++++++++++++++++- src/p_enemy.c | 18 ++++++++++++++++++ 4 files changed, 80 insertions(+), 5 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 0fe6faee..2e0fdf29 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -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 diff --git a/src/info.c b/src/info.c index 0aaec78e..bebced60 100644 --- a/src/info.c +++ b/src/info.c @@ -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 diff --git a/src/info.h b/src/info.h index 8ab16824..41b08928 100644 --- a/src/info.h +++ b/src/info.h @@ -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 diff --git a/src/p_enemy.c b/src/p_enemy.c index 163fcf5d..cd4c49b5 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -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