WIP: Hardcode MT_BOOSTPAD

This commit is contained in:
Lach 2023-07-20 19:02:13 +10:00
parent a21e509a94
commit 476d53d305
5 changed files with 89 additions and 1 deletions

View file

@ -301,6 +301,7 @@ actionpointer_t actionpointers[] =
{{A_InvincSparkleRotate}, "A_INVINCSPARKLEROTATE"},
{{A_SpawnItemDebrisCloud}, "A_SPAWNITEMDEBRISCLOUD"},
{{A_RingShooterFace}, "A_RINGSHOOTERFACE"},
{{A_TextureAnimate}, "A_TEXTUREANIMATE"},
{{NULL}, "NONE"},
@ -4250,6 +4251,11 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_DASHRING_VERTICAL_FLASH1",
"S_DASHRING_VERTICAL_FLASH2",
// Boost pads
"S_BOOSTPAD",
"S_BOOSTPAD_SMALL",
"S_BOOSTPAD_TINY",
// Various plants
"S_SONICBUSH",
@ -5621,6 +5627,9 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_DASHRING",
"MT_RAINBOWDASHRING",
// Boost pads
"MT_BOOSTPAD",
// Various plants
"MT_SONICBUSH",

View file

@ -720,6 +720,11 @@ char sprnames[NUMSPRITES + 1][5] =
// Dash Rings
"RAIR",
// Boost pads
"BSTP",
"BSTS",
"BSTT",
// Various plants
"SBUS",
@ -4935,6 +4940,11 @@ state_t states[NUMSTATES] =
{SPR_NULL, 0, TICRATE/3 - 2, {NULL}, 0, 0, S_DASHRING_VERTICAL_FLASH2}, // S_DASHRING_VERTICAL_FLASH1
{SPR_RAIR, FF_ADD|3, 2, {NULL}, 0, 0, S_DASHRING_VERTICAL_FLASH1}, // S_DASHRING_VERTICAL_FLASH2
// Boost pads
{SPR_BSTP, FF_FLOORSPRITE, 1, {A_TextureAnimate}, 5, 2, S_BOOSTPAD}, // S_BOOSTPAD
{SPR_BSTS, FF_FLOORSPRITE, 1, {A_TextureAnimate}, 5, 2, S_BOOSTPAD_SMALL}, // S_BOOSTPAD_SMALL
{SPR_BSTT, FF_FLOORSPRITE, 1, {A_TextureAnimate}, 5, 2, S_BOOSTPAD_TINY}, // S_BOOSTPAD_TINY
// Various plants
{SPR_SBUS, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SONICBUSH
@ -26797,6 +26807,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BOOSTPAD
510, // doomednum
S_BOOSTPAD, // spawnstate
1, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
0, // 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
0, // speed
91*FRACUNIT, // radius
16*FRACUNIT, // height
0, // dispoffset
0, // mass
0, // damage
sfx_None, // activesound
MF_ENEMY|MF_SPECIAL, // flags
S_NULL // raisestate
},
{ // MT_SONICBUSH,
715, // doomednum
S_SONICBUSH, // spawnstate

View file

@ -294,6 +294,7 @@ enum actionnum
A_INVINCSPARKLEROTATE,
A_SPAWNITEMDEBRISCLOUD,
A_RINGSHOOTERFACE,
A_TEXTUREANIMATE,
NUMACTIONS
};
@ -568,6 +569,7 @@ void A_FlameShieldPaper();
void A_InvincSparkleRotate();
void A_SpawnItemDebrisCloud();
void A_RingShooterFace();
void A_TextureAnimate();
extern boolean actionsoverridden[NUMACTIONS];
@ -1271,6 +1273,11 @@ typedef enum sprite
// Dash Rings
SPR_RAIR,
// Boost pads
SPR_BSTP,
SPR_BSTS,
SPR_BSTT,
// Various plants
SPR_SBUS,
@ -5383,6 +5390,11 @@ typedef enum state
S_DASHRING_VERTICAL_FLASH1,
S_DASHRING_VERTICAL_FLASH2,
// Boost pads
S_BOOSTPAD,
S_BOOSTPAD_SMALL,
S_BOOSTPAD_TINY,
// Various plants
S_SONICBUSH,
@ -6789,6 +6801,9 @@ typedef enum mobj_type
MT_DASHRING,
MT_RAINBOWDASHRING,
// Boost pads
MT_BOOSTPAD,
// Various plants
MT_SONICBUSH,

View file

@ -330,6 +330,7 @@ void A_FlameShieldPaper(mobj_t *actor);
void A_InvincSparkleRotate(mobj_t *actor);
void A_SpawnItemDebrisCloud(mobj_t *actor);
void A_RingShooterFace(mobj_t *actor);
void A_TextureAnimate(mobj_t *actor);
//for p_enemy.c
@ -13721,7 +13722,8 @@ A_SpawnItemDebrisCloud (mobj_t *actor)
}
}
// sets the actor's
// Assumes the actor is the screen of a Ring Shooter
// Changes the screen to display the WANTED icon of the Ring Shooter's owner, stretching it to match the screen's dimensions
// vars do nothing
void A_RingShooterFace(mobj_t *actor)
{
@ -13732,3 +13734,25 @@ void A_RingShooterFace(mobj_t *actor)
Obj_UpdateRingShooterFace(actor);
}
// Syncs the actor's frame with the animated texture ticker in P_UpdateSpecials
// Call continuously to simulate an animated texture
// var1 and var2 act like FF_ANIMATE, i.e.:
// var1 = number of additional frames to cycle through
// var2 = number of tics to display each frame
void A_TextureAnimate(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 locvar2 = var2;
state_t *state = actor->state;
if (LUA_CallAction(A_TEXTUREANIMATE, actor))
{
return;
}
if (actor->frame & FF_ANIMATE) // this doesn't work if you're animating on your own as well
return;
actor->frame = (actor->frame & ~FF_FRAMEMASK) | ((state->frame & FF_FRAMEMASK) + ((leveltime / state->var2) % (state->var1 + 1)))
}

View file

@ -10438,6 +10438,9 @@ static void P_DefaultMobjShadowScale(mobj_t *thing)
case MT_DRIFTCLIP:
thing->shadowscale = FRACUNIT/3;
break;
case MT_BOOSTPAD:
thing->shadowscale = 0;
break;
default:
if (thing->flags & (MF_ENEMY|MF_BOSS))
thing->shadowscale = FRACUNIT;