Add a new feature to MT_PARTICLEGEN, per Sphere's request - if you give the parameters line a backside, then the backside x offset controls the number of tics between particle spawn. (By default, it's 3.)

This commit is contained in:
toasterbabe 2017-08-07 20:33:24 +01:00
parent 1d11a14f64
commit a61be91523
3 changed files with 12 additions and 6 deletions

View File

@ -2581,7 +2581,7 @@ state_t states[NUMSTATES] =
// Particle sprite
{SPR_PRTL, FF_FULLBRIGHT|FF_TRANS70, 2*TICRATE, {NULL}, 0, 0, S_NULL}, // S_PARTICLE
{SPR_NULL, 0, 1, {A_ParticleSpawn}, 0, 0, S_PARTICLEGEN}, // S_PARTICLEGEN
{SPR_NULL, 0, 3, {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

View File

@ -3582,12 +3582,12 @@ void A_ParticleSpawn(mobj_t *actor)
spawn->tics = (tic_t)actor->health;
spawn->flags2 |= (actor->flags2 & MF2_OBJECTFLIP);
spawn->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones
if (spawn->frame & FF_ANIMATE)
spawn->frame += P_RandomKey(spawn->state->var1);
actor->angle += actor->movedir;
}
actor->angle += (angle_t)actor->movecount;
actor->tics = (tic_t)actor->reactiontime;
}
// Function: A_BunnyHop

View File

@ -10209,7 +10209,7 @@ domaceagain:
case MT_PARTICLEGEN:
{
fixed_t radius, speed, bottomheight, topheight;
INT32 type, numdivisions, time, anglespeed;
INT32 type, numdivisions, time, anglespeed, ticcount;
angle_t angledivision;
INT32 line;
const size_t mthingi = (size_t)(mthing - mapthings);
@ -10232,6 +10232,10 @@ domaceagain:
bottomheight = lines[line].frontsector->floorheight;
topheight = lines[line].frontsector->ceilingheight - mobjinfo[(mobjtype_t)type].height;
if (!lines[line].backsector
|| (ticcount = (sides[lines[line].sidenum[1]].textureoffset >> FRACBITS)) < 1)
ticcount = states[S_PARTICLEGEN].tics;
numdivisions = (mthing->options >> ZSHIFT);
if (numdivisions)
@ -10268,8 +10272,9 @@ domaceagain:
"Numdivisions is %d\n"
"Angledivision is %d\n"
"Time is %d\n"
"Type is %d\n",
sizeu1(mthingi), radius, speed, anglespeed, numdivisions, angledivision, time, type);
"Type is %d\n"
"Tic seperation is %d\n",
sizeu1(mthingi), radius, speed, anglespeed, numdivisions, angledivision, time, type, ticcount);
mobj->angle = 0;
mobj->movefactor = speed;
@ -10279,6 +10284,7 @@ domaceagain:
mobj->health = time;
mobj->friction = radius;
mobj->threshold = type;
mobj->reactiontime = ticcount;
break;
}