A_OrbitNights height offset by target height implementation

This commit is contained in:
mazmazz 2018-08-10 23:50:23 -04:00
parent c9c0219393
commit b97037f644

View file

@ -8542,12 +8542,16 @@ void A_ToggleFlameJet(mobj_t* actor)
// Description: Used by Chaos Emeralds to orbit around Nights (aka Super Sonic.) // Description: Used by Chaos Emeralds to orbit around Nights (aka Super Sonic.)
// //
// var1 = Angle adjustment (aka orbit speed) // var1 = Angle adjustment (aka orbit speed)
// var2 = Lower four bits: height offset, Upper 4 bits = set if object is Nightopian Helper // var2:
// Lower 16 bits: height offset
// Upper 8 bits: set if object is Nightopian Helper
// Highest 8 bits: center height offset to target by this divisor
// //
void A_OrbitNights(mobj_t* actor) void A_OrbitNights(mobj_t* actor)
{ {
INT32 ofs = (var2 & 0xFFFF); INT32 ofs = (var2 & 0xFFFF);
boolean ishelper = (var2 & 0xFFFF0000); boolean ishelper = ((var2 >> 16) & 0xFF);
INT32 ofsdiv = var2 >> 24;
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
if (LUA_CallAction("A_OrbitNights", actor)) if (LUA_CallAction("A_OrbitNights", actor))
return; return;
@ -8577,6 +8581,9 @@ void A_OrbitNights(mobj_t* actor)
actor->x = actor->target->x + fc; actor->x = actor->target->x + fc;
actor->y = actor->target->y + fs; actor->y = actor->target->y + fs;
if (ofsdiv)
actor->z = (actor->target->z + actor->target->height / ofsdiv) + fh + FixedMul(16*FRACUNIT, actor->scale);
else
actor->z = actor->target->z + fh + FixedMul(16*FRACUNIT, actor->scale); actor->z = actor->target->z + fh + FixedMul(16*FRACUNIT, actor->scale);
// Semi-lazy hack // Semi-lazy hack