Further cleanup of gas jet actions.

This commit is contained in:
sphere 2020-04-14 13:49:26 +02:00
parent 3475c4011f
commit 71063aab85
4 changed files with 23 additions and 49 deletions

View file

@ -2805,8 +2805,7 @@ static actionpointer_t actionpointers[] =
{{A_DropMine}, "A_DROPMINE"},
{{A_FishJump}, "A_FISHJUMP"},
{{A_ThrownRing}, "A_THROWNRING"},
{{A_SetSolidSteam}, "A_SETSOLIDSTEAM"},
{{A_UnsetSolidSteam}, "A_UNSETSOLIDSTEAM"},
{{A_PlaySteamSound}, "A_PLAYSTEAMSOUND"},
{{A_SignSpin}, "S_SIGNSPIN"},
{{A_SignPlayer}, "A_SIGNPLAYER"},
{{A_OverlayThink}, "A_OVERLAYTHINK"},
@ -7238,6 +7237,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_STEAM6",
"S_STEAM7",
"S_STEAM8",
"S_STEAMACTIVE",
"S_STEAMSOUND",
// Bumpers
"S_BUMPER",

View file

@ -3107,14 +3107,16 @@ state_t states[NUMSTATES] =
{SPR_FANS, 4, 1, {A_FanBubbleSpawn}, 512, 0, S_FAN}, // S_FAN5
// Steam jet
{SPR_STEM, 0, 2, {A_SetSolidSteam}, 0, 0, S_STEAM2}, // S_STEAM1
{SPR_STEM, 1, 2, {NULL}, 0, 0, S_STEAM3}, // S_STEAM2
{SPR_STEM, 2, 2, {NULL}, 0, 0, S_STEAM4}, // S_STEAM3
{SPR_STEM, 3, 2, {A_UnsetSolidSteam}, 0, 0, S_STEAM5}, // S_STEAM4
{SPR_STEM, 4, 2, {NULL}, 0, 0, S_STEAM6}, // S_STEAM5
{SPR_STEM, 5, 2, {NULL}, 0, 0, S_STEAM7}, // S_STEAM6
{SPR_STEM, 6, 2, {NULL}, 0, 0, S_STEAM8}, // S_STEAM7
{SPR_NULL, 0, 18, {NULL}, 0, 0, S_STEAM1}, // S_STEAM8
{SPR_STEM, 0, 2, {A_DualAction}, S_STEAMACTIVE, S_STEAMSOUND, S_STEAM2}, // S_STEAM1
{SPR_STEM, 1, 2, {NULL}, 0, 0, S_STEAM3}, // S_STEAM2
{SPR_STEM, 2, 2, {NULL}, 0, 0, S_STEAM4}, // S_STEAM3
{SPR_STEM, 3, 2, {A_SetObjectFlags}, MF_SPRING, 1, S_STEAM5}, // S_STEAM4
{SPR_STEM, 4, 2, {NULL}, 0, 0, S_STEAM6}, // S_STEAM5
{SPR_STEM, 5, 2, {NULL}, 0, 0, S_STEAM7}, // S_STEAM6
{SPR_STEM, 6, 2, {NULL}, 0, 0, S_STEAM8}, // S_STEAM7
{SPR_NULL, 0, 18, {NULL}, 0, 0, S_STEAM1}, // S_STEAM8
{SPR_NULL, 0, 0, {A_SetObjectFlags}, MF_SPRING, 2, S_NULL}, // S_STEAMACTIVE
{SPR_NULL, 0, 0, {A_PlaySteamSound}, 0, 0, S_NULL}, // S_STEAMSOUND
// Bumpers
{SPR_BUMP, FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 3, 4, S_NULL}, // S_BUMPER

View file

@ -61,8 +61,7 @@ void A_AttractChase(); // Ring Chase
void A_DropMine(); // Drop Mine from Skim or Jetty-Syn Bomber
void A_FishJump(); // Fish Jump
void A_ThrownRing(); // Sparkle trail for red ring
void A_SetSolidSteam();
void A_UnsetSolidSteam();
void A_PlaySteamSound();
void A_SignSpin();
void A_SignPlayer();
void A_OverlayThink();
@ -3256,6 +3255,8 @@ typedef enum state
S_STEAM6,
S_STEAM7,
S_STEAM8,
S_STEAMACTIVE,
S_STEAMSOUND,
// Bumpers
S_BUMPER,

View file

@ -125,8 +125,7 @@ void A_AttractChase(mobj_t *actor);
void A_DropMine(mobj_t *actor);
void A_FishJump(mobj_t *actor);
void A_ThrownRing(mobj_t *actor);
void A_SetSolidSteam(mobj_t *actor);
void A_UnsetSolidSteam(mobj_t *actor);
void A_PlaySteamSound(mobj_t *actor);
void A_SignSpin(mobj_t *actor);
void A_SignPlayer(mobj_t *actor);
void A_OverlayThink(mobj_t *actor);
@ -4919,50 +4918,21 @@ void A_ThrownRing(mobj_t *actor)
return;
}
// Function: A_SetSolidSteam
// Function: A_PlaySteamSound
//
// Description: Applies the spring flag to steam jets, and randomly plays one of two sounds.
// Description: Plays either the deathsound (7/8) or the painsound (1/8) of an object. Used by steam jets.
// Can also be muted if the object has the Ambush flag checked.
//
// var1 = unused
// var2 = unused
//
void A_SetSolidSteam(mobj_t *actor)
void A_PlaySteamSound(mobj_t *actor)
{
if (LUA_CallAction("A_SetSolidSteam", actor))
if (LUA_CallAction("A_PlaySteamSound", actor))
return;
actor->flags |= MF_SPRING;
if (!(actor->flags2 & MF2_AMBUSH))
{
if (P_RandomChance(FRACUNIT/8))
{
if (actor->info->deathsound)
S_StartSound(actor, actor->info->deathsound); // Hiss!
}
else
{
if (actor->info->painsound)
S_StartSound(actor, actor->info->painsound);
}
}
P_SetObjectMomZ (actor, 1, true);
}
// Function: A_UnsetSolidSteam
//
// Description: Removes the spring flag from an object. Used by steam jets.
//
// var1 = unused
// var2 = unused
//
void A_UnsetSolidSteam(mobj_t *actor)
{
if (LUA_CallAction("A_UnsetSolidSteam", actor))
return;
actor->flags &= ~MF_SPRING;
P_RandomChance(FRACUNIT/8) ? A_Scream(actor) : A_Pain(actor);
}
// Function: A_SignSpin