From 58b56b2867261cfa624198ccd2c43b29d0f1a64a Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 31 Jul 2019 00:27:51 -0400 Subject: [PATCH 1/6] New ring sparkles --- src/dehacked.c | 13 +------------ src/info.c | 20 ++++---------------- src/info.h | 13 +------------ src/p_enemy.c | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 40 deletions(-) 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 From d6dacaaab292e1cdbe18bd0f93ef35791ce376c1 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 31 Jul 2019 00:49:14 -0400 Subject: [PATCH 2/6] ALL CAPS Woops forgot to do this --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8c43b1733..a48a2598f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2418,7 +2418,7 @@ static actionpointer_t actionpointers[] = {{A_SnapperThinker}, "A_SNAPPERTHINKER"}, {{A_SaloonDoorSpawn}, "A_SALOONDOORSPAWN"}, {{A_MinecartSparkThink}, "A_MINECARTSPARKTHINK"}, - {{A_ModuloToState}, "A_ModuloToState"}, + {{A_ModuloToState}, "A_MODULOTOSTATE"}, {{NULL}, "NONE"}, // This NULL entry must be the last in the list From 3177b27a119e41c7fd6befe706d6dd3a64ba4b32 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 31 Jul 2019 20:51:55 -0400 Subject: [PATCH 3/6] Changes Kill off the hack --- src/dehacked.c | 6 +--- src/info.c | 83 ++++++++++++++++++++++++-------------------------- src/info.h | 6 +--- src/p_enemy.c | 24 --------------- src/p_saveg.c | 2 +- 5 files changed, 43 insertions(+), 78 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index a48a2598f..1114d0a6b 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2418,7 +2418,6 @@ 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 @@ -7131,10 +7130,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_CRUMBLE2", // Spark - "S_SPRK1", - "S_SPRK2", - "S_SPRK3", - "S_SPRK4", + "S_SPRK", // Robot Explosion "S_XPLD_FLICKY", diff --git a/src/info.c b/src/info.c index c49585977..db58d6e45 100644 --- a/src/info.c +++ b/src/info.c @@ -3827,10 +3827,7 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 105, {A_Scream}, 0, 0, S_NULL}, // S_CRUMBLE2 // Spark - {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 + {SPR_SPRK, FF_TRANS20|FF_ANIMATE|0, 18, {NULL}, 8, 2, S_NULL}, // S_SPRK // Robot Explosion {SPR_BOM1, 0, 0, {A_FlickySpawn}, 0, 0, S_XPLD1}, // S_XPLD_FLICKY @@ -5600,7 +5597,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 10*FRACUNIT, // speed @@ -6437,7 +6434,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6464,7 +6461,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6572,7 +6569,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6599,7 +6596,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6626,7 +6623,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed @@ -6707,7 +6704,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncitem, // deathsound 1, // speed @@ -6734,7 +6731,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD1, // speed @@ -6760,7 +6757,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD2, // speed @@ -6786,7 +6783,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD3, // speed @@ -6812,7 +6809,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD4, // speed @@ -6838,7 +6835,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD5, // speed @@ -6864,7 +6861,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD6, // speed @@ -6890,7 +6887,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD7, // speed @@ -6917,7 +6914,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound 8, // speed @@ -6971,7 +6968,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound 60*FRACUNIT, // speed @@ -17162,8 +17159,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate - S_SPRK1, // xdeathstate + S_SPRK, // deathstate + S_SPRK, // xdeathstate sfx_None, // deathsound 60*FRACUNIT, // speed 16*FRACUNIT, // radius @@ -17189,7 +17186,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17217,7 +17214,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17244,7 +17241,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17271,7 +17268,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17298,7 +17295,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17325,7 +17322,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17352,7 +17349,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17379,7 +17376,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17569,7 +17566,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17596,7 +17593,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17623,7 +17620,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17650,7 +17647,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -18540,7 +18537,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_s3k33, // painsound S_RING, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncchip, // deathsound 1, // speed @@ -18567,7 +18564,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncchip, // deathsound 38*FRACUNIT, // speed @@ -18594,7 +18591,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_s3k33, // painsound S_RING, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncitem, // deathsound 1, // speed @@ -18621,7 +18618,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 20*TICRATE, // speed @@ -18648,7 +18645,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 96*20, // speed @@ -18675,7 +18672,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 20*TICRATE, // speed @@ -18702,7 +18699,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 30*TICRATE, // speed @@ -18729,7 +18726,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK1, // deathstate + S_SPRK, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 15*TICRATE, // speed @@ -19612,7 +19609,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPARK -1, // doomednum - S_SPRK1, // spawnstate + S_SPRK, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound diff --git a/src/info.h b/src/info.h index 1c03a0d3c..feba1e6d9 100644 --- a/src/info.h +++ b/src/info.h @@ -265,7 +265,6 @@ 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 @@ -3890,10 +3889,7 @@ typedef enum state S_CRUMBLE2, // Spark - S_SPRK1, - S_SPRK2, - S_SPRK3, - S_SPRK4, + S_SPRK, // Robot Explosion S_XPLD_FLICKY, diff --git a/src/p_enemy.c b/src/p_enemy.c index dcd58e53d..d422ba89a 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -37,8 +37,6 @@ boolean LUA_CallAction(const char *action, mobj_t *actor); player_t *stplyr; INT32 var1; INT32 var2; -INT32 Modulothing; - // // P_NewChaseDir related LUT. // @@ -295,7 +293,6 @@ 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 @@ -13650,25 +13647,4 @@ 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 diff --git a/src/p_saveg.c b/src/p_saveg.c index 09df38eb0..9bd14ce39 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -4096,7 +4096,7 @@ static inline boolean P_NetUnArchiveMisc(void) countdowntimer = (tic_t)READUINT32(save_p); countdowntimeup = (boolean)READUINT8(save_p); - hidetime = READUINT32(save_p); + hidetime = READUINT32(save_p);; // Is it paused? if (READUINT8(save_p) == 0x2f) From e2cd85d4da57129108176debde843ef32fb05177 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 31 Jul 2019 20:57:08 -0400 Subject: [PATCH 4/6] I dunno how that got here --- src/p_saveg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 9bd14ce39..09df38eb0 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -4096,7 +4096,7 @@ static inline boolean P_NetUnArchiveMisc(void) countdowntimer = (tic_t)READUINT32(save_p); countdowntimeup = (boolean)READUINT8(save_p); - hidetime = READUINT32(save_p);; + hidetime = READUINT32(save_p); // Is it paused? if (READUINT8(save_p) == 0x2f) From 00c3329ba9242272a872ac1e02b0bf5a5e6996c2 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 3 Aug 2019 18:28:53 -0400 Subject: [PATCH 5/6] Ring sparkle mirroring --- src/dehacked.c | 5 ++- src/info.c | 82 ++++++++++++++++++++++++++------------------------ src/info.h | 5 ++- src/p_enemy.c | 24 +++++++++++++++ src/p_mobj.h | 2 ++ src/p_saveg.c | 2 ++ src/p_setup.c | 1 + 7 files changed, 79 insertions(+), 42 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 856788f48..a82672306 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2421,6 +2421,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 @@ -7133,7 +7134,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_CRUMBLE2", // Spark - "S_SPRK", + "S_SPRK1", + "S_SPRK2", + "S_SPRK3", // Robot Explosion "S_XPLD_FLICKY", diff --git a/src/info.c b/src/info.c index 7a225ee8c..9aed563c7 100644 --- a/src/info.c +++ b/src/info.c @@ -3833,7 +3833,9 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 105, {A_Scream}, 0, 0, S_NULL}, // S_CRUMBLE2 // Spark - {SPR_SPRK, FF_TRANS20|FF_ANIMATE|0, 18, {NULL}, 8, 2, S_NULL}, // S_SPRK + {SPR_NULL, 0, 1, {A_ModuloToState}, 2, S_SPRK2, S_SPRK3}, // S_SPRK1 + {SPR_SPRK, FF_TRANS20|FF_ANIMATE|0, 18, {NULL}, 8, 2, S_NULL}, // S_SPRK2 + {SPR_SPRK, FF_TRANS20|FF_ANIMATE|9, 18, {NULL}, 8, 2, S_NULL}, // S_SPRK3 // Robot Explosion {SPR_BOM1, 0, 0, {A_FlickySpawn}, 0, 0, S_XPLD1}, // S_XPLD_FLICKY @@ -5603,7 +5605,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 10*FRACUNIT, // speed @@ -6440,7 +6442,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6467,7 +6469,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6575,7 +6577,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6602,7 +6604,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 38*FRACUNIT, // speed @@ -6629,7 +6631,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed @@ -6710,7 +6712,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncitem, // deathsound 1, // speed @@ -6737,7 +6739,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD1, // speed @@ -6763,7 +6765,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD2, // speed @@ -6789,7 +6791,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD3, // speed @@ -6815,7 +6817,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD4, // speed @@ -6841,7 +6843,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD5, // speed @@ -6867,7 +6869,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD6, // speed @@ -6893,7 +6895,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound EMERALD7, // speed @@ -6920,7 +6922,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound 8, // speed @@ -6974,7 +6976,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_cgot, // deathsound 60*FRACUNIT, // speed @@ -17165,8 +17167,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate - S_SPRK, // xdeathstate + S_SPRK1, // deathstate + S_SPRK1, // xdeathstate sfx_None, // deathsound 60*FRACUNIT, // speed 16*FRACUNIT, // radius @@ -17192,7 +17194,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17220,7 +17222,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17247,7 +17249,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17274,7 +17276,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17301,7 +17303,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17328,7 +17330,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17355,7 +17357,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17382,7 +17384,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17572,7 +17574,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17599,7 +17601,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17626,7 +17628,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -17653,7 +17655,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_itemup, // deathsound 60*FRACUNIT, // speed @@ -18543,7 +18545,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_s3k33, // painsound S_RING, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncchip, // deathsound 1, // speed @@ -18570,7 +18572,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncchip, // deathsound 38*FRACUNIT, // speed @@ -18597,7 +18599,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_s3k33, // painsound S_RING, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncitem, // deathsound 1, // speed @@ -18624,7 +18626,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 20*TICRATE, // speed @@ -18651,7 +18653,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 96*20, // speed @@ -18678,7 +18680,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 20*TICRATE, // speed @@ -18705,7 +18707,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 30*TICRATE, // speed @@ -18732,7 +18734,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SPRK, // deathstate + S_SPRK1, // deathstate S_NULL, // xdeathstate sfx_ncspec, // deathsound 15*TICRATE, // speed @@ -19615,7 +19617,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPARK -1, // doomednum - S_SPRK, // spawnstate + S_SPRK1, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound diff --git a/src/info.h b/src/info.h index 1c60ea24c..bb27ac3e3 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 @@ -3890,7 +3891,9 @@ typedef enum state S_CRUMBLE2, // Spark - S_SPRK, + S_SPRK1, + S_SPRK2, + S_SPRK3, // Robot Explosion S_XPLD_FLICKY, diff --git a/src/p_enemy.c b/src/p_enemy.c index d7bc7a583..4f046fe06 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -37,6 +37,8 @@ boolean LUA_CallAction(const char *action, mobj_t *actor); player_t *stplyr; INT32 var1; INT32 var2; +INT32 modulothing; + // // P_NewChaseDir related LUT. // @@ -293,6 +295,7 @@ 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 @@ -13677,4 +13680,25 @@ void A_MinecartSparkThink(mobj_t *actor) P_SetScale(trail, trail->scale/4); trail->destscale = trail->scale; } +} + +// Function: A_ModuloToState +// +// 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++; } \ No newline at end of file diff --git a/src/p_mobj.h b/src/p_mobj.h index 77791f928..a9d5244b0 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -464,6 +464,8 @@ void P_SetScale(mobj_t *mobj, fixed_t newscale); void P_XYMovement(mobj_t *mo); void P_EmeraldManager(void); +extern INT32 modulothing; + #define MAXHUNTEMERALDS 64 extern mapthing_t *huntemeralds[MAXHUNTEMERALDS]; extern INT32 numhuntemeralds; diff --git a/src/p_saveg.c b/src/p_saveg.c index 24b68b971..996143c01 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3999,6 +3999,7 @@ static void P_NetArchiveMisc(void) WRITEINT32(save_p, sstimer); WRITEUINT32(save_p, bluescore); WRITEUINT32(save_p, redscore); + WRITEINT32(save_p, modulothing); WRITEINT16(save_p, autobalance); WRITEINT16(save_p, teamscramble); @@ -4077,6 +4078,7 @@ static inline boolean P_NetUnArchiveMisc(void) sstimer = READINT32(save_p); bluescore = READUINT32(save_p); redscore = READUINT32(save_p); + modulothing = READUINT32(save_p); autobalance = READINT16(save_p); teamscramble = READINT16(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index c2872a836..f3468383c 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2610,6 +2610,7 @@ boolean P_SetupLevel(boolean skipprecip) boolean loadedbm = false; sector_t *ss; boolean chase; + modulothing = 0; levelloading = true; From 153ed828497b5bc1e87b7e422e4fa0a856943dc1 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 4 Aug 2019 11:34:55 -0400 Subject: [PATCH 6/6] Last min changes --- src/p_saveg.c | 2 +- src/p_setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 996143c01..0bfb81f4e 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -4078,7 +4078,7 @@ static inline boolean P_NetUnArchiveMisc(void) sstimer = READINT32(save_p); bluescore = READUINT32(save_p); redscore = READUINT32(save_p); - modulothing = READUINT32(save_p); + modulothing = READINT32(save_p); autobalance = READINT16(save_p); teamscramble = READINT16(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index f3468383c..03e3e51ff 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2168,6 +2168,7 @@ static void P_LevelInitStuff(void) localaiming = 0; localaiming2 = 0; + modulothing = 0; // special stage tokens, emeralds, and ring total tokenbits = 0; @@ -2610,7 +2611,6 @@ boolean P_SetupLevel(boolean skipprecip) boolean loadedbm = false; sector_t *ss; boolean chase; - modulothing = 0; levelloading = true;