From 75ac351940111540dc65fd37cc0b48b43315c0cf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 11 Mar 2017 02:09:01 +0000 Subject: [PATCH] It's 2am, I'll upload the exe and player.dta to the ftp later. * Super sprites are now deliniated via an additional S_SUPER lump between S_START and S_END. Above are normal sprites, below are super sprites. Handled internally via FF_SPR2SUPER. * Sprite2 numbers are now appropriately limited for the data type that stores them. * SPR2_SPIN is now SPR2_ROLL, SPR2_DASH is now SPR2_SPIN and SPR2_PEEL is now SPR2_DASH. Makes more sense, right? --- src/d_player.h | 15 ++-- src/dehacked.c | 34 ++------ src/info.c | 58 +++----------- src/info.h | 62 ++++----------- src/lua_baselib.c | 2 +- src/p_inter.c | 7 +- src/p_mobj.c | 192 +++++++++++++--------------------------------- src/p_pspr.h | 6 +- src/p_spec.c | 12 +-- src/p_user.c | 75 +++++------------- src/r_things.c | 35 ++++++--- src/r_things.h | 2 +- 12 files changed, 155 insertions(+), 345 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 9c14a5e37..c7fc70777 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -32,20 +32,19 @@ // Extra abilities/settings for skins (combinable stuff) typedef enum { - SF_SUPER = 1, // Can turn super in singleplayer/co-op mode. - SF_SUPERANIMS = 1<<1, // If super, use the super sonic animations - SF_SUPERSPIN = 1<<2, // Should spin frames be played while super? - SF_HIRES = 1<<3, // Draw the sprite 2x as small? + SF_SUPER = 1, // Can turn super in singleplayer/co-op mode? + SF_NOSUPERSPIN = 1<<1, // Should spin frames be played while super? + SF_NOSPINDASHDUST = 1<<2, // Spawn dust particles when charging a spindash? + SF_HIRES = 1<<3, // Draw the sprite at different size? SF_NOSKID = 1<<4, // No skid particles etc SF_NOSPEEDADJUST = 1<<5, // Skin-specific version of disablespeedadjust SF_RUNONWATER = 1<<6, // Run on top of water FOFs? - SF_NOJUMPSPIN = 1<<7, // SPR2_JUMP defaults to SPR2_SPRG instead of SPR2_SPIN, falling states used, and player height is full when jumping? + SF_NOJUMPSPIN = 1<<7, // SPR2_JUMP defaults to SPR2_SPRG instead of SPR2_ROLL, falling states used, and player height is full when jumping? SF_NOJUMPDAMAGE = 1<<8, // Don't damage enemies, etc whilst jumping? 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 - SF_DASHMODE = 1<<12, // Sonic Advance 2 style top speed increase? + SF_DASHMODE = 1<<11, // Sonic Advance 2 style top speed increase? // free up to and including 1<<31 } skinflags_t; @@ -175,7 +174,7 @@ typedef enum PA_EDGE, PA_WALK, PA_RUN, - PA_PEEL, + PA_DASH, PA_PAIN, PA_ROLL, PA_JUMP, diff --git a/src/dehacked.c b/src/dehacked.c index 9c3c8bbbc..915986c50 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3910,12 +3910,13 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAY_WAIT", "S_PLAY_WALK", "S_PLAY_RUN", - "S_PLAY_PEEL", + "S_PLAY_DASH", "S_PLAY_PAIN", + "S_PLAY_STUN", "S_PLAY_DEAD", "S_PLAY_DRWN", - "S_PLAY_SPIN", - "S_PLAY_DASH", + "S_PLAY_ROLL", + "S_PLAY_SPINDASH", "S_PLAY_GASP", "S_PLAY_JUMP", "S_PLAY_SPRING", @@ -3948,25 +3949,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAY_MELEE", "S_PLAY_MELEE_FINISH", - // SF_SUPERANIMS - "S_PLAY_SUPER_STND", - "S_PLAY_SUPER_WALK", - "S_PLAY_SUPER_RUN", - "S_PLAY_SUPER_PEEL", - "S_PLAY_SUPER_PAIN", - "S_PLAY_SUPER_STUN", - "S_PLAY_SUPER_DEAD", - "S_PLAY_SUPER_DRWN", - "S_PLAY_SUPER_SPIN", - "S_PLAY_SUPER_GASP", - "S_PLAY_SUPER_JUMP", - "S_PLAY_SUPER_SPRING", - "S_PLAY_SUPER_FALL", - "S_PLAY_SUPER_EDGE", - "S_PLAY_SUPER_RIDE", - "S_PLAY_SUPER_FLOAT", - "S_PLAY_SUPER_FLOAT_RUN", - // SF_SUPER "S_PLAY_SUPERTRANS1", "S_PLAY_SUPERTRANS2", @@ -7245,6 +7227,7 @@ struct { {"FF_FRAMEMASK",FF_FRAMEMASK}, {"FF_VERTICALFLIP",FF_VERTICALFLIP}, {"FF_PAPERSPRITE",FF_PAPERSPRITE}, + {"FF_SPR2SUPER",FF_SPR2SUPER}, {"FF_SPR2ENDSTATE",FF_SPR2ENDSTATE}, {"FF_SPR2MIDSTART",FF_SPR2MIDSTART}, {"FF_ANIMATE",FF_ANIMATE}, @@ -7389,8 +7372,8 @@ struct { // Character flags (skinflags_t) {"SF_SUPER",SF_SUPER}, - {"SF_SUPERANIMS",SF_SUPERANIMS}, - {"SF_SUPERSPIN",SF_SUPERSPIN}, + {"SF_NOSUPERSPIN",SF_NOSUPERSPIN}, + {"SF_NOSPINDASHDUST",SF_NOSPINDASHDUST}, {"SF_HIRES",SF_HIRES}, {"SF_NOSKID",SF_NOSKID}, {"SF_NOSPEEDADJUST",SF_NOSPEEDADJUST}, @@ -7400,7 +7383,6 @@ struct { {"SF_STOMPDAMAGE",SF_STOMPDAMAGE}, {"SF_MARIODAMAGE",SF_MARIODAMAGE}, {"SF_MACHINE",SF_MACHINE}, - {"SF_NOSPINDASHDUST",SF_NOSPINDASHDUST}, {"SF_DASHMODE",SF_DASHMODE}, // Character abilities! @@ -7488,7 +7470,7 @@ struct { {"PA_EDGE",PA_EDGE}, {"PA_WALK",PA_WALK}, {"PA_RUN",PA_RUN}, - {"PA_PEEL",PA_PEEL}, + {"PA_DASH",PA_DASH}, {"PA_PAIN",PA_PAIN}, {"PA_ROLL",PA_ROLL}, {"PA_JUMP",PA_JUMP}, diff --git a/src/info.c b/src/info.c index 1a10a04f9..a961157b2 100644 --- a/src/info.c +++ b/src/info.c @@ -390,12 +390,13 @@ char spr2names[NUMPLAYERSPRITES][5] = "WAIT", "WALK", "RUN_", - "PEEL", + "DASH", "PAIN", + "STUN", "DEAD", "DRWN", + "ROLL", "SPIN", - "DASH", "GASP", "JUMP", "SPNG", @@ -403,9 +404,6 @@ char spr2names[NUMPLAYERSPRITES][5] = "EDGE", "RIDE", - "SIGN", - "LIFE", - "FLY_", "SWIM", "TIRE", @@ -425,23 +423,6 @@ char spr2names[NUMPLAYERSPRITES][5] = "MLEE", "TRNS", - "SSTD", - "SWLK", - "SRUN", - "SPEE", - "SPAN", - "SSTN", - "SDTH", - "SDRN", - "SSPN", - "SGSP", - "SJMP", - "SSPG", - "SFAL", - "SEDG", - "SRID", - "SFLT", - "SFRN", "NTRN", "NSTD", @@ -476,7 +457,10 @@ char spr2names[NUMPLAYERSPRITES][5] = "DRL9", "DRLA", "DRLB", - "DRLC" + "DRLC", + + "SIGN", + "LIFE" }; enum playersprite free_spr2 = SPR2_FIRSTFREESLOT; @@ -510,12 +494,13 @@ state_t states[NUMSTATES] = {SPR_PLAY, SPR2_WAIT|FF_ANIMATE, -1, {NULL}, 0, 16, S_NULL}, // S_PLAY_WAIT {SPR_PLAY, SPR2_WALK, 4, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_WALK {SPR_PLAY, SPR2_RUN , 2, {NULL}, 0, 0, S_PLAY_RUN}, // S_PLAY_RUN - {SPR_PLAY, SPR2_PEEL, 2, {NULL}, 0, 0, S_PLAY_PEEL}, // S_PLAY_PEEL + {SPR_PLAY, SPR2_DASH, 2, {NULL}, 0, 0, S_PLAY_DASH}, // S_PLAY_DASH {SPR_PLAY, SPR2_PAIN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_FALL}, // S_PLAY_PAIN + {SPR_PLAY, SPR2_STUN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_FALL}, // S_PLAY_STUN {SPR_PLAY, SPR2_DEAD|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_DEAD {SPR_PLAY, SPR2_DRWN|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_DRWN - {SPR_PLAY, SPR2_SPIN, 1, {NULL}, 0, 0, S_PLAY_SPIN}, // S_PLAY_SPIN - {SPR_PLAY, SPR2_DASH, 2, {NULL}, 0, 0, S_PLAY_DASH}, // S_PLAY_DASH + {SPR_PLAY, SPR2_ROLL, 1, {NULL}, 0, 0, S_PLAY_ROLL}, // S_PLAY_ROLL + {SPR_PLAY, SPR2_SPIN, 2, {NULL}, 0, 0, S_PLAY_SPINDASH}, // S_PLAY_SPINDASH {SPR_PLAY, SPR2_GASP|FF_ANIMATE, 14, {NULL}, 0, 4, S_PLAY_WALK}, // S_PLAY_GASP {SPR_PLAY, SPR2_JUMP, 1, {NULL}, 0, 0, S_PLAY_JUMP}, // S_PLAY_JUMP {SPR_PLAY, SPR2_SPNG, 2, {NULL}, 0, 0, S_PLAY_SPRING}, // S_PLAY_SPRING @@ -548,25 +533,6 @@ state_t states[NUMSTATES] = {SPR_PLAY, SPR2_MLEE|FF_SPR2ENDSTATE, 1, {NULL}, S_PLAY_MELEE_FINISH, 0, S_PLAY_MELEE}, // S_PLAY_MELEE {SPR_PLAY, SPR2_MLEE, 20, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_MELEE_FINISH - // SF_SUPERANIMS - {SPR_PLAY, SPR2_SSTD|FF_ANIMATE, -1, {NULL}, 0, 7, S_NULL}, // S_PLAY_SUPER_STND - {SPR_PLAY, SPR2_SWLK, 7, {NULL}, 0, 0, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_WALK - {SPR_PLAY, SPR2_SRUN, 7, {NULL}, 0, 0, S_PLAY_SUPER_RUN}, // S_PLAY_SUPER_RUN - {SPR_PLAY, SPR2_SPEE, 7, {NULL}, 0, 0, S_PLAY_SUPER_PEEL}, // S_PLAY_SUPER_PEEL - {SPR_PLAY, SPR2_SPAN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_PAIN - {SPR_PLAY, SPR2_SSTN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_STUN - {SPR_PLAY, SPR2_SDTH|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_SUPER_DEAD - {SPR_PLAY, SPR2_SDRN|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_SUPER_DRWN - {SPR_PLAY, SPR2_SSPN, 1, {NULL}, 0, 0, S_PLAY_SUPER_SPIN}, // S_PLAY_SUPER_SPIN - {SPR_PLAY, SPR2_SGSP|FF_ANIMATE, 14, {NULL}, 0, 4, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_GASP - {SPR_PLAY, SPR2_SJMP, 1, {NULL}, 0, 0, S_PLAY_SUPER_JUMP}, // S_PLAY_SUPER_JUMP - {SPR_PLAY, SPR2_SSPG, 2, {NULL}, 0, 0, S_PLAY_SUPER_SPRING}, // S_PLAY_SUPER_SPRING - {SPR_PLAY, SPR2_SFAL, 2, {NULL}, 0, 0, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_FALL - {SPR_PLAY, SPR2_SEDG|FF_ANIMATE, -1, {NULL}, 0, 12, S_NULL}, // S_PLAY_SUPER_EDGE - {SPR_PLAY, SPR2_SRID, 4, {NULL}, 0, 0, S_PLAY_SUPER_RIDE}, // S_PLAY_SUPER_RIDE - {SPR_PLAY, SPR2_SFLT, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT}, // S_PLAY_SUPER_FLOAT - {SPR_PLAY, SPR2_SFRN, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT_RUN}, // S_PLAY_SUPER_FLOAT_RUN - // SF_SUPER {SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS {SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS3}, // S_PLAY_SUPER_TRANS2 @@ -3078,7 +3044,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MT_THOK, // painchance sfx_None, // painsound S_NULL, // meleestate - S_PLAY_SPIN, // missilestate + S_PLAY_ROLL, // missilestate S_PLAY_DEAD, // deathstate S_PLAY_DRWN, // xdeathstate sfx_None, // deathsound diff --git a/src/info.h b/src/info.h index cf3a4f916..f7e61614a 100644 --- a/src/info.h +++ b/src/info.h @@ -594,8 +594,8 @@ typedef enum sprite NUMSPRITES } spritenum_t; -// Make sure to be conscious of FF_FRAMEMASK whenever you change this table. -// Currently, FF_FRAMEMASK is 0x1ff, or 511 - and NUMSPRITEFREESLOTS is 256. +// Make sure to be conscious of FF_FRAMEMASK and the fact sprite2 is stored as a UINT8 whenever you change this table. +// Currently, FF_FRAMEMASK is 0x7f, or 127 - and the limitation of sprite2 storage is 255, so the second half is used by FF_SPR2SUPER. // Since this is zero-based, there can be at most 256 different SPR2_'s without changing that. enum playersprite { @@ -603,12 +603,13 @@ enum playersprite SPR2_WAIT, SPR2_WALK, SPR2_RUN , - SPR2_PEEL, + SPR2_DASH, SPR2_PAIN, + SPR2_STUN, SPR2_DEAD, SPR2_DRWN, // drown - SPR2_SPIN, - SPR2_DASH, // spindash charge + SPR2_ROLL, + SPR2_SPIN, // spindash charge SPR2_GASP, SPR2_JUMP, SPR2_SPNG, // spring @@ -616,9 +617,6 @@ enum playersprite SPR2_EDGE, SPR2_RIDE, - SPR2_SIGN, // end sign head - SPR2_LIFE, // life monitor icon - SPR2_FLY , SPR2_SWIM, SPR2_TIRE, // tired @@ -638,23 +636,6 @@ enum playersprite SPR2_MLEE, // melee SPR2_TRNS, // super transformation - SPR2_SSTD, // super stand - SPR2_SWLK, // super walk - SPR2_SRUN, // super run - SPR2_SPEE, // super peelout - SPR2_SPAN, // super pain - SPR2_SSTN, // super stun - SPR2_SDTH, // super death - SPR2_SDRN, // super drown - SPR2_SSPN, // super spin - SPR2_SGSP, // super gasp - SPR2_SJMP, // super jump - SPR2_SSPG, // super spring - SPR2_SFAL, // super fall - SPR2_SEDG, // super edge - SPR2_SRID, // super ride - SPR2_SFLT, // super float - SPR2_SFRN, // super float run SPR2_NTRN, // NiGHTS transformation SPR2_NSTD, // NiGHTS stand @@ -693,8 +674,11 @@ enum playersprite SPR2_DRLB, SPR2_DRLC, + SPR2_SIGN, // end sign head + SPR2_LIFE, // life monitor icon + SPR2_FIRSTFREESLOT, - SPR2_LASTFREESLOT = SPR2_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1, + SPR2_LASTFREESLOT = 0x7f, NUMPLAYERSPRITES }; @@ -720,12 +704,13 @@ typedef enum state S_PLAY_WAIT, S_PLAY_WALK, S_PLAY_RUN, - S_PLAY_PEEL, + S_PLAY_DASH, S_PLAY_PAIN, + S_PLAY_STUN, S_PLAY_DEAD, S_PLAY_DRWN, - S_PLAY_SPIN, - S_PLAY_DASH, + S_PLAY_ROLL, + S_PLAY_SPINDASH, S_PLAY_GASP, S_PLAY_JUMP, S_PLAY_SPRING, @@ -758,25 +743,6 @@ typedef enum state S_PLAY_MELEE, S_PLAY_MELEE_FINISH, - // SF_SUPERANIMS - S_PLAY_SUPER_STND, - S_PLAY_SUPER_WALK, - S_PLAY_SUPER_RUN, - S_PLAY_SUPER_PEEL, - S_PLAY_SUPER_PAIN, - S_PLAY_SUPER_STUN, - S_PLAY_SUPER_DEAD, - S_PLAY_SUPER_DRWN, - S_PLAY_SUPER_SPIN, - S_PLAY_SUPER_GASP, - S_PLAY_SUPER_JUMP, - S_PLAY_SUPER_SPRING, - S_PLAY_SUPER_FALL, - S_PLAY_SUPER_EDGE, - S_PLAY_SUPER_RIDE, - S_PLAY_SUPER_FLOAT, - S_PLAY_SUPER_FLOAT_RUN, - // SF_SUPER S_PLAY_SUPER_TRANS, S_PLAY_SUPER_TRANS2, diff --git a/src/lua_baselib.c b/src/lua_baselib.c index def0ad1b3..de78fa2c0 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -352,7 +352,7 @@ static int lib_pIsValidSprite2(lua_State *L) //HUDSAFE if (!mobj) return LUA_ErrInvalid(L, "mobj_t"); - lua_pushboolean(L, (mobj->skin && (((skin_t *)mobj->skin)->sprites[spr2].numframes > 0))); + lua_pushboolean(L, (mobj->skin && (((skin_t *)mobj->skin)->sprites[spr2].numframes))); return 1; } diff --git a/src/p_inter.c b/src/p_inter.c index 600874a4c..e456c59bc 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1472,7 +1472,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { player->powers[pw_carry] = CR_MACESPIN; S_StartSound(toucher, sfx_spin); - P_SetPlayerMobjState(toucher, S_PLAY_SPIN); + P_SetPlayerMobjState(toucher, S_PLAY_ROLL); } else player->powers[pw_carry] = CR_GENERIC; @@ -2829,10 +2829,7 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so P_InstaThrust(player->mo, ang, fallbackspeed); - if (player->charflags & SF_SUPERANIMS) - P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_STUN); - else - P_SetPlayerMobjState(player->mo, player->mo->info->painstate); + P_SetPlayerMobjState(player->mo, S_PLAY_STUN); P_ResetPlayer(player); diff --git a/src/p_mobj.c b/src/p_mobj.c index 9d076478c..272f3bfca 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -187,32 +187,49 @@ static void P_CyclePlayerMobjState(mobj_t *mobj) // // P_GetMobjSprite2 +// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing. +// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version. // UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2) { player_t *player = mobj->player; skin_t *skin = ((skin_t *)mobj->skin); + boolean super = false; if (!skin) return 0; - while ((skin->sprites[spr2].numframes <= 0) + if ((super = (player // only manipulate output if player... + && (player->powers[pw_super] // and (if they're super... + || ((player->pflags & PF_NIGHTSMODE) && (skin->flags & SF_SUPER)))))) // or if they're in nights and are a skin that CAN go super...) + spr2 |= FF_SPR2SUPER; + + while (!(skin->sprites[spr2].numframes) && spr2 != SPR2_STND) { + if (spr2 & FF_SPR2SUPER) + { + spr2 &= ~FF_SPR2SUPER; + continue; + } + switch(spr2) { - case SPR2_PEEL: - spr2 = SPR2_RUN; + case SPR2_DASH: + spr2 = SPR2_RUN ; break; case SPR2_RUN: spr2 = SPR2_WALK; break; + case SPR2_STUN: + spr2 = SPR2_PAIN; + break; case SPR2_DRWN: spr2 = SPR2_DEAD; break; - case SPR2_DASH: - spr2 = SPR2_SPIN; + case SPR2_SPIN: + spr2 = SPR2_ROLL; break; case SPR2_GASP: spr2 = SPR2_SPNG; @@ -221,7 +238,7 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2) spr2 = ((player ? player->charflags : skin->flags) - & SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_SPIN; + & SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL; break; case SPR2_SPNG: // spring spr2 = SPR2_FALL; @@ -247,7 +264,7 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2) spr2 = SPR2_FLY; break; case SPR2_CLMB: - spr2 = SPR2_SPIN; + spr2 = SPR2_ROLL; break; case SPR2_CLNG: spr2 = SPR2_CLMB; @@ -264,79 +281,26 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2) spr2 = SPR2_FALL; break; case SPR2_BLND: - spr2 = SPR2_SPIN; + spr2 = SPR2_ROLL; break; case SPR2_TWIN: - spr2 = SPR2_SPIN; + spr2 = SPR2_ROLL; break; case SPR2_MLEE: spr2 = SPR2_TWIN; break; - // Super sprites fallback to regular sprites - case SPR2_SWLK: - spr2 = SPR2_WALK; - break; - case SPR2_SRUN: - spr2 = SPR2_RUN; - break; - case SPR2_SPEE: - spr2 = SPR2_PEEL; - break; - case SPR2_SPAN: - spr2 = SPR2_PAIN; - break; - case SPR2_SSTN: - spr2 = SPR2_SPAN; - break; - case SPR2_SDTH: - spr2 = SPR2_DEAD; - break; - case SPR2_SDRN: - spr2 = SPR2_DRWN; - break; - case SPR2_SSPN: - spr2 = SPR2_SPIN; - break; - case SPR2_SGSP: - spr2 = SPR2_GASP; - break; - case SPR2_SJMP: - spr2 = ((player - ? player->charflags - : skin->flags) - & SF_NOJUMPSPIN) ? SPR2_SSPG : SPR2_SSPN; - break; - case SPR2_SSPG: - spr2 = SPR2_SPNG; - break; - case SPR2_SFAL: - spr2 = SPR2_FALL; - break; - case SPR2_SEDG: - spr2 = SPR2_EDGE; - break; - case SPR2_SRID: - spr2 = SPR2_RIDE; - break; - case SPR2_SFLT: - spr2 = SPR2_SWLK; - break; - case SPR2_SFRN: - spr2 = SPR2_SRUN; - break; - // NiGHTS sprites. case SPR2_NTRN: spr2 = SPR2_TRNS; break; case SPR2_NSTD: - spr2 = SPR2_SSTD; + spr2 = SPR2_STND; break; case SPR2_NFLT: - spr2 = (skin->flags & SF_SUPERANIMS) ? SPR2_SFLT : SPR2_FALL; // This is skin-exclusive so the default NiGHTS skin changing system plays nice. + spr2 = SPR2_FLT ; break; case SPR2_NPUL: spr2 = SPR2_NFLT; @@ -345,10 +309,10 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2) spr2 = SPR2_NPUL; break; case SPR2_NATK: - spr2 = SPR2_SSPN; + spr2 = SPR2_ROLL; break; /*case SPR2_NGT0: - spr2 = SPR2_STND; + spr2 = SPR2_NFLT; break;*/ case SPR2_NGT1: case SPR2_NGT7: @@ -407,7 +371,11 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2) spr2 = SPR2_STND; break; } + + if (super) + spr2 |= FF_SPR2SUPER; } + return spr2; } @@ -444,49 +412,12 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) else if (state == S_PLAY_SWIM && !(player->mo->eflags & MFE_UNDERWATER)) return P_SetPlayerMobjState(player->mo, S_PLAY_FLY); - // Catch state changes for Super Sonic - if (player->powers[pw_super] && (player->charflags & SF_SUPERANIMS)) + // Catch SF_NOSUPERSPIN jumps for Supers + if (player->powers[pw_super]) { - switch (state) - { - case S_PLAY_STND: - case S_PLAY_WAIT: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_STND); - case S_PLAY_WALK: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_WALK); - case S_PLAY_RUN: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_RUN); - case S_PLAY_PEEL: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_PEEL); - case S_PLAY_PAIN: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_PAIN); - case S_PLAY_DEAD: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_DEAD); - case S_PLAY_DRWN: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_DRWN); - case S_PLAY_SPIN: - if (!(player->charflags & SF_SUPERSPIN)) - return true; - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_SPIN); - case S_PLAY_GASP: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_GASP); - case S_PLAY_JUMP: - if (!(player->charflags & SF_SUPERSPIN)) - return true; - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_JUMP); - case S_PLAY_SPRING: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_SPRING); - case S_PLAY_FALL: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_FALL); - case S_PLAY_EDGE: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_EDGE); - case S_PLAY_FLOAT: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_FLOAT); - case S_PLAY_FLOAT_RUN: - return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_FLOAT_RUN); - default: - break; - } + if ((player->charflags & SF_NOSUPERSPIN) + && (state == S_PLAY_ROLL || state == S_PLAY_JUMP)) + return true; } // You were in pain state after taking a hit, and you're moving out of pain state now? else if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == flashingtics && state != mobj->info->painstate) @@ -502,49 +433,37 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) { case S_PLAY_STND: case S_PLAY_WAIT: - case S_PLAY_SUPER_STND: player->panim = PA_IDLE; break; case S_PLAY_EDGE: - case S_PLAY_SUPER_EDGE: player->panim = PA_EDGE; break; case S_PLAY_WALK: case S_PLAY_FLOAT: - case S_PLAY_SUPER_WALK: - case S_PLAY_SUPER_FLOAT: player->panim = PA_WALK; break; case S_PLAY_RUN: case S_PLAY_FLOAT_RUN: - case S_PLAY_SUPER_RUN: - case S_PLAY_SUPER_FLOAT_RUN: player->panim = PA_RUN; break; - case S_PLAY_PEEL: - case S_PLAY_SUPER_PEEL: - player->panim = PA_PEEL; + case S_PLAY_DASH: + player->panim = PA_DASH; break; case S_PLAY_PAIN: - case S_PLAY_SUPER_PAIN: - case S_PLAY_SUPER_STUN: + case S_PLAY_STUN: player->panim = PA_PAIN; break; - case S_PLAY_SPIN: - //case S_PLAY_DASH: -- everyone can ROLL thanks to zoom tubes... - case S_PLAY_SUPER_SPIN: + case S_PLAY_ROLL: + //case S_PLAY_SPINDASH: -- everyone can ROLL thanks to zoom tubes... player->panim = PA_ROLL; break; case S_PLAY_JUMP: - case S_PLAY_SUPER_JUMP: player->panim = PA_JUMP; break; case S_PLAY_SPRING: - case S_PLAY_SUPER_SPRING: player->panim = PA_SPRING; break; case S_PLAY_FALL: - case S_PLAY_SUPER_FALL: player->panim = PA_FALL; break; case S_PLAY_FLY: @@ -555,13 +474,12 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) case S_PLAY_TWINSPIN: player->panim = PA_ABILITY; break; - case S_PLAY_DASH: // ...but the act of SPINDASHING is charability2 specific. + case S_PLAY_SPINDASH: // ...but the act of SPINDASHING is charability2 specific. case S_PLAY_MELEE: case S_PLAY_MELEE_FINISH: player->panim = PA_ABILITY2; break; case S_PLAY_RIDE: - case S_PLAY_SUPER_RIDE: player->panim = PA_RIDE; break; default: @@ -635,7 +553,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) else mobj->tics = 4; } - else if ((player->panim == PA_RUN) || (player->panim == PA_PEEL)) + else if ((player->panim == PA_RUN) || (player->panim == PA_DASH)) { if (speed > 52<tics = 1; @@ -3299,26 +3217,26 @@ static void P_PlayerZMovement(mobj_t *mo) { if (mo->player->cmomx || mo->player->cmomy) { - if (mo->player->charflags & SF_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_PEEL) - P_SetPlayerMobjState(mo, S_PLAY_PEEL); + if (mo->player->charflags & SF_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_DASH) + P_SetPlayerMobjState(mo, S_PLAY_DASH); else if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale) - && (mo->player->panim != PA_RUN || mo->state-states == S_PLAY_FLOAT_RUN || mo->state-states == S_PLAY_SUPER_FLOAT_RUN)) + && (mo->player->panim != PA_RUN || mo->state-states == S_PLAY_FLOAT_RUN || mo->sprite2 & FF_SPR2SUPER)) P_SetPlayerMobjState(mo, S_PLAY_RUN); else if ((mo->player->rmomx || mo->player->rmomy) - && (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_FLOAT || mo->state-states == S_PLAY_SUPER_FLOAT)) + && (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_FLOAT || mo->sprite2 & FF_SPR2SUPER)) P_SetPlayerMobjState(mo, S_PLAY_WALK); else if (!mo->player->rmomx && !mo->player->rmomy && mo->player->panim != PA_IDLE) P_SetPlayerMobjState(mo, S_PLAY_STND); } else { - if (mo->player->charflags & SF_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_PEEL) - P_SetPlayerMobjState(mo, S_PLAY_PEEL); + if (mo->player->charflags & SF_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_DASH) + P_SetPlayerMobjState(mo, S_PLAY_DASH); else if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale) - && (mo->player->panim != PA_RUN || mo->state-states == S_PLAY_FLOAT_RUN || mo->state-states == S_PLAY_SUPER_FLOAT_RUN)) + && (mo->player->panim != PA_RUN || mo->state-states == S_PLAY_FLOAT_RUN || mo->sprite2 & FF_SPR2SUPER)) P_SetPlayerMobjState(mo, S_PLAY_RUN); else if ((mo->momx || mo->momy) - && (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_FLOAT || mo->state-states == S_PLAY_SUPER_FLOAT)) + && (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_FLOAT || mo->sprite2 & FF_SPR2SUPER)) P_SetPlayerMobjState(mo, S_PLAY_WALK); else if (!mo->momx && !mo->momy && mo->player->panim != PA_IDLE) P_SetPlayerMobjState(mo, S_PLAY_STND); @@ -3328,7 +3246,7 @@ static void P_PlayerZMovement(mobj_t *mo) if ((mo->player->charability2 == CA2_SPINDASH) && !(mo->player->pflags & PF_THOKKED) && (mo->player->cmd.buttons & BT_USE) && (FixedHypot(mo->momx, mo->momy) > (5*mo->scale))) { mo->player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(mo, S_PLAY_SPIN); + P_SetPlayerMobjState(mo, S_PLAY_ROLL); S_StartSound(mo, sfx_spin); } else diff --git a/src/p_pspr.h b/src/p_pspr.h index 97d7adb94..fccfac3a3 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -35,9 +35,11 @@ #pragma interface #endif -/// \brief Frame flags: only the frame number - 0 to 511 (Frames from 0 to 63, Sprite2 number uses full range) -#define FF_FRAMEMASK 0x1ff +/// \brief Frame flags: only the frame number - 0 to 127 (Frames from 0 to 63, Sprite2 number uses full range) +#define FF_FRAMEMASK 0x7f +/// \brief Frame flags - SPR2: Super sprite2 +#define FF_SPR2SUPER 0x80 /// \brief Frame flags - SPR2: A change of state at the end of Sprite2 animation #define FF_SPR2ENDSTATE 0x1000 /// \brief Frame flags - SPR2: 50% of starting in middle of Sprite2 animation diff --git a/src/p_spec.c b/src/p_spec.c index b4380bb4b..577940094 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3747,7 +3747,7 @@ DoneSection2: if (!(player->pflags & PF_SPINNING)) player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } player->powers[pw_flashing] = TICRATE/3; @@ -3908,7 +3908,7 @@ DoneSection2: if (!(player->pflags & PF_SPINNING) && P_IsObjectOnGround(player->mo) && (player->charability2 == CA2_SPINDASH)) { player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); S_StartAttackSound(player->mo, sfx_spin); if (abs(player->rmomx) < FixedMul(5*FRACUNIT, player->mo->scale) @@ -3988,9 +3988,9 @@ DoneSection2: player->pflags &= ~(PF_JUMPED|PF_GLIDING|PF_SLIDING|PF_CANCARRY); player->climbing = 0; - if (player->mo->state-states != S_PLAY_SPIN) + if (player->mo->state-states != S_PLAY_ROLL) { - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); S_StartSound(player->mo, sfx_spin); } } @@ -4068,9 +4068,9 @@ DoneSection2: player->pflags &= ~(PF_JUMPED|PF_GLIDING|PF_SLIDING|PF_CANCARRY); player->climbing = 0; - if (player->mo->state-states != S_PLAY_SPIN) + if (player->mo->state-states != S_PLAY_ROLL) { - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); S_StartSound(player->mo, sfx_spin); } } diff --git a/src/p_user.c b/src/p_user.c index f7f20ac85..5d3caf023 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3506,42 +3506,8 @@ static void P_DoSuperStuff(player_t *player) if (gametype != GT_COOP) player->powers[pw_flashing] = flashingtics-1; - if (player->mo->health > 0) - { - if (player->pflags & PF_JUMPED) - P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); - else if (player->pflags & PF_SPINNING && player->mo->state-states != S_PLAY_DASH) - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); - else switch (player->mo->state-states) - { - default: - P_SetPlayerMobjState(player->mo, S_PLAY_STND); - break; - case S_PLAY_DASH: - break; - case S_PLAY_SUPER_WALK: - P_SetPlayerMobjState(player->mo, S_PLAY_WALK); - break; - case S_PLAY_SUPER_RUN: - P_SetPlayerMobjState(player->mo, S_PLAY_RUN); - break; - case S_PLAY_SUPER_PEEL: - P_SetPlayerMobjState(player->mo, S_PLAY_PEEL); - break; - case S_PLAY_SUPER_PAIN: - P_SetPlayerMobjState(player->mo, S_PLAY_PAIN); - break; - case S_PLAY_SUPER_SPRING: - P_SetPlayerMobjState(player->mo, S_PLAY_SPRING); - break; - case S_PLAY_SUPER_FALL: - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - break; - case S_PLAY_SUPER_RIDE: - P_SetPlayerMobjState(player->mo, S_PLAY_RIDE); - break; - } - } + if ((player->mo->health > 0) && (player->mo->sprite2 & FF_SPR2SUPER)) + P_SetPlayerMobjState(player->mo, player->mo->state-states); // Inform the netgame that the champion has fallen in the heat of battle. if (gametype != GT_COOP) @@ -3807,7 +3773,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) player->mo->momy = player->cmomy; player->pflags |= PF_STARTDASH|PF_SPINNING; player->dashspeed = player->mindash; - P_SetPlayerMobjState(player->mo, S_PLAY_DASH); + P_SetPlayerMobjState(player->mo, S_PLAY_SPINDASH); player->pflags |= PF_USEDOWN; if (!player->spectator) S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. @@ -3840,7 +3806,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) || !canstand) && !(player->pflags & (PF_USEDOWN|PF_SPINNING))) { player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); if (!player->spectator) S_StartSound(player->mo, sfx_spin); player->pflags |= PF_USEDOWN; @@ -3896,7 +3862,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) { if (player->dashspeed) { - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->dashspeed, player->mo->scale)); // catapult forward ho!! } else @@ -3914,14 +3880,14 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) if (onground && player->pflags & PF_STARTDASH) { - if (player->mo->state-states != S_PLAY_DASH) - P_SetPlayerMobjState(player->mo, S_PLAY_DASH); + if (player->mo->state-states != S_PLAY_SPINDASH) + P_SetPlayerMobjState(player->mo, S_PLAY_SPINDASH); // Spawn spin dash dust if (!(player->charflags & SF_NOSPINDASHDUST) && !(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); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } // @@ -4281,7 +4247,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY) { if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE) - P_SetPlayerMobjState(player->mo, S_PLAY_PEEL); + P_SetPlayerMobjState(player->mo, S_PLAY_DASH); else if (player->speed >= FixedMul(player->runspeed, player->mo->scale)) P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN); else @@ -6721,7 +6687,7 @@ static void P_MovePlayer(player_t *player) { // If the player is in dashmode, here's their peelout. if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE && player->panim == PA_RUN && !player->skidtime && (onground || ((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super])) - P_SetPlayerMobjState (player->mo, S_PLAY_PEEL); + P_SetPlayerMobjState (player->mo, S_PLAY_DASH); // If the player is moving fast enough, // break into a run! else if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime @@ -6744,7 +6710,7 @@ static void P_MovePlayer(player_t *player) // If your peelout animation is playing, and you're // going too slow, switch back to the run. - if (player->charflags & SF_DASHMODE && player->panim == PA_PEEL && player->dashmode < 3*TICRATE) + if (player->charflags & SF_DASHMODE && player->panim == PA_DASH && player->dashmode < 3*TICRATE) P_SetPlayerMobjState(player->mo, S_PLAY_RUN); // If your running animation is playing, and you're @@ -7106,7 +7072,7 @@ static void P_MovePlayer(player_t *player) #endif } // Otherwise, face the direction you're travelling. - else if (player->panim == PA_WALK || player->panim == PA_RUN || player->panim == PA_PEEL || player->panim == PA_ROLL || player->panim == PA_JUMP + else if (player->panim == PA_WALK || player->panim == PA_RUN || player->panim == PA_DASH || player->panim == PA_ROLL || player->panim == PA_JUMP || (player->panim == PA_ABILITY && player->mo->state-states == S_PLAY_GLIDE)) player->mo->angle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy); @@ -7132,9 +7098,8 @@ static void P_MovePlayer(player_t *player) && (player->speed > 5*player->mo->scale) // FixedMul(5<mo->scale), but scale is FRACUNIT-based && (P_MobjFlip(player->mo)*player->mo->momz <= 0)) { - if (player->panim == PA_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL - || (player->panim == PA_WALK && player->mo->state-states != S_PLAY_SUPER_FLOAT)) - P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); + if (player->panim != PA_RUN && player->mo->state-states != S_PLAY_FLOAT) + P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT); player->mo->momz = 0; player->pflags &= ~PF_SPINNING; @@ -7177,7 +7142,7 @@ static void P_MovePlayer(player_t *player) if (P_LookForEnemies(player, false) && player->mo->tracer) { player->pflags |= PF_FORCEJUMPDAMAGE; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); S_StartSound(player->mo, sfx_s3k40); player->homing = 3*TICRATE; } @@ -7188,7 +7153,7 @@ static void P_MovePlayer(player_t *player) case SH_ELEMENTAL: case SH_BUBBLEWRAP: player->pflags |= PF_FORCEJUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); player->secondjump = 0; player->mo->momx = player->mo->momy = 0; P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); @@ -7306,7 +7271,7 @@ static void P_MovePlayer(player_t *player) fixed_t oldheight = player->mo->height; // Less height while spinning. Good for spinning under things...? - if ((player->mo->state == &states[player->mo->info->painstate] || player->mo->state == &states[S_PLAY_SUPER_PAIN]) + if ((player->mo->state == &states[player->mo->info->painstate]) || (!(player->charflags & SF_NOJUMPSPIN) && (player->pflags & PF_JUMPED)) || (player->pflags & PF_SPINNING) || player->powers[pw_tailsfly] || player->pflags & PF_GLIDING @@ -7326,7 +7291,7 @@ static void P_MovePlayer(player_t *player) if ((player->charability2 == CA2_SPINDASH) && !(player->pflags & PF_SPINNING)) { player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } else if (player->mo->ceilingz - player->mo->floorz < player->mo->height) { @@ -9057,7 +9022,7 @@ void P_PlayerThink(player_t *player) if (!(player->charflags & SF_NOJUMPSPIN)) P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); else if (player->pflags & PF_FORCEJUMPDAMAGE) - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } if (player->flashcount) @@ -9302,7 +9267,7 @@ void P_PlayerThink(player_t *player) { P_DoZoomTube(player); if (!(player->panim == PA_ROLL)) - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } player->rmomx = player->rmomy = 0; // no actual momentum from your controls P_ResetScore(player); diff --git a/src/r_things.c b/src/r_things.c index 10b398f00..cd3c91f37 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2899,8 +2899,8 @@ void R_AddSkins(UINT16 wadnum) // these are uppercase so they can be concatenated with SF_ // 1, true, yes are all valid values GETFLAG(SUPER) - GETFLAG(SUPERANIMS) - GETFLAG(SUPERSPIN) + GETFLAG(NOSUPERSPIN) + GETFLAG(NOSPINDASHDUST) GETFLAG(HIRES) GETFLAG(NOSKID) GETFLAG(NOSPEEDADJUST) @@ -2910,7 +2910,7 @@ void R_AddSkins(UINT16 wadnum) GETFLAG(STOMPDAMAGE) GETFLAG(MARIODAMAGE) GETFLAG(MACHINE) - GETFLAG(NOSPINDASHDUST) + GETFLAG(DASHMODE) #undef GETFLAG else // let's check if it's a sound, otherwise error out @@ -2956,20 +2956,35 @@ next_token: // Add sprites { - UINT16 z; + UINT16 newlastlump; UINT8 sprite2; lump++; // start after S_SKIN lastlump = W_CheckNumForNamePwad("S_END",wadnum,lump); // stop at S_END - // old wadding practices die hard -- stop at S_SKIN or S_START if they come before S_END. - z = W_CheckNumForNamePwad("S_SKIN",wadnum,lump); - if (z < lastlump) lastlump = z; - z = W_CheckNumForNamePwad("S_START",wadnum,lump); - if (z < lastlump) lastlump = z; - // load all sprite sets we are aware of. + // old wadding practices die hard -- stop at S_SKIN or S_START if they come before S_END. + newlastlump = W_CheckNumForNamePwad("S_SKIN",wadnum,lump); + if (newlastlump < lastlump) lastlump = newlastlump; + newlastlump = W_CheckNumForNamePwad("S_START",wadnum,lump); + if (newlastlump < lastlump) lastlump = newlastlump; + + // ...and let's handle super, too + newlastlump = W_CheckNumForNamePwad("S_SUPER",wadnum,lump); + if (newlastlump < lastlump) + { + newlastlump++; + // load all sprite sets we are aware of... for super! + for (sprite2 = 0; sprite2 < free_spr2; sprite2++) + R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, lastlump); + + newlastlump--; + lastlump = newlastlump; // okay, make the normal sprite set loading end there + } + + // load all sprite sets we are aware of... for normal stuff. for (sprite2 = 0; sprite2 < free_spr2; sprite2++) R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[sprite2], wadnum, lump, lastlump); + } R_FlushTranslationColormapCache(); diff --git a/src/r_things.h b/src/r_things.h index 572884d21..5684f8a89 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -118,7 +118,7 @@ typedef struct // specific sounds per skin sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table - spritedef_t sprites[NUMPLAYERSPRITES]; + spritedef_t sprites[NUMPLAYERSPRITES*2]; // contains super versions too UINT8 availability; // lock? } skin_t;