diff --git a/src/dehacked.c b/src/dehacked.c index 01e2b0bde..8c43b1733 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2418,6 +2418,7 @@ static actionpointer_t actionpointers[] = {{A_SnapperThinker}, "A_SNAPPERTHINKER"}, {{A_SaloonDoorSpawn}, "A_SALOONDOORSPAWN"}, {{A_MinecartSparkThink}, "A_MINECARTSPARKTHINK"}, + {{A_ModuloToState}, "A_ModuloToState"}, {{NULL}, "NONE"}, // This NULL entry must be the last in the list @@ -7134,18 +7135,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPRK2", "S_SPRK3", "S_SPRK4", - "S_SPRK5", - "S_SPRK6", - "S_SPRK7", - "S_SPRK8", - "S_SPRK9", - "S_SPRK10", - "S_SPRK11", - "S_SPRK12", - "S_SPRK13", - "S_SPRK14", - "S_SPRK15", - "S_SPRK16", // Robot Explosion "S_XPLD_FLICKY", diff --git a/src/info.c b/src/info.c index a4446d657..c49585977 100644 --- a/src/info.c +++ b/src/info.c @@ -3827,22 +3827,10 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 105, {A_Scream}, 0, 0, S_NULL}, // S_CRUMBLE2 // Spark - {SPR_SPRK, FF_TRANS40 , 1, {NULL}, 0, 0, S_SPRK2}, // S_SPRK1 - {SPR_SPRK, FF_TRANS50|1, 1, {NULL}, 0, 0, S_SPRK3}, // S_SPRK2 - {SPR_SPRK, FF_TRANS50|2, 1, {NULL}, 0, 0, S_SPRK4}, // S_SPRK3 - {SPR_SPRK, FF_TRANS50|3, 1, {NULL}, 0, 0, S_SPRK5}, // S_SPRK4 - {SPR_SPRK, FF_TRANS60 , 1, {NULL}, 0, 0, S_SPRK6}, // S_SPRK5 - {SPR_SPRK, FF_TRANS60|1, 1, {NULL}, 0, 0, S_SPRK7}, // S_SPRK6 - {SPR_SPRK, FF_TRANS60|2, 1, {NULL}, 0, 0, S_SPRK8}, // S_SPRK7 - {SPR_SPRK, FF_TRANS70|3, 1, {NULL}, 0, 0, S_SPRK9}, // S_SPRK8 - {SPR_SPRK, FF_TRANS70 , 1, {NULL}, 0, 0, S_SPRK10}, // S_SPRK9 - {SPR_SPRK, FF_TRANS70|1, 1, {NULL}, 0, 0, S_SPRK11}, // S_SPRK10 - {SPR_SPRK, FF_TRANS80|2, 1, {NULL}, 0, 0, S_SPRK12}, // S_SPRK11 - {SPR_SPRK, FF_TRANS80|3, 1, {NULL}, 0, 0, S_SPRK13}, // S_SPRK12 - {SPR_SPRK, FF_TRANS80 , 1, {NULL}, 0, 0, S_SPRK14}, // S_SPRK13 - {SPR_SPRK, FF_TRANS90|1, 1, {NULL}, 0, 0, S_SPRK15}, // S_SPRK14 - {SPR_SPRK, FF_TRANS90|2, 1, {NULL}, 0, 0, S_SPRK16}, // S_SPRK15 - {SPR_SPRK, FF_TRANS90|3, 1, {NULL}, 0, 0, S_NULL}, // S_SPRK16 + {SPR_SPRK, FF_TRANS80|18, 1, {NULL}, 0, 0, S_SPRK4}, // S_SPRK1 + {SPR_SPRK, FF_TRANS20|FF_ANIMATE|0, 18, {NULL}, 8, 2, S_NULL}, // S_SPRK2 + {SPR_SPRK, FF_TRANS20|FF_ANIMATE|9, 1, {NULL}, 8, 2, S_NULL}, // S_SPRK3 + {SPR_SPRK, FF_TRANS50|1, 0, {A_ModuloToState}, 2, S_SPRK2, S_SPRK3}, // S_SPRK4 // Robot Explosion {SPR_BOM1, 0, 0, {A_FlickySpawn}, 0, 0, S_XPLD1}, // S_XPLD_FLICKY diff --git a/src/info.h b/src/info.h index a9a0321ec..1c03a0d3c 100644 --- a/src/info.h +++ b/src/info.h @@ -265,6 +265,7 @@ void A_SnapperSpawn(); void A_SnapperThinker(); void A_SaloonDoorSpawn(); void A_MinecartSparkThink(); +void A_ModuloToState(); // ratio of states to sprites to mobj types is roughly 6 : 1 : 1 #define NUMMOBJFREESLOTS 512 @@ -3893,18 +3894,6 @@ typedef enum state S_SPRK2, S_SPRK3, S_SPRK4, - S_SPRK5, - S_SPRK6, - S_SPRK7, - S_SPRK8, - S_SPRK9, - S_SPRK10, - S_SPRK11, - S_SPRK12, - S_SPRK13, - S_SPRK14, - S_SPRK15, - S_SPRK16, // Robot Explosion S_XPLD_FLICKY, diff --git a/src/p_enemy.c b/src/p_enemy.c index 88405437c..dcd58e53d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -37,6 +37,7 @@ boolean LUA_CallAction(const char *action, mobj_t *actor); player_t *stplyr; INT32 var1; INT32 var2; +INT32 Modulothing; // // P_NewChaseDir related LUT. @@ -294,6 +295,8 @@ void A_SnapperSpawn(mobj_t *actor); void A_SnapperThinker(mobj_t *actor); void A_SaloonDoorSpawn(mobj_t *actor); void A_MinecartSparkThink(mobj_t *actor); +void A_ModuloToState(mobj_t *actor); + //for p_enemy.c // @@ -13647,4 +13650,25 @@ void A_MinecartSparkThink(mobj_t *actor) P_SetScale(trail, trail->scale/4); trail->destscale = trail->scale; } +} + +// Function: A_MinecartSparkThink +// +// Description: Modulo operation to state +// +// var1 = Modulo +// var2 = State +// +void A_ModuloToState(mobj_t *actor) +{ + INT32 locvar1 = var1; + INT32 locvar2 = var2; +#ifdef HAVE_BLUA + if (LUA_CallAction("A_ModuloToState", actor)) + return; +#endif + + if ((Modulothing % locvar1 == 0)) + P_SetMobjState(actor, (locvar2)); + Modulothing = Modulothing + 1; } \ No newline at end of file