diff --git a/src/deh_tables.c b/src/deh_tables.c index 74ad120ba..9526dd580 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -279,6 +279,7 @@ actionpointer_t actionpointers[] = {{A_MineRange}, "A_MINERANGE"}, {{A_ConnectToGround}, "A_CONNECTTOGROUND"}, {{A_SpawnParticleRelative}, "A_SPAWNPARTICLERELATIVE"}, + {{A_ParticleSpawn}, "A_PARTICLESPAWN"}, {{A_MultiShotDist}, "A_MULTISHOTDIST"}, {{A_WhoCaresIfYourSonIsABee},"A_WHOCARESIFYOURSONISABEE"}, {{A_ParentTriesToSleep}, "A_PARENTTRIESTOSLEEP"}, @@ -2709,6 +2710,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_SEED", "S_PARTICLE", + "S_PARTICLEGEN", // Score Logos "S_SCRA", // 100 diff --git a/src/info.c b/src/info.c index 9f4e8c66f..67842efe8 100644 --- a/src/info.c +++ b/src/info.c @@ -3230,6 +3230,7 @@ state_t states[NUMSTATES] = // Particle sprite {SPR_PRTL, 0, 2*TICRATE, {NULL}, 0, 0, S_NULL}, // S_PARTICLE + {SPR_NULL, 0, 1, {A_ParticleSpawn}, 0, 0, S_PARTICLEGEN}, // S_PARTICLEGEN {SPR_SCOR, 0, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRA - 100 {SPR_SCOR, 1, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRB - 200 @@ -18539,7 +18540,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_PARTICLEGEN 757, // doomednum - S_INVISIBLE, // spawnstate + S_PARTICLEGEN, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -18560,7 +18561,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, diff --git a/src/info.h b/src/info.h index 0c2d9be69..cd96242ca 100644 --- a/src/info.h +++ b/src/info.h @@ -233,6 +233,7 @@ enum actionnum A_MINERANGE, A_CONNECTTOGROUND, A_SPAWNPARTICLERELATIVE, + A_PARTICLESPAWN, A_MULTISHOTDIST, A_WHOCARESIFYOURSONISABEE, A_PARENTTRIESTOSLEEP, @@ -503,6 +504,7 @@ void A_MineExplode(); void A_MineRange(); void A_ConnectToGround(); void A_SpawnParticleRelative(); +void A_ParticleSpawn(); void A_MultiShotDist(); void A_WhoCaresIfYourSonIsABee(); void A_ParentTriesToSleep(); @@ -3685,6 +3687,7 @@ typedef enum state S_SEED, S_PARTICLE, + S_PARTICLEGEN, // Score Logos S_SCRA, // 100 diff --git a/src/p_enemy.c b/src/p_enemy.c index 849071431..7a054dbed 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -265,6 +265,7 @@ void A_MineExplode(mobj_t *actor); void A_MineRange(mobj_t *actor); void A_ConnectToGround(mobj_t *actor); void A_SpawnParticleRelative(mobj_t *actor); +void A_ParticleSpawn(mobj_t *actor); void A_MultiShotDist(mobj_t *actor); void A_WhoCaresIfYourSonIsABee(mobj_t *actor); void A_ParentTriesToSleep(mobj_t *actor); @@ -11150,7 +11151,6 @@ void A_SpawnParticleRelative(mobj_t *actor) if (LUA_CallAction(A_SPAWNPARTICLERELATIVE, actor)) return; - CONS_Debug(DBG_GAMELOGIC, "A_SpawnParticleRelative called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2); x = (INT16)(locvar1>>16); @@ -11173,6 +11173,40 @@ void A_SpawnParticleRelative(mobj_t *actor) P_SetMobjState(mo, state); } +void A_ParticleSpawn(mobj_t *actor) +{ + INT32 locvar1 = var1; + fixed_t speed; + mobjtype_t type; + mobj_t *spawn; + + if (udmf) // dont make this crap work in durr maps kek + return; + + if (LUA_CallAction(A_PARTICLESPAWN, actor)) + return; + + if (!actor->spawnpoint) + { + P_RemoveMobj(actor); + return; + } + + if (locvar1) + type = (mobjtype_t)locvar1; + else + type = MT_PARTICLE; + + speed = FixedMul((actor->spawnpoint->angle >> 12)<scale); + + spawn = P_SpawnMobj(actor->x, actor->y, actor->z, type); + P_SetScale(spawn, actor->scale); + spawn->momz = speed; + spawn->destscale = FixedDiv(spawn->scale<scalespeed = FixedDiv(((actor->spawnpoint->angle >> 8) & 63) * actor->scale, 100<tics = actor->spawnpoint->extrainfo + 1; +} + // Function: A_MultiShotDist // // Description: Spawns multiple shots based on player proximity diff --git a/src/p_mobj.c b/src/p_mobj.c index 64faed58e..79d0fee18 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5378,6 +5378,9 @@ static void P_VerticalFlameJetSceneryThink(mobj_t *mobj) static boolean P_ParticleGenSceneryThink(mobj_t *mobj) { + if (!udmf) + return false; + if (!mobj->lastlook) return false; @@ -11789,6 +11792,9 @@ static boolean P_SetupParticleGen(mapthing_t *mthing, mobj_t *mobj) INT32 line; const size_t mthingi = (size_t)(mthing - mapthings); + if (!udmf) + return false; + // Find the corresponding linedef special, using args[6] as tag line = mthing->args[6] ? Tag_FindLineSpecial(15, mthing->args[6]) : -1;