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:
parent
1d11a14f64
commit
a61be91523
|
@ -2581,7 +2581,7 @@ state_t states[NUMSTATES] =
|
||||||
|
|
||||||
// Particle sprite
|
// Particle sprite
|
||||||
{SPR_PRTL, FF_FULLBRIGHT|FF_TRANS70, 2*TICRATE, {NULL}, 0, 0, S_NULL}, // S_PARTICLE
|
{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, 0, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRA - 100
|
||||||
{SPR_SCOR, 1, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRB - 200
|
{SPR_SCOR, 1, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRB - 200
|
||||||
|
|
|
@ -3582,12 +3582,12 @@ void A_ParticleSpawn(mobj_t *actor)
|
||||||
spawn->tics = (tic_t)actor->health;
|
spawn->tics = (tic_t)actor->health;
|
||||||
spawn->flags2 |= (actor->flags2 & MF2_OBJECTFLIP);
|
spawn->flags2 |= (actor->flags2 & MF2_OBJECTFLIP);
|
||||||
spawn->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones
|
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 += actor->movedir;
|
||||||
}
|
}
|
||||||
|
|
||||||
actor->angle += (angle_t)actor->movecount;
|
actor->angle += (angle_t)actor->movecount;
|
||||||
|
actor->tics = (tic_t)actor->reactiontime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function: A_BunnyHop
|
// Function: A_BunnyHop
|
||||||
|
|
12
src/p_mobj.c
12
src/p_mobj.c
|
@ -10209,7 +10209,7 @@ domaceagain:
|
||||||
case MT_PARTICLEGEN:
|
case MT_PARTICLEGEN:
|
||||||
{
|
{
|
||||||
fixed_t radius, speed, bottomheight, topheight;
|
fixed_t radius, speed, bottomheight, topheight;
|
||||||
INT32 type, numdivisions, time, anglespeed;
|
INT32 type, numdivisions, time, anglespeed, ticcount;
|
||||||
angle_t angledivision;
|
angle_t angledivision;
|
||||||
INT32 line;
|
INT32 line;
|
||||||
const size_t mthingi = (size_t)(mthing - mapthings);
|
const size_t mthingi = (size_t)(mthing - mapthings);
|
||||||
|
@ -10232,6 +10232,10 @@ domaceagain:
|
||||||
bottomheight = lines[line].frontsector->floorheight;
|
bottomheight = lines[line].frontsector->floorheight;
|
||||||
topheight = lines[line].frontsector->ceilingheight - mobjinfo[(mobjtype_t)type].height;
|
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);
|
numdivisions = (mthing->options >> ZSHIFT);
|
||||||
|
|
||||||
if (numdivisions)
|
if (numdivisions)
|
||||||
|
@ -10268,8 +10272,9 @@ domaceagain:
|
||||||
"Numdivisions is %d\n"
|
"Numdivisions is %d\n"
|
||||||
"Angledivision is %d\n"
|
"Angledivision is %d\n"
|
||||||
"Time is %d\n"
|
"Time is %d\n"
|
||||||
"Type is %d\n",
|
"Type is %d\n"
|
||||||
sizeu1(mthingi), radius, speed, anglespeed, numdivisions, angledivision, time, type);
|
"Tic seperation is %d\n",
|
||||||
|
sizeu1(mthingi), radius, speed, anglespeed, numdivisions, angledivision, time, type, ticcount);
|
||||||
|
|
||||||
mobj->angle = 0;
|
mobj->angle = 0;
|
||||||
mobj->movefactor = speed;
|
mobj->movefactor = speed;
|
||||||
|
@ -10279,6 +10284,7 @@ domaceagain:
|
||||||
mobj->health = time;
|
mobj->health = time;
|
||||||
mobj->friction = radius;
|
mobj->friction = radius;
|
||||||
mobj->threshold = type;
|
mobj->threshold = type;
|
||||||
|
mobj->reactiontime = ticcount;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue