mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 12:40:58 +00:00
Merge branch 'minusflip' into 'master'
Have Minus rotate in mid-air Closes #326 See merge request STJr/SRB2Internal!532
This commit is contained in:
commit
8adcea56c3
5 changed files with 40 additions and 29 deletions
|
@ -4975,14 +4975,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_MINUS_BURST4",
|
||||
"S_MINUS_BURST5",
|
||||
"S_MINUS_POPUP",
|
||||
"S_MINUS_UPWARD1",
|
||||
"S_MINUS_UPWARD2",
|
||||
"S_MINUS_UPWARD3",
|
||||
"S_MINUS_UPWARD4",
|
||||
"S_MINUS_DOWNWARD1",
|
||||
"S_MINUS_DOWNWARD2",
|
||||
"S_MINUS_DOWNWARD3",
|
||||
"S_MINUS_DOWNWARD4",
|
||||
"S_MINUS_AERIAL1",
|
||||
"S_MINUS_AERIAL2",
|
||||
"S_MINUS_AERIAL3",
|
||||
"S_MINUS_AERIAL4",
|
||||
|
||||
// Minus dirt
|
||||
"S_MINUSDIRT1",
|
||||
|
|
14
src/info.c
14
src/info.c
|
@ -1074,15 +1074,11 @@ state_t states[NUMSTATES] =
|
|||
{SPR_MNUD, 2|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST4}, // S_MINUS_BURST3
|
||||
{SPR_MNUD, 3|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST5}, // S_MINUS_BURST4
|
||||
{SPR_MNUD, 4|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUSDIRT2}, // S_MINUS_BURST5
|
||||
{SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_POPUP
|
||||
{SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD2}, // S_MINUS_UPWARD1
|
||||
{SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD3}, // S_MINUS_UPWARD2
|
||||
{SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD4}, // S_MINUS_UPWARD3
|
||||
{SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_UPWARD4
|
||||
{SPR_MNUS, 4, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD2}, // S_MINUS_DOWNWARD1
|
||||
{SPR_MNUS, 5, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD3}, // S_MINUS_DOWNWARD2
|
||||
{SPR_MNUS, 6, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD4}, // S_MINUS_DOWNWARD3
|
||||
{SPR_MNUS, 7, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD1}, // S_MINUS_DOWNWARD4
|
||||
{SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_AERIAL1}, // S_MINUS_POPUP
|
||||
{SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL2}, // S_MINUS_AERIAL1
|
||||
{SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL3}, // S_MINUS_AERIAL2
|
||||
{SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL4}, // S_MINUS_AERIAL3
|
||||
{SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL1}, // S_MINUS_AERIAL4
|
||||
|
||||
{SPR_MNUD, FF_ANIMATE, 6, {NULL}, 1, 5, S_MINUSDIRT2}, // S_MINUSDIRT1
|
||||
{SPR_MNUD, 5, 8, {NULL}, 3, 5, S_MINUSDIRT3}, // S_MINUSDIRT2
|
||||
|
|
12
src/info.h
12
src/info.h
|
@ -1270,14 +1270,10 @@ typedef enum state
|
|||
S_MINUS_BURST4,
|
||||
S_MINUS_BURST5,
|
||||
S_MINUS_POPUP,
|
||||
S_MINUS_UPWARD1,
|
||||
S_MINUS_UPWARD2,
|
||||
S_MINUS_UPWARD3,
|
||||
S_MINUS_UPWARD4,
|
||||
S_MINUS_DOWNWARD1,
|
||||
S_MINUS_DOWNWARD2,
|
||||
S_MINUS_DOWNWARD3,
|
||||
S_MINUS_DOWNWARD4,
|
||||
S_MINUS_AERIAL1,
|
||||
S_MINUS_AERIAL2,
|
||||
S_MINUS_AERIAL3,
|
||||
S_MINUS_AERIAL4,
|
||||
|
||||
// Minus dirt
|
||||
S_MINUSDIRT1,
|
||||
|
|
|
@ -5672,10 +5672,10 @@ void A_MinusPopup(mobj_t *actor)
|
|||
S_StartSound(actor, sfx_s3k82);
|
||||
for (i = 1; i <= num; i++)
|
||||
{
|
||||
mobj_t *rock = P_SpawnMobj(actor->x, actor->y, actor->z + actor->height/4, MT_ROCKCRUMBLE1);
|
||||
mobj_t *rock = P_SpawnMobjFromMobj(actor, 0, 0, actor->height/4, MT_ROCKCRUMBLE1);
|
||||
P_Thrust(rock, ani*i, FRACUNIT);
|
||||
rock->momz = 3*FRACUNIT;
|
||||
P_SetScale(rock, FRACUNIT/3);
|
||||
P_SetObjectMomZ(rock, 3*FRACUNIT, false);
|
||||
P_SetScale(rock, rock->scale/3);
|
||||
}
|
||||
P_RadiusAttack(actor, actor, 2*actor->radius, 0);
|
||||
if (actor->tracer)
|
||||
|
@ -5689,11 +5689,12 @@ void A_MinusPopup(mobj_t *actor)
|
|||
// Description: If the minus hits the floor, dig back into the ground.
|
||||
//
|
||||
// var1 = State to switch to (if 0, use seestate).
|
||||
// var2 = unused
|
||||
// var2 = If not 0, spawn debris when hitting the floor.
|
||||
//
|
||||
void A_MinusCheck(mobj_t *actor)
|
||||
{
|
||||
INT32 locvar1 = var1;
|
||||
INT32 locvar2 = var2;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_CallAction("A_MinusCheck", actor))
|
||||
|
@ -5704,6 +5705,18 @@ void A_MinusCheck(mobj_t *actor)
|
|||
{
|
||||
P_SetMobjState(actor, locvar1 ? (statenum_t)locvar1 : actor->info->seestate);
|
||||
actor->flags = actor->info->flags;
|
||||
if (locvar2)
|
||||
{
|
||||
INT32 i, num = 6;
|
||||
angle_t ani = FixedAngle(FRACUNIT*360/num);
|
||||
for (i = 1; i <= num; i++)
|
||||
{
|
||||
mobj_t *rock = P_SpawnMobjFromMobj(actor, 0, 0, actor->height/4, MT_ROCKCRUMBLE1);
|
||||
P_Thrust(rock, ani*i, FRACUNIT);
|
||||
P_SetObjectMomZ(rock, 3*FRACUNIT, false);
|
||||
P_SetScale(rock, rock->scale/3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
src/p_mobj.c
10
src/p_mobj.c
|
@ -9709,6 +9709,16 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
#undef DRAGONTURNSPEED
|
||||
}
|
||||
break;
|
||||
case MT_MINUS:
|
||||
#ifdef ROTSPRITE
|
||||
{
|
||||
if (P_IsObjectOnGround(mobj))
|
||||
mobj->rollangle = 0;
|
||||
else
|
||||
mobj->rollangle = R_PointToAngle2(0, 0, mobj->momz, (mobj->scale << 1) - min(abs(mobj->momz), mobj->scale << 1));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MT_SPINFIRE:
|
||||
if (mobj->flags & MF_NOGRAVITY)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue