From 77cd1ac7e595a13b54995e0f79c308efd4f371d4 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Mon, 16 Feb 2026 16:01:18 -0500 Subject: [PATCH] let rolled eggmine pierce through traps and missiles --- src/k_collide.c | 46 ++++++++++++++++++++++++++++++++++------------ src/p_mobj.c | 11 +++++------ 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/k_collide.c b/src/k_collide.c index ecafb38ec..0887acd83 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -318,9 +318,9 @@ void K_EggMineBounce(mobj_t *t1, mobj_t *t2) fixed_t localspacey = t1->y - pointy; angle_t impulseangle = R_PointToAngle2(0, 0, (localspacex + t2->momx)/2, (localspacey + t2->momy)/2); P_InstaThrust(t1, impulseangle, impulse); - zimpulse = (P_MobjFlip(t1) * min((P_AproxDistance(t2->momx, t2->momy) + P_AproxDistance(t1->momx, t1->momy)), 28*mapobjectscale)) + t2->momz/2; + zimpulse = (P_MobjFlip(t1) * min((P_AproxDistance(t2->momx, t2->momy) + P_AproxDistance(t1->momx, t1->momy)), 32*mapobjectscale)) + t2->momz/2; - if (t2->type == MT_EGGMINE) + if (t2->type != MT_PLAYER) { fixed_t zdiff = (t1->z + (t1->height*P_MobjFlip(t1)/2)) - (t2->z + (t2->height*P_MobjFlip(t2))/2); zimpulse /= 2; @@ -330,12 +330,11 @@ void K_EggMineBounce(mobj_t *t1, mobj_t *t2) } } // doesn't this look familiar + t1->z += 1; t1->momz = zimpulse; - t1->z += t1->momz; if (t1->extravalue1 == 0) { - K_SpawnEggMineBumpEffect(t1); t1->extravalue1 = 6; } @@ -343,6 +342,7 @@ void K_EggMineBounce(mobj_t *t1, mobj_t *t2) boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2) { + boolean damageitem = false; boolean sprung = false; if (t1->health <= 0 || t2->health <= 0) @@ -354,6 +354,11 @@ boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2) { return true; } + + if (t2->player && t2->player->hyudorotimer) + { + return true; // no interaction + } if (t2->player && t2->player->flamestore && (K_GetShieldFromPlayer(t2->player) == KSHIELD_FLAME)) { @@ -365,8 +370,7 @@ boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2) t2->player->flameburnstop = TICRATE/4; return true; } - - if (t2->type == MT_PLAYER && t1->health > 1) + else if (t2->type == MT_PLAYER && t1->health > 1) { if (t1->health > 2) { @@ -379,8 +383,6 @@ boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2) else if (P_IsObjectOnGround(t2)) { S_StartSound(t2, sfx_cdfm37); - // should think of something else for this specific interaction if people want something to happen - // t2->momz = 3*t1->scale*P_MobjFlip(t2); K_SpawnEggMineBumpEffect(t1); t1->extravalue1 = 6; return true; @@ -393,20 +395,37 @@ boolean K_EggMineCollide(mobj_t *t1, mobj_t *t2) // Let thrown items hit springs! sprung = P_DoSpring(t2, t1); } - else if (K_IsMissileOrKartItem(t2)) + else if (t2->type == MT_SSMINE_SHIELD || t2->type == MT_SSMINE || t2->type == MT_LANDMINE) + { + if (t1->health > 1) + { + t1->z += 1; + t1->momz += 12*mapobjectscale; + t1->momx /= 2; + t1->momy /= 2; + } + + damageitem = true; + // Bomb death + P_KillMobj(t2, t1, t1->target, DMG_NORMAL); + } + else if (P_IsKartItem(t2->type)) { // eggmines don't kill eachother if (!(t2->type == MT_SPB || t2->type == MT_EGGMINE || t2->type == MT_EGGMINE_SHIELD)) { - P_KillMobj(t2, t1, t1->target, DMG_INSTAKILL); + K_ItemDamage(t2, t1, true); + if (!(t2->type == MT_SPB)) damageitem = true; } - P_KillMobj(t1, t2, t2->target, DMG_INSTAKILL); } if (sprung) { return false; } + + if (damageitem && t1->health <= 1) + P_KillMobj(t1, t2, t2->target, DMG_INSTAKILL); return true; } @@ -414,6 +433,9 @@ boolean K_EggMineShieldCollide(mobj_t *t1, mobj_t *t2) { if (t1->health <= 0 || t2->health <= 0) return true; + + if (t2->type == MT_SPB) + return true; if (K_IsMissileOrKartItem(t2)) { @@ -421,8 +443,8 @@ boolean K_EggMineShieldCollide(mobj_t *t1, mobj_t *t2) if (!(t2->type == MT_SPB || t2->type == MT_EGGMINE || t2->type == MT_EGGMINE_SHIELD)) { P_KillMobj(t2, t1, t1->target, DMG_INSTAKILL); + if (!(t2->type == MT_SPB)) P_KillMobj(t1, t2, t2->target, DMG_INSTAKILL); } - P_KillMobj(t1, t2, t2->target, DMG_INSTAKILL); return true; } diff --git a/src/p_mobj.c b/src/p_mobj.c index e98cd5431..2b6f64a27 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8821,7 +8821,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) break; case MT_EGGMINE: mobj->friction = 95*ORIG_FRICTION/100; - if (mobj->momx || mobj->momy) + if (mobj->threshold > 0 || FixedHypot(mobj->momx, mobj->momy) >= 12*mobj->scale) { mobj_t *ghost = P_SpawnGhostMobj(mobj); @@ -8834,9 +8834,8 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (P_IsObjectOnGround(mobj)) { - if (mobj->health > 1 && mobj->threshold == 0) + if (mobj->threshold == 0 && mobj->health > 1 && FixedHypot(mobj->momx, mobj->momy) < 12*mobj->scale) { - S_StartSound(mobj, mobj->info->activesound); mobj->health = 1; mobj->whiteshadow = false; } @@ -8855,13 +8854,13 @@ static boolean P_MobjRegularThink(mobj_t *mobj) S_StopSoundByID(mobj, sfx_s3kd2l); } - if (mobj->threshold > 0) + if (mobj->threshold > 0) { - mobj->threshold -= 1; + mobj->threshold--; } if (mobj->extravalue1 > 0) { - mobj->extravalue1 -= 1; + mobj->extravalue1--; } break; case MT_SPBEXPLOSION: