mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Improve A_SignSpin
This commit is contained in:
parent
5e03d40b33
commit
eb6d3b3dbe
3 changed files with 23 additions and 12 deletions
12
src/info.c
12
src/info.c
|
@ -1926,10 +1926,12 @@ state_t states[NUMSTATES] =
|
|||
|
||||
// Level End Sign
|
||||
{SPR_SIGN, 0, -1, {A_SignPlayer}, -3, 0, S_NULL}, // S_SIGN
|
||||
{SPR_SIGN, 0, 1, {A_SignSpin}, 30, S_SIGNPLAYER, S_SIGNSPINLOOP}, // S_SIGNSPIN
|
||||
{SPR_SIGN, 0, 1, {A_SignSpin}, 30, 0, S_SIGNSPINLOOP}, // S_SIGNSPIN
|
||||
{SPR_SIGN, 0, 0, {A_Repeat}, 4, S_SIGNSPIN, S_SIGNROULETTE}, // S_SIGNSPINLOOP
|
||||
{SPR_SIGN, 0, 0, {A_SignPlayer}, -2, 0, S_SIGNSPIN}, // S_SIGNROULETTE
|
||||
{SPR_SIGN, 0, -1, {A_SignPlayer}, -1, 0, S_NULL}, // S_SIGNPLAYER
|
||||
{SPR_SIGN, 0, 1, {A_SignPlayer}, -1, 0, S_SIGNSLOW}, // S_SIGNPLAYER
|
||||
{SPR_SIGN, 0, 1, {A_SignSpin}, 30, 0, S_SIGNSLOW}, // S_SIGNSLOW
|
||||
{SPR_SIGN, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SIGNSTOP
|
||||
{SPR_SIGN, FF_PAPERSPRITE|2, -1, {NULL}, 0, 0, S_NULL}, // S_SIGNBOARD
|
||||
{SPR_SIGN, FF_PAPERSPRITE|1, -1, {NULL}, 0, 29, S_NULL}, // S_EGGMANSIGN
|
||||
|
||||
|
@ -7792,16 +7794,16 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
sfx_lvpass, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
S_SIGNPLAYER, // painstate
|
||||
MT_SPARK, // painchance
|
||||
sfx_None, // painsound
|
||||
S_EGGMANSIGN, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_SIGNSTOP, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
8, // speed
|
||||
32*FRACUNIT, // radius
|
||||
36*FRACUNIT, // radius
|
||||
32*FRACUNIT, // height
|
||||
0, // display offset
|
||||
16, // mass
|
||||
|
|
|
@ -2064,6 +2064,8 @@ typedef enum state
|
|||
S_SIGNSPINLOOP,
|
||||
S_SIGNROULETTE,
|
||||
S_SIGNPLAYER,
|
||||
S_SIGNSLOW,
|
||||
S_SIGNSTOP,
|
||||
S_SIGNBOARD,
|
||||
S_EGGMANSIGN,
|
||||
|
||||
|
|
|
@ -5011,8 +5011,8 @@ void A_UnsetSolidSteam(mobj_t *actor)
|
|||
//
|
||||
// Description: Spins a signpost until it hits the ground and reaches its mapthing's angle.
|
||||
//
|
||||
// var1 = degrees to rotate object
|
||||
// var2 = state to set object to once spinning stops
|
||||
// var1 = degrees to rotate object (must be positive, because I'm lazy)
|
||||
// var2 = unused
|
||||
//
|
||||
void A_SignSpin(mobj_t *actor)
|
||||
{
|
||||
|
@ -5031,12 +5031,15 @@ void A_SignSpin(mobj_t *actor)
|
|||
{
|
||||
angle_t mapangle = FixedAngle(actor->spawnpoint->angle << FRACBITS);
|
||||
angle_t diff = mapangle - actor->angle;
|
||||
if (diff < rotateangle)
|
||||
if (diff < ANG2)
|
||||
{
|
||||
actor->angle = mapangle;
|
||||
P_SetMobjState(actor, locvar2);
|
||||
P_SetMobjState(actor, actor->info->deathstate);
|
||||
return;
|
||||
}
|
||||
if (actor->state-states != actor->info->painstate)
|
||||
P_SetMobjState(actor, actor->info->painstate);
|
||||
actor->movedir = min((mapangle - actor->angle) >> 2, actor->movedir);
|
||||
}
|
||||
else // no mapthing? just finish in your current angle
|
||||
{
|
||||
|
@ -5044,15 +5047,19 @@ void A_SignSpin(mobj_t *actor)
|
|||
return;
|
||||
}
|
||||
}
|
||||
actor->angle += rotateangle;
|
||||
if (leveltime & 1 || actor->tracer == NULL) return;
|
||||
else
|
||||
{
|
||||
actor->movedir = rotateangle;
|
||||
}
|
||||
actor->angle += actor->movedir;
|
||||
if (actor->tracer == NULL || P_MobjWasRemoved(actor->tracer)) return;
|
||||
for (i = -1; i < 2; i += 2)
|
||||
{
|
||||
P_SpawnMobjFromMobj(actor,
|
||||
P_ReturnThrustX(actor, actor->tracer->angle, i * actor->radius),
|
||||
P_ReturnThrustY(actor, actor->tracer->angle, i * actor->radius),
|
||||
(actor->eflags & MFE_VERTICALFLIP) ? 0 : actor->height,
|
||||
actor->info->painchance);
|
||||
actor->info->painchance)->destscale >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue