Some changes and corrections.

* Cleaner A_ParticleSpawn code.
* Removed several hacks with Mario blocks, and corrected a mistaken assumption with when the FOF's thinker is being applied.
* Made the flashing of T_LaserFlash even less obnoxious.
This commit is contained in:
toasterbabe 2016-11-22 16:21:30 +00:00
parent e34ef54166
commit 05f58df709
3 changed files with 32 additions and 30 deletions

View file

@ -3477,29 +3477,32 @@ void A_ParticleSpawn(mobj_t *actor)
if (!actor->health)
return;
if ((actor->lastlook) && (actor->threshold))
{
for (i = 0; i < actor->lastlook; i++)
{
spawn = P_SpawnMobj(
actor->x + FixedMul(FixedMul(actor->friction, actor->scale), FINECOSINE(actor->angle>>ANGLETOFINESHIFT)),
actor->y + FixedMul(FixedMul(actor->friction, actor->scale), FINESINE(actor->angle>>ANGLETOFINESHIFT)),
actor->z,
(mobjtype_t)actor->threshold);
P_SetScale(spawn, actor->scale);
spawn->momz = FixedMul(actor->movefactor, spawn->scale);
spawn->destscale = spawn->scale/100;
spawn->scalespeed = spawn->scale/actor->health;
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);
if (!actor->lastlook)
return;
actor->angle += actor->movedir;
}
actor->angle += (angle_t)actor->movecount;
if (!actor->threshold)
return;
for (i = 0; i < actor->lastlook; i++)
{
spawn = P_SpawnMobj(
actor->x + FixedMul(FixedMul(actor->friction, actor->scale), FINECOSINE(actor->angle>>ANGLETOFINESHIFT)),
actor->y + FixedMul(FixedMul(actor->friction, actor->scale), FINESINE(actor->angle>>ANGLETOFINESHIFT)),
actor->z,
(mobjtype_t)actor->threshold);
P_SetScale(spawn, actor->scale);
spawn->momz = FixedMul(actor->movefactor, spawn->scale);
spawn->destscale = spawn->scale/100;
spawn->scalespeed = spawn->scale/actor->health;
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;
}
// Function: A_BunnyHop

View file

@ -1135,10 +1135,7 @@ void T_MarioBlock(levelspecthink_t *block)
);
if (block->sector->ceilingheight >= block->ceilingwasheight + 32*FRACUNIT) // Go back down now..
{
block->direction = -block->direction;
block->sector->floorspeed = 0;
}
else if (block->sector->ceilingheight <= block->ceilingwasheight)
{
block->sector->ceilingheight = block->ceilingwasheight;
@ -1146,6 +1143,9 @@ void T_MarioBlock(levelspecthink_t *block)
P_RemoveThinker(&block->thinker);
block->sector->floordata = NULL;
block->sector->ceilingdata = NULL;
block->sector->floorspeed = 0;
block->sector->ceilspeed = 0;
block->direction = 0;
}
for (i = -1; (i = P_FindSectorFromTag((INT16)block->vars[0], i)) >= 0 ;)
@ -1802,7 +1802,7 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
void T_MarioBlockChecker(levelspecthink_t *block)
{
line_t *masterline = block->sourceline;
if (block->sector->floorspeed) // Don't update the textures when the block's being bumped upwards.
if (block->vars[2] == 1) // Don't update the textures when the block's being bumped upwards.
return;
if (SearchMarioNode(block->sector->touching_thinglist))
{
@ -3181,7 +3181,6 @@ INT32 EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
block->thinker.function.acp1 = (actionf_p1)T_MarioBlock;
// Set up the fields
roversec->floorspeed = 1; // Flag to prevent side changing.
block->sector = roversec;
block->vars[0] = sector->tag; // actionsector
block->vars[1] = 4*FRACUNIT; // speed

View file

@ -4989,7 +4989,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
if ((flags & FF_MARIO))
{
if (!(master->flags & ML_NOCLIMB)) // Don't change the textures of a brick block, just a question block
if (!(flags & FF_SHATTERBOTTOM)) // Don't change the textures of a brick block, just a question block
P_AddBlockThinker(sec2, master);
CheckForMarioBlocks = true;
}
@ -5348,12 +5348,12 @@ void T_LaserFlash(laserthink_t *flash)
if (!ffloor || !(ffloor->flags & FF_EXISTS))
return;
if (leveltime & 1)
if (leveltime & 2)
//ffloor->flags |= FF_RENDERALL;
ffloor->alpha = 0xC0;
ffloor->alpha = 0xB0;
else
//ffloor->flags &= ~FF_RENDERALL;
ffloor->alpha = 0x60;
ffloor->alpha = 0x90;
sourcesec = ffloor->master->frontsector; // Less to type!