From bf7ed0b9e99a843e7333e3efe5371316cf9434ae Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 12:36:20 +0100 Subject: [PATCH 1/4] I call this... the GFZ3 Unfuckening. * GFZ3 Eggmobile's laser won't change its angle when you move left and right anymore. * Changed because its ability to move quickly was extremely punishing for new players (see ProJared's youtube video on the matter). * http://gfycat.com/PassionateUnknownAgama (the twitching on the third laser has been fixed since this was recorded) * GFZ3 Eggmobile will, when too far away from the ground and moving upwards, slow itself down vertically. * This was punishing and annoying for both old and new players alike. * http://gfycat.com/ShabbyAncientEarthworm (old values - the typical settling height is slightly lower now) --- src/p_enemy.c | 16 +++++++++++----- src/p_mobj.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 73ec2a79d..dda12ae7d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2092,12 +2092,13 @@ void A_Boss1Laser(mobj_t *actor) if (!(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) { point = P_SpawnMobj(x + P_ReturnThrustX(actor, actor->angle, actor->radius), y + P_ReturnThrustY(actor, actor->angle, actor->radius), actor->z - actor->height / 2, MT_EGGMOBILE_TARGET); + point->angle = actor->angle; point->fuse = actor->tics+1; P_SetTarget(&point->target, actor->target); P_SetTarget(&actor->target, point); } } - else if (actor->target && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) + else if (actor->target && actor->target->type != MT_EGGMOBILE_TARGET && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) actor->angle = R_PointToAngle2(x, y, actor->target->x, actor->target->y); if (actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH) @@ -2148,11 +2149,16 @@ void A_Boss1Laser(mobj_t *actor) // var1: // 0 - accelerative focus with friction // 1 - steady focus with fixed movement speed -// var2 = unused +// anything else - don't move +// var2: +// 0 - don't trace target, just move forwards +// & 1 - change horizontal angle +// & 2 - change vertical angle // void A_FocusTarget(mobj_t *actor) { INT32 locvar1 = var1; + INT32 locvar2 = var2; #ifdef HAVE_BLUA if (LUA_CallAction("A_FocusTarget", actor)) return; @@ -2161,9 +2167,9 @@ void A_FocusTarget(mobj_t *actor) if (actor->target) { fixed_t speed = FixedMul(actor->info->speed, actor->scale); - fixed_t dist = R_PointToDist2(actor->x, actor->y, actor->target->x, actor->target->y); - angle_t vangle = R_PointToAngle2(actor->z , 0, actor->target->z + (actor->target->height>>1), dist); - angle_t hangle = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y); + fixed_t dist = (locvar2 ? R_PointToDist2(actor->x, actor->y, actor->target->x, actor->target->y) : speed+1); + angle_t hangle = ((locvar2 & 1) ? R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y) : actor->angle); + angle_t vangle = ((locvar2 & 2) ? R_PointToAngle2(actor->z , 0, actor->target->z + (actor->target->height>>1), dist) : ANGLE_90); switch(locvar1) { case 0: diff --git a/src/p_mobj.c b/src/p_mobj.c index db80851f3..e1c45dd72 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4436,7 +4436,16 @@ static void P_Boss1Thinker(mobj_t *mobj) return; } - if (mobj->state != &states[mobj->info->spawnstate] && mobj->health > 0 && mobj->flags & MF_FLOAT && !(mobj->flags2 & MF2_SKULLFLY)) + if (mobj->flags2 & MF2_SKULLFLY) + { + if (P_MobjFlip(mobj)*mobj->momz > 0 + && ((mobj->eflags & MFE_VERTICALFLIP + && (mobj->z+mobj->height) < (mobj->ceilingz-(2*mobj->height))) + || (!(mobj->eflags & MFE_VERTICALFLIP) + && mobj->z > (mobj->floorz+(2*mobj->height))))) + mobj->momz = FixedMul(mobj->momz, 60000); + } + else if (mobj->state != &states[mobj->info->spawnstate] && mobj->health > 0 && mobj->flags & MF_FLOAT) mobj->momz = FixedMul(mobj->momz,7*FRACUNIT/8); if (mobj->state == &states[mobj->info->meleestate] From 7e8f7a59d1d4c6903a162f0907c066c51d6ef787 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 12:42:26 +0100 Subject: [PATCH 2/4] This code never ran anyways, so. --- src/p_enemy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index dda12ae7d..967ad15e7 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2098,8 +2098,9 @@ void A_Boss1Laser(mobj_t *actor) P_SetTarget(&actor->target, point); } } - else if (actor->target && actor->target->type != MT_EGGMOBILE_TARGET && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) - actor->angle = R_PointToAngle2(x, y, actor->target->x, actor->target->y); + /* -- the following was relevant when the MT_EGGMOBILE_TARGET was allowed to move left and right from its path + else if (actor->target && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) + actor->angle = R_PointToAngle2(x, y, actor->target->x, actor->target->y);*/ if (actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH) angle = FixedAngle(FixedDiv(actor->tics*160*FRACUNIT, actor->state->tics*FRACUNIT) + 10*FRACUNIT); From c786dbda78f28b634442dceb86d4022c5e598866 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 13:06:07 +0100 Subject: [PATCH 3/4] Improved the way GFZ3 Eggman slows down in the air when MF2_SKULLFLYing. --- src/p_mobj.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index e1c45dd72..b249e6741 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4438,12 +4438,11 @@ static void P_Boss1Thinker(mobj_t *mobj) if (mobj->flags2 & MF2_SKULLFLY) { - if (P_MobjFlip(mobj)*mobj->momz > 0 - && ((mobj->eflags & MFE_VERTICALFLIP - && (mobj->z+mobj->height) < (mobj->ceilingz-(2*mobj->height))) - || (!(mobj->eflags & MFE_VERTICALFLIP) - && mobj->z > (mobj->floorz+(2*mobj->height))))) - mobj->momz = FixedMul(mobj->momz, 60000); + fixed_t dist = (mobj->eflags & MFE_VERTICALFLIP) + ? ((mobj->ceilingz-(2*mobj->height)) - (mobj->z+mobj->height)) + : (mobj->z - (mobj->floorz+(2*mobj->height))); + if (dist > 0 && P_MobjFlip(mobj)*mobj->momz > 0) + mobj->momz = FixedMul(mobj->momz, FRACUNIT - (dist>>12)); } else if (mobj->state != &states[mobj->info->spawnstate] && mobj->health > 0 && mobj->flags & MF_FLOAT) mobj->momz = FixedMul(mobj->momz,7*FRACUNIT/8); From 5a048df3d53e3507129005dd6ff6538c70d7bc64 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 13:07:24 +0100 Subject: [PATCH 4/4] Messed up the indentation royally. --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b249e6741..f564a1525 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4439,8 +4439,8 @@ static void P_Boss1Thinker(mobj_t *mobj) if (mobj->flags2 & MF2_SKULLFLY) { fixed_t dist = (mobj->eflags & MFE_VERTICALFLIP) - ? ((mobj->ceilingz-(2*mobj->height)) - (mobj->z+mobj->height)) - : (mobj->z - (mobj->floorz+(2*mobj->height))); + ? ((mobj->ceilingz-(2*mobj->height)) - (mobj->z+mobj->height)) + : (mobj->z - (mobj->floorz+(2*mobj->height))); if (dist > 0 && P_MobjFlip(mobj)*mobj->momz > 0) mobj->momz = FixedMul(mobj->momz, FRACUNIT - (dist>>12)); }