From ce97c1e98644e660bc77b03b51920099f4cf95dc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 10 Nov 2016 17:51:10 +0000 Subject: [PATCH 1/4] Added basic spindash dust Also cleaned up some of the code in P_DoSpinAbility while I was at it --- src/dehacked.c | 7 ++ src/info.c | 35 +++++++++ src/info.h | 8 +++ src/p_mobj.c | 5 ++ src/p_user.c | 189 ++++++++++++++++++++++++++++++------------------- 5 files changed, 170 insertions(+), 74 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index c3b606fe0..3ef8b0d29 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5566,6 +5566,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_WATERZAP", + // Spindash dust + "S_SPINDUST1", + "S_SPINDUST2", + "S_SPINDUST3", + "S_SPINDUST4", + "S_FOG1", "S_FOG2", "S_FOG3", @@ -6376,6 +6382,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_MEDIUMBUBBLE", // medium bubble "MT_EXTRALARGEBUBBLE", // extra large bubble "MT_WATERZAP", + "MT_SPINDUST", // Spindash dust "MT_TFOG", "MT_SEED", "MT_PARTICLE", diff --git a/src/info.c b/src/info.c index 9fb442883..459238917 100644 --- a/src/info.c +++ b/src/info.c @@ -274,6 +274,7 @@ char sprnames[NUMSPRITES + 1][5] = "SMOK", "BUBL", // Bubble "WZAP", + "DUST", // Spindash dust "TFOG", // Teleport Fog "SEED", // Sonic CD flower seed "PRTL", // Particle (for fans, etc.) @@ -2279,6 +2280,13 @@ state_t states[NUMSTATES] = {SPR_WZAP, FF_TRANS10|FF_ANIMATE|FF_RANDOMANIM, 4, {NULL}, 3, 2, S_NULL}, // S_WATERZAP + // Spindash dust + // TODO: other spin dust types + {SPR_DUST, 0, 7, {NULL}, 0, 0, S_SPINDUST2}, // S_SPINDUST1 + {SPR_DUST, 1, 6, {NULL}, 0, 0, S_SPINDUST3}, // S_SPINDUST2 + {SPR_DUST, FF_TRANS30|2, 4, {NULL}, 0, 0, S_SPINDUST4}, // S_SPINDUST3 + {SPR_DUST, FF_TRANS60|3, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST4 + {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50, 2, {NULL}, 0, 0, S_FOG2}, // S_FOG1 {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|1, 2, {NULL}, 0, 0, S_FOG3}, // S_FOG2 {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|2, 2, {NULL}, 0, 0, S_FOG4}, // S_FOG3 @@ -10940,6 +10948,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_SPINDUST + -1, // doomednum + S_SPINDUST1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // 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 + 4*FRACUNIT, // speed + 4*FRACUNIT, // radius + 4*FRACUNIT, // height + 0, // display offset + 4, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIP, // flags + S_NULL // raisestate + }, + { // MT_TFOG -1, // doomednum S_FOG1, // spawnstate diff --git a/src/info.h b/src/info.h index b0683c172..fc5012d29 100644 --- a/src/info.h +++ b/src/info.h @@ -466,6 +466,7 @@ typedef enum sprite SPR_SMOK, SPR_BUBL, // Bubble SPR_WZAP, + SPR_DUST, // Spindash dust SPR_TFOG, // Teleport Fog SPR_SEED, // Sonic CD flower seed SPR_PRTL, // Particle (for fans, etc.) @@ -2457,6 +2458,12 @@ typedef enum state S_WATERZAP, + // Spindash dust + S_SPINDUST1, + S_SPINDUST2, + S_SPINDUST3, + S_SPINDUST4, + S_FOG1, S_FOG2, S_FOG3, @@ -3286,6 +3293,7 @@ typedef enum mobj_type MT_MEDIUMBUBBLE, // medium bubble MT_EXTRALARGEBUBBLE, // extra large bubble MT_WATERZAP, + MT_SPINDUST, // Spindash dust MT_TFOG, MT_SEED, MT_PARTICLE, diff --git a/src/p_mobj.c b/src/p_mobj.c index e9bcd193a..abe7849f2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7537,6 +7537,11 @@ void P_MobjThinker(mobj_t *mobj) mobj->tracer->y, mobj->tracer->floorz, SPLATDRAWMODE_SHADE); #endif break; + case MT_SPINDUST: // Spindash dust + mobj->momx = FixedMul(mobj->momx, (3*FRACUNIT)/4); // originally 50000 + mobj->momy = FixedMul(mobj->momy, (3*FRACUNIT)/4); // same + //mobj->momz = mobj->momz+P_MobjFlip(mobj)/3; // no meaningful change in value to be frank + break; case MT_SPINFIRE: if (mobj->eflags & MFE_VERTICALFLIP) mobj->z = mobj->ceilingz - mobj->height; diff --git a/src/p_user.c b/src/p_user.c index 697f42e4d..02ab2044c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3667,6 +3667,40 @@ void P_DoJump(player_t *player, boolean soundandstate) } } +static void P_DoSpinDashDust(player_t *player) +{ + UINT32 i; + mobj_t *particle; + UINT32 prandom[3]; + for (i = 0; i <= (leveltime%7)/2; i++) { // 1, 2, 3 or 4 particles + particle = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_SPINDUST); + + if (player->powers[pw_shield] == SH_ELEMENTAL && !(player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))) { + //P_SetMobjState(particle, S_FIREDUST1); + //particle->bubble = false; + } else if (player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER)) { + //P_SetMobjState(particle, S_BUBBLEDUST1); + //particle->bubble = true; + } else { + //P_SetMobjState(particle, S_SPINDUST1); + //particle->bubble = false; + } + P_SetTarget(&particle->target, player->mo); + particle->destscale = (2*player->mo->scale)/3; + P_SetScale(particle, particle->destscale); + if (player->mo->eflags & MFE_VERTICALFLIP) // readjust z position if needed + particle->z = player->mo->z + player->mo->height - particle->height; + prandom[0] = P_RandomFixed()<<2; // P_RandomByte()<<10 + prandom[1] = P_RandomRange(-30, 30); // P_RandomRange(-ANG30/FRACUNIT, ANG30/FRACUNIT)*FRACUNIT + prandom[2] = P_RandomFixed()<<3; // P_RandomByte()<<11 + P_SetObjectMomZ(particle, player->dashspeed/50 + prandom[0], false); + P_InstaThrust(particle, + player->mo->angle + (prandom[1]*ANG1), + -FixedMul(player->dashspeed/12 + FRACUNIT + prandom[2], player->mo->scale)); + P_TryMove(particle, particle->x+particle->momx, particle->y+particle->momy, true); + } +} + // // P_DoSpinAbility // @@ -3674,6 +3708,7 @@ void P_DoJump(player_t *player, boolean soundandstate) // static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) { + boolean canstand = true; // can we stand on the ground? (mostly relevant for slopes) if (player->pflags & PF_STASIS) return; @@ -3685,69 +3720,92 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) } #endif - // Spinning and Spindashing - if ((player->charability2 == CA2_SPINDASH) && !(player->pflags & PF_SLIDING) && !player->exiting - && !P_PlayerInPain(player)) // subsequent revs - { - if ((cmd->buttons & BT_USE) && player->speed < FixedMul(5<mo->scale) && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING) #ifdef ESLOPE - && (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) + canstand = (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2); #endif - ) - { - player->mo->momx = player->cmomx; - player->mo->momy = player->cmomy; - player->pflags |= PF_STARTDASH|PF_SPINNING; - player->dashspeed = player->mindash; - P_SetPlayerMobjState(player->mo, S_PLAY_DASH); - player->pflags |= PF_USEDOWN; - if (!player->spectator) - S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. - } - else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH)) - { - if (player->dashspeed < player->maxdash) - { -#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash) - fixed_t soundcalculation = chargecalculation; - player->dashspeed += FRACUNIT; - if (!player->spectator && soundcalculation != chargecalculation) - S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. -#undef chargecalculation - } - if (player->revitem && !(leveltime % 5)) // Now spawn the color thok circle. - { - P_SpawnSpinMobj(player, player->revitem); - if (demorecording) - G_GhostAddRev(); - } - } - // If not moving up or down, and travelling faster than a speed of four while not holding - // down the spin button and not spinning. - // AKA Just go into a spin on the ground, you idiot. ;) - else if ((cmd->buttons & BT_USE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20)) - && !player->climbing && !player->mo->momz && onground && (player->speed > FixedMul(5<mo->scale) -#ifdef ESLOPE - || (player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) >= FRACUNIT/2) -#endif - ) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING)) + /////////////////////////////// + // ability-specific behavior // + /////////////////////////////// + if (!(player->pflags & PF_SLIDING) && !player->exiting && !P_PlayerInPain(player)) + { + switch (player->charability2) { - player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); - if (!player->spectator) - S_StartSound(player->mo, sfx_spin); - player->pflags |= PF_USEDOWN; + case CA2_SPINDASH: // Spinning and Spindashing + // Start revving + if ((cmd->buttons & BT_USE) && player->speed < FixedMul(5<mo->scale) + && !player->mo->momz && onground && !(player->pflags & (PF_USEDOWN|PF_SPINNING)) + && canstand) + { + player->mo->momx = player->cmomx; + player->mo->momy = player->cmomy; + player->pflags |= PF_STARTDASH|PF_SPINNING; + player->dashspeed = player->mindash; + P_SetPlayerMobjState(player->mo, S_PLAY_DASH); + player->pflags |= PF_USEDOWN; + if (!player->spectator) + S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. + } + // Revving + else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH)) + { + if (player->dashspeed < player->maxdash) + { +#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash) + fixed_t soundcalculation = chargecalculation; + player->dashspeed += FRACUNIT; + if (!player->spectator && soundcalculation != chargecalculation) + S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. +#undef chargecalculation + } + if (player->revitem && !(leveltime % 5)) // Now spawn the color thok circle. + { + P_SpawnSpinMobj(player, player->revitem); + if (demorecording) + G_GhostAddRev(); + } + } + + // If not moving up or down, and travelling faster than a speed of four while not holding + // down the spin button and not spinning. + // AKA Just go into a spin on the ground, you idiot. ;) + else if ((cmd->buttons & BT_USE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20)) + && !player->climbing && !player->mo->momz && onground && (player->speed > FixedMul(5<mo->scale) + || !canstand) && !(player->pflags & (PF_USEDOWN|PF_SPINNING))) + { + player->pflags |= PF_SPINNING; + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + if (!player->spectator) + S_StartSound(player->mo, sfx_spin); + player->pflags |= PF_USEDOWN; + } + break; + case CA2_MELEE: // Melee attack + if (!(player->panim == PA_ABILITY2) && (cmd->buttons & BT_USE) && player->speed < FixedMul(10<mo->scale) + && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) + && canstand) + { + P_ResetPlayer(player); + player->mo->z += P_MobjFlip(player->mo); + player->mo->momx = player->cmomx = 0; + player->mo->momy = player->cmomy = 0; + P_SetObjectMomZ(player->mo, player->mindash, false); + P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->maxdash, player->mo->scale)); + P_SetPlayerMobjState(player->mo, S_PLAY_MELEE); + player->pflags |= PF_USEDOWN; + S_StartSound(player->mo, sfx_s3k8b); + } + break; } } + /////////////////////////////// + // general spinning behavior // + /////////////////////////////// + // Rolling normally if (onground && player->pflags & PF_SPINNING && !(player->pflags & PF_STARTDASH) - && player->speed < FixedMul(5*FRACUNIT,player->mo->scale) -#ifdef ESLOPE - && (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) -#endif - ) + && player->speed < FixedMul(5*FRACUNIT,player->mo->scale) && canstand) { if (GETSECSPECIAL(player->mo->subsector->sector->special, 4) == 7 || (player->mo->ceilingz - player->mo->floorz < P_GetPlayerHeight(player))) P_InstaThrust(player->mo, player->mo->angle, FixedMul(10*FRACUNIT, player->mo->scale)); @@ -3792,29 +3850,12 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) { if (player->mo->state-states != S_PLAY_DASH) P_SetPlayerMobjState(player->mo, S_PLAY_DASH); + // Spawn spin dash dust + if (!(player->mo->eflags & MFE_GOOWATER)) + P_DoSpinDashDust(player); } else if (onground && player->pflags & PF_SPINNING && !(player->panim == PA_ROLL)) P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); - - // Melee attack - if ((player->charability2 == CA2_MELEE) && !(player->panim == PA_ABILITY2) && !player->exiting - && !P_PlayerInPain(player) && (cmd->buttons & BT_USE) && player->speed < FixedMul(10<mo->scale) - && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) -#ifdef ESLOPE - && (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) -#endif - ) - { - P_ResetPlayer(player); - player->mo->z += P_MobjFlip(player->mo); - player->mo->momx = player->cmomx = 0; - player->mo->momy = player->cmomy = 0; - P_SetObjectMomZ(player->mo, player->mindash, false); - P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->maxdash, player->mo->scale)); - P_SetPlayerMobjState(player->mo, S_PLAY_MELEE); - player->pflags |= PF_USEDOWN; - S_StartSound(player->mo, sfx_s3k8b); - } } // From 47c67472ff3ce02ae646c342ec36f5e834ace232 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 10 Nov 2016 21:09:05 +0000 Subject: [PATCH 2/4] Added bubble form of spin dust --- src/dehacked.c | 4 ++++ src/info.c | 5 ++++- src/info.h | 4 ++++ src/p_mobj.c | 7 +++++++ src/p_user.c | 15 +++++---------- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 3ef8b0d29..487ef8cd9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5571,6 +5571,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPINDUST2", "S_SPINDUST3", "S_SPINDUST4", + "S_SPINDUST_BUBBLE1", + "S_SPINDUST_BUBBLE2", + "S_SPINDUST_BUBBLE3", + "S_SPINDUST_BUBBLE4", "S_FOG1", "S_FOG2", diff --git a/src/info.c b/src/info.c index 459238917..d9bf9b463 100644 --- a/src/info.c +++ b/src/info.c @@ -2281,11 +2281,14 @@ state_t states[NUMSTATES] = {SPR_WZAP, FF_TRANS10|FF_ANIMATE|FF_RANDOMANIM, 4, {NULL}, 3, 2, S_NULL}, // S_WATERZAP // Spindash dust - // TODO: other spin dust types {SPR_DUST, 0, 7, {NULL}, 0, 0, S_SPINDUST2}, // S_SPINDUST1 {SPR_DUST, 1, 6, {NULL}, 0, 0, S_SPINDUST3}, // S_SPINDUST2 {SPR_DUST, FF_TRANS30|2, 4, {NULL}, 0, 0, S_SPINDUST4}, // S_SPINDUST3 {SPR_DUST, FF_TRANS60|3, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST4 + {SPR_BUBL, 0, 7, {NULL}, 0, 0, S_SPINDUST_BUBBLE2}, // S_SPINDUST_BUBBLE1 + {SPR_BUBL, 0, 6, {NULL}, 0, 0, S_SPINDUST_BUBBLE3}, // S_SPINDUST_BUBBLE2 + {SPR_BUBL, FF_TRANS30|0, 4, {NULL}, 0, 0, S_SPINDUST_BUBBLE4}, // S_SPINDUST_BUBBLE3 + {SPR_BUBL, FF_TRANS60|0, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST_BUBBLE4 {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50, 2, {NULL}, 0, 0, S_FOG2}, // S_FOG1 {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|1, 2, {NULL}, 0, 0, S_FOG3}, // S_FOG2 diff --git a/src/info.h b/src/info.h index fc5012d29..4545bbbd6 100644 --- a/src/info.h +++ b/src/info.h @@ -2463,6 +2463,10 @@ typedef enum state S_SPINDUST2, S_SPINDUST3, S_SPINDUST4, + S_SPINDUST_BUBBLE1, + S_SPINDUST_BUBBLE2, + S_SPINDUST_BUBBLE3, + S_SPINDUST_BUBBLE4, S_FOG1, S_FOG2, diff --git a/src/p_mobj.c b/src/p_mobj.c index abe7849f2..827d24f3c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7541,6 +7541,13 @@ void P_MobjThinker(mobj_t *mobj) mobj->momx = FixedMul(mobj->momx, (3*FRACUNIT)/4); // originally 50000 mobj->momy = FixedMul(mobj->momy, (3*FRACUNIT)/4); // same //mobj->momz = mobj->momz+P_MobjFlip(mobj)/3; // no meaningful change in value to be frank + if (mobj->state >= &states[S_SPINDUST_BUBBLE1] && mobj->state <= &states[S_SPINDUST_BUBBLE4]) // bubble dust! + { + P_MobjCheckWater(mobj); + if (mobj->watertop != mobj->subsector->sector->floorheight - 1000*FRACUNIT + && mobj->z+mobj->height >= mobj->watertop - 5*FRACUNIT) + mobj->flags2 |= MF2_DONTDRAW; + } break; case MT_SPINFIRE: if (mobj->eflags & MFE_VERTICALFLIP) diff --git a/src/p_user.c b/src/p_user.c index 02ab2044c..7fe015a39 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3671,19 +3671,14 @@ static void P_DoSpinDashDust(player_t *player) { UINT32 i; mobj_t *particle; - UINT32 prandom[3]; + INT32 prandom[3]; for (i = 0; i <= (leveltime%7)/2; i++) { // 1, 2, 3 or 4 particles particle = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_SPINDUST); - if (player->powers[pw_shield] == SH_ELEMENTAL && !(player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))) { - //P_SetMobjState(particle, S_FIREDUST1); - //particle->bubble = false; - } else if (player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER)) { - //P_SetMobjState(particle, S_BUBBLEDUST1); - //particle->bubble = true; - } else { - //P_SetMobjState(particle, S_SPINDUST1); - //particle->bubble = false; + /*if (player->powers[pw_shield] == SH_ELEMENTAL && !(player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))) { + P_SetMobjState(particle, S_SPINDUST_FIRE; + } else */if (player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER)) { + P_SetMobjState(particle, S_SPINDUST_BUBBLE1); } P_SetTarget(&particle->target, player->mo); particle->destscale = (2*player->mo->scale)/3; From c81665b9af3b901b449d9e932f0ffa8f452b755b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 13 Nov 2016 22:02:29 +0000 Subject: [PATCH 3/4] Added flame version --- src/dehacked.c | 4 ++++ src/info.c | 6 ++++++ src/info.h | 5 +++++ src/p_user.c | 8 ++++---- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 487ef8cd9..25429dba3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5575,6 +5575,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPINDUST_BUBBLE2", "S_SPINDUST_BUBBLE3", "S_SPINDUST_BUBBLE4", + "S_SPINDUST_FIRE1", + "S_SPINDUST_FIRE2", + "S_SPINDUST_FIRE3", + "S_SPINDUST_FIRE4", "S_FOG1", "S_FOG2", diff --git a/src/info.c b/src/info.c index d9bf9b463..fb8291f4f 100644 --- a/src/info.c +++ b/src/info.c @@ -275,6 +275,7 @@ char sprnames[NUMSPRITES + 1][5] = "BUBL", // Bubble "WZAP", "DUST", // Spindash dust + "FPRT", // Spindash dust (flame) "TFOG", // Teleport Fog "SEED", // Sonic CD flower seed "PRTL", // Particle (for fans, etc.) @@ -2289,6 +2290,11 @@ state_t states[NUMSTATES] = {SPR_BUBL, 0, 6, {NULL}, 0, 0, S_SPINDUST_BUBBLE3}, // S_SPINDUST_BUBBLE2 {SPR_BUBL, FF_TRANS30|0, 4, {NULL}, 0, 0, S_SPINDUST_BUBBLE4}, // S_SPINDUST_BUBBLE3 {SPR_BUBL, FF_TRANS60|0, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST_BUBBLE4 + {SPR_FPRT, 0, 7, {NULL}, 0, 0, S_SPINDUST_FIRE2}, // S_SPINDUST_FIRE1 + {SPR_FPRT, 0, 6, {NULL}, 0, 0, S_SPINDUST_FIRE3}, // S_SPINDUST_FIRE2 + {SPR_FPRT, FF_TRANS30|0, 4, {NULL}, 0, 0, S_SPINDUST_FIRE4}, // S_SPINDUST_FIRE3 + {SPR_FPRT, FF_TRANS60|0, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST_FIRE4 + {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50, 2, {NULL}, 0, 0, S_FOG2}, // S_FOG1 {SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|1, 2, {NULL}, 0, 0, S_FOG3}, // S_FOG2 diff --git a/src/info.h b/src/info.h index 4545bbbd6..d3f4ad55a 100644 --- a/src/info.h +++ b/src/info.h @@ -467,6 +467,7 @@ typedef enum sprite SPR_BUBL, // Bubble SPR_WZAP, SPR_DUST, // Spindash dust + SPR_FPRT, // Spindash dust (flame) SPR_TFOG, // Teleport Fog SPR_SEED, // Sonic CD flower seed SPR_PRTL, // Particle (for fans, etc.) @@ -2467,6 +2468,10 @@ typedef enum state S_SPINDUST_BUBBLE2, S_SPINDUST_BUBBLE3, S_SPINDUST_BUBBLE4, + S_SPINDUST_FIRE1, + S_SPINDUST_FIRE2, + S_SPINDUST_FIRE3, + S_SPINDUST_FIRE4, S_FOG1, S_FOG2, diff --git a/src/p_user.c b/src/p_user.c index 7fe015a39..69fdc56b0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3675,11 +3675,11 @@ static void P_DoSpinDashDust(player_t *player) for (i = 0; i <= (leveltime%7)/2; i++) { // 1, 2, 3 or 4 particles particle = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_SPINDUST); - /*if (player->powers[pw_shield] == SH_ELEMENTAL && !(player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER))) { - P_SetMobjState(particle, S_SPINDUST_FIRE; - } else */if (player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER)) { + if (player->mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER)) // overrides fire version P_SetMobjState(particle, S_SPINDUST_BUBBLE1); - } + else if (player->powers[pw_shield] == SH_ELEMENTAL) + P_SetMobjState(particle, S_SPINDUST_FIRE1); + P_SetTarget(&particle->target, player->mo); particle->destscale = (2*player->mo->scale)/3; P_SetScale(particle, particle->destscale); From 6e70acc82d60a7551a8e02f8c0315f9bdea572d4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 13 Nov 2016 22:33:57 +0000 Subject: [PATCH 4/4] Added SF_NOSPINDASHDUST to disable spindash dust --- src/d_player.h | 1 + src/dehacked.c | 1 + src/p_user.c | 2 +- src/r_things.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/d_player.h b/src/d_player.h index bd553d9fa..a39b058e2 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -44,6 +44,7 @@ typedef enum SF_STOMPDAMAGE = 1<<9, // Always damage enemies, etc by landing on them, no matter your vunerability? SF_MARIODAMAGE = SF_NOJUMPDAMAGE|SF_STOMPDAMAGE, // The Mario method of being able to damage enemies, etc. SF_MACHINE = 1<<10, // Beep boop. Are you a robot? + SF_NOSPINDASHDUST = 1<<11, // Don't spawn dust particles when charging a spindash // free up to and including 1<<31 } skinflags_t; diff --git a/src/dehacked.c b/src/dehacked.c index 25429dba3..3a8a42129 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7060,6 +7060,7 @@ struct { {"SF_STOMPDAMAGE",SF_STOMPDAMAGE}, {"SF_MARIODAMAGE",SF_MARIODAMAGE}, {"SF_MACHINE",SF_MACHINE}, + {"SF_NOSPINDASHDUST",SF_NOSPINDASHDUST}, // Character abilities! // Primary diff --git a/src/p_user.c b/src/p_user.c index 69fdc56b0..9cab4c2cd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3846,7 +3846,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) if (player->mo->state-states != S_PLAY_DASH) P_SetPlayerMobjState(player->mo, S_PLAY_DASH); // Spawn spin dash dust - if (!(player->mo->eflags & MFE_GOOWATER)) + if (!(player->charflags & SF_NOSPINDASHDUST) && !(player->mo->eflags & MFE_GOOWATER)) P_DoSpinDashDust(player); } else if (onground && player->pflags & PF_SPINNING && !(player->panim == PA_ROLL)) diff --git a/src/r_things.c b/src/r_things.c index 9f6cad529..a55bc8582 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2880,6 +2880,7 @@ void R_AddSkins(UINT16 wadnum) GETFLAG(STOMPDAMAGE) GETFLAG(MARIODAMAGE) GETFLAG(MACHINE) + GETFLAG(NOSPINDASHDUST) #undef GETFLAG else // let's check if it's a sound, otherwise error out