Fixed flame jets. (I'll upload the patch.dta required to run this exe when I'm ready to make a merge request.)

This commit is contained in:
toasterbabe 2017-01-21 12:39:41 +00:00
parent 399a6c1d47
commit 90b2236711
4 changed files with 32 additions and 27 deletions

View file

@ -5280,9 +5280,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FLAMEJETFLAMEB1", "S_FLAMEJETFLAMEB1",
"S_FLAMEJETFLAMEB2", "S_FLAMEJETFLAMEB2",
"S_FLAMEJETFLAMEB3", "S_FLAMEJETFLAMEB3",
"S_FLAMEJETFLAMEB4",
"S_FLAMEJETFLAMEB5",
"S_FLAMEJETFLAMEB6",
// Trapgoyles // Trapgoyles
"S_TRAPGOYLE", "S_TRAPGOYLE",

View file

@ -1871,20 +1871,17 @@ state_t states[NUMSTATES] =
// Spinning flame jets // Spinning flame jets
// A: Counter-clockwise // A: Counter-clockwise
{SPR_NULL, 0, 1, {A_TrapShot}, MT_FLAMEJETFLAMEB, -16*FRACUNIT, S_FJSPINAXISA2}, // S_FJSPINAXISA1 {SPR_NULL, 0, 1, {A_TrapShot}, MT_FLAMEJETFLAMEB, -(16<<16)|(1<<15)|64, S_FJSPINAXISA2}, // S_FJSPINAXISA1
{SPR_NULL, 0, 2, {A_ChangeAngleRelative}, 6, 6, S_FJSPINAXISA1}, // S_FJSPINAXISA2 {SPR_NULL, 0, 2, {A_ChangeAngleRelative}, 6, 6, S_FJSPINAXISA1}, // S_FJSPINAXISA2
// B: Clockwise // B: Clockwise
{SPR_NULL, 0, 1, {A_TrapShot}, MT_FLAMEJETFLAMEB, -16*FRACUNIT, S_FJSPINAXISB2}, // S_FJSPINAXISB1 {SPR_NULL, 0, 1, {A_TrapShot}, MT_FLAMEJETFLAMEB, -(16<<16)|(1<<15)|64, S_FJSPINAXISB2}, // S_FJSPINAXISB1
{SPR_NULL, 0, 2, {A_ChangeAngleRelative}, -6, -6, S_FJSPINAXISB1}, // S_FJSPINAXISB2 {SPR_NULL, 0, 2, {A_ChangeAngleRelative}, -6, -6, S_FJSPINAXISB1}, // S_FJSPINAXISB2
// Blade's flame // Blade's flame
{SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|1, 1, {A_MoveRelative}, 0, 5, S_FLAMEJETFLAMEB2}, // S_FLAMEJETFLAMEB1 {SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40, 1, {A_MoveRelative}, 0, 5, S_FLAMEJETFLAMEB2}, // S_FLAMEJETFLAMEB1
{SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|2, 1, {A_MoveRelative}, 0, 7, S_FLAMEJETFLAMEB3}, // S_FLAMEJETFLAMEB2 {SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40, 1, {A_MoveRelative}, 0, 7, S_FLAMEJETFLAMEB3}, // S_FLAMEJETFLAMEB2
{SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|3,24, {NULL}, 0, 0, S_FLAMEJETFLAMEB4}, // S_FLAMEJETFLAMEB3 {SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|FF_ANIMATE, (12*7), {NULL}, 7, 12, S_NULL}, // S_FLAMEJETFLAMEB3
{SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|4,24, {NULL}, 0, 0, S_FLAMEJETFLAMEB5}, // S_FLAMEJETFLAMEB4
{SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|5,24, {NULL}, 0, 0, S_FLAMEJETFLAMEB6}, // S_FLAMEJETFLAMEB5
{SPR_DFLM, FF_FULLBRIGHT|FF_TRANS40|6,12, {NULL}, 0, 0, S_NULL}, // S_FLAMEJETFLAMEB6
// Trapgoyles // Trapgoyles
{SPR_GARG, 0, 67, {NULL}, 0, 0, S_TRAPGOYLE_CHECK}, // S_TRAPGOYLE {SPR_GARG, 0, 67, {NULL}, 0, 0, S_TRAPGOYLE_CHECK}, // S_TRAPGOYLE

View file

@ -2085,9 +2085,6 @@ typedef enum state
S_FLAMEJETFLAMEB1, S_FLAMEJETFLAMEB1,
S_FLAMEJETFLAMEB2, S_FLAMEJETFLAMEB2,
S_FLAMEJETFLAMEB3, S_FLAMEJETFLAMEB3,
S_FLAMEJETFLAMEB4,
S_FLAMEJETFLAMEB5,
S_FLAMEJETFLAMEB6,
// Trapgoyles // Trapgoyles
S_TRAPGOYLE, S_TRAPGOYLE,

View file

@ -9630,14 +9630,19 @@ void A_HomingChase(mobj_t *actor)
// lower 16 bits = object # to fire // lower 16 bits = object # to fire
// upper 16 bits = front offset // upper 16 bits = front offset
// var2: // var2:
// lower 16 bits = vertical angle // lower 15 bits = vertical angle variable
// 16th bit:
// - 0: use vertical angle variable as vertical angle in degrees
// - 1: mimic P_SpawnXYZMissile
// use z of actor minus z of missile as vertical distance to cover during momz calculation
// use vertical angle variable as horizontal distance to cover during momz calculation
// upper 16 bits = height offset // upper 16 bits = height offset
// //
void A_TrapShot(mobj_t *actor) void A_TrapShot(mobj_t *actor)
{ {
INT32 locvar1 = var1; INT32 locvar1 = var1;
INT32 locvar2 = var2; INT32 locvar2 = var2;
angle_t vertang = FixedAngle(((INT16)(locvar2 & 65535))*FRACUNIT); boolean oldstyle = (locvar2 & 32768) ? true : false;
mobjtype_t type = (mobjtype_t)(locvar1 & 65535); mobjtype_t type = (mobjtype_t)(locvar1 & 65535);
mobj_t *missile; mobj_t *missile;
INT16 frontoff = (INT16)(locvar1 >> 16); INT16 frontoff = (INT16)(locvar1 >> 16);
@ -9653,10 +9658,7 @@ void A_TrapShot(mobj_t *actor)
y = actor->y + P_ReturnThrustY(actor, actor->angle, FixedMul(frontoff*FRACUNIT, actor->scale)); y = actor->y + P_ReturnThrustY(actor, actor->angle, FixedMul(frontoff*FRACUNIT, actor->scale));
if (actor->eflags & MFE_VERTICALFLIP) if (actor->eflags & MFE_VERTICALFLIP)
{
z = actor->z + actor->height - FixedMul(vertoff*FRACUNIT, actor->scale) - FixedMul(mobjinfo[type].height, actor->scale); z = actor->z + actor->height - FixedMul(vertoff*FRACUNIT, actor->scale) - FixedMul(mobjinfo[type].height, actor->scale);
vertang = InvAngle(vertang); // flip firing angle
}
else else
z = actor->z + FixedMul(vertoff*FRACUNIT, actor->scale); z = actor->z + FixedMul(vertoff*FRACUNIT, actor->scale);
@ -9672,18 +9674,30 @@ void A_TrapShot(mobj_t *actor)
P_SetScale(missile, actor->scale); P_SetScale(missile, actor->scale);
if (missile->info->seesound) if (missile->info->seesound)
S_StartSound(actor, missile->info->seesound); S_StartSound(missile, missile->info->seesound);
P_SetTarget(&missile->target, actor); P_SetTarget(&missile->target, actor);
missile->angle = actor->angle; missile->angle = actor->angle;
speed = FixedMul(missile->info->speed, missile->scale); speed = FixedMul(missile->info->speed, missile->scale);
missile->momx = FixedMul(FINECOSINE(vertang>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(missile->angle>>ANGLETOFINESHIFT), speed)); if (oldstyle)
missile->momy = FixedMul(FINECOSINE(vertang>>ANGLETOFINESHIFT), FixedMul(FINESINE(missile->angle>>ANGLETOFINESHIFT), speed)); {
missile->momz = FixedMul(FINESINE(vertang>>ANGLETOFINESHIFT), speed); missile->momx = FixedMul(FINECOSINE(missile->angle>>ANGLETOFINESHIFT), speed);
missile->momy = FixedMul(FINESINE(missile->angle>>ANGLETOFINESHIFT), speed);
P_CheckMissileSpawn(missile); // The below line basically mimics P_SpawnXYZMissile's momz calculation.
missile->momz = (actor->z + ((actor->eflags & MFE_VERTICALFLIP) ? actor->height : 0) - z) / ((fixed_t)(locvar2 & 32767)*FRACUNIT / speed);
P_CheckMissileSpawn(missile);
}
else
{
angle_t vertang = FixedAngle(((INT16)(locvar2 & 32767))*FRACUNIT);
if (actor->eflags & MFE_VERTICALFLIP)
vertang = InvAngle(vertang); // flip firing angle
missile->momx = FixedMul(FINECOSINE(vertang>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(missile->angle>>ANGLETOFINESHIFT), speed));
missile->momy = FixedMul(FINECOSINE(vertang>>ANGLETOFINESHIFT), FixedMul(FINESINE(missile->angle>>ANGLETOFINESHIFT), speed));
missile->momz = FixedMul(FINESINE(vertang>>ANGLETOFINESHIFT), speed);
}
} }
// Function: A_VileTarget // Function: A_VileTarget