From 81882b63b89fb978b663fca8c8a9c4ccdf1d0c4c Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 22 Jun 2019 17:03:10 +0100 Subject: [PATCH 1/3] As I wanted MI to do but he was too exhausted at the time from hardcoding, make the Fang bullet knockback less hardcoded and instead give it MF2_SUPERFIRE. # Conflicts: # src/p_mobj.c --- src/p_inter.c | 8 ++------ src/p_mobj.c | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 0fab3353c..3dfdb7587 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3464,14 +3464,10 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return true; } } - else if (player->powers[pw_invulnerability] || player->powers[pw_flashing] // ignore bouncing & such in invulnerability - || player->powers[pw_super]) + else if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super]) // ignore bouncing & such in invulnerability { if (force - || (player->powers[pw_super] - && inflictor && inflictor->flags & MF_MISSILE && inflictor->flags2 & MF2_SUPERFIRE) // Super Sonic is stunned! - || (player->powers[pw_flashing] - && source && source->type == MT_FANG && inflictor && inflictor->type == MT_CORK)) // Fang's cork bullets knock you back even when flashing + || (inflictor && inflictor->flags & MF_MISSILE && inflictor->flags2 & MF2_SUPERFIRE)) // Super Sonic is stunned! { #ifdef HAVE_BLUA if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 38bc7ed96..fc6f5cede 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9329,6 +9329,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) if (nummaprings >= 0) nummaprings++; break; + case MT_CORK: + mobj->flags2 |= MF2_SUPERFIRE; + break; case MT_FBOMB: mobj->flags2 |= MF2_EXPLOSION; break; From c8d145e4748b012ae6699db7935d15715c48ebe1 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 19 Jun 2019 23:35:18 +0100 Subject: [PATCH 2/3] Tweak Boss5MakeItRain's bomb launch angles to properly smash the ceiling in the new arena. --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 4123d316c..486808226 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -12716,7 +12716,7 @@ void A_Boss5MakeItRain(mobj_t *actor) actor->angle += ANGLE_45; var1 = locvar1; - var2 = offset + (i & 1) ? 55 : 70; + var2 = offset + (i & 1) ? 80 : 85; A_TrapShot(actor); } From 3021116797d5f0236f7fdb93aa8746e568bde71b Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 20 Jun 2019 00:24:13 +0100 Subject: [PATCH 3/3] Some preliminary work to make multiple bosses in the same map work nicely together, by allowing parameter to alter the linedef executor tag to call in increments of 100. Also: Making sure every single reserved tag is recorded as an LE_ constant. --- src/dehacked.c | 8 ++++++++ src/doomdef.h | 18 +++++++++++++----- src/info.c | 4 ++-- src/p_enemy.c | 40 +++++++++++++++++++++++++--------------- src/p_inter.c | 13 +++++++------ 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index f70615af6..bc5208469 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8381,6 +8381,14 @@ struct { {"LE_BOSSDEAD",LE_BOSSDEAD}, // A boss in the map died (Chaos mode boss tally) {"LE_BOSS4DROP",LE_BOSS4DROP}, // CEZ boss dropped its cage {"LE_BRAKVILEATACK",LE_BRAKVILEATACK}, // Brak's doing his LOS attack, oh noes + {"LE_TURRET",LE_TURRET}, // THZ turret + {"LE_BRAKPLATFORM",LE_BRAKPLATFORM}, // v2.0 Black Eggman destroys platform + {"LE_CAPSULE2",LE_CAPSULE2}, // Egg Capsule + {"LE_CAPSULE1",LE_CAPSULE1}, // Egg Capsule + {"LE_CAPSULE0",LE_CAPSULE0}, // Egg Capsule + {"LE_KOOPA",LE_KOOPA}, // Distant cousin to Gay Bowser + {"LE_AXE",LE_AXE}, // MKB Axe object + {"LE_PARAMWIDTH",LE_PARAMWIDTH}, // If an object that calls LinedefExecute has a nonzero parameter value, this times the parameter will be subtracted. (Mostly for the purpose of coexisting bosses...) /// \todo Get all this stuff into its own sections, maybe. Maybe. diff --git a/src/doomdef.h b/src/doomdef.h index 512c90f86..475328918 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -381,11 +381,19 @@ typedef enum // Special linedef executor tag numbers! enum { - LE_PINCHPHASE = -2, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!) - LE_ALLBOSSESDEAD = -3, // All bosses in the map are dead (Egg capsule raise) - LE_BOSSDEAD = -4, // A boss in the map died (Chaos mode boss tally) - LE_BOSS4DROP = -5, // CEZ boss dropped its cage - LE_BRAKVILEATACK = -6 // Brak's doing his LOS attack, oh noes + LE_PINCHPHASE = -2, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!) + LE_ALLBOSSESDEAD = -3, // All bosses in the map are dead (Egg capsule raise) + LE_BOSSDEAD = -4, // A boss in the map died (Chaos mode boss tally) + LE_BOSS4DROP = -5, // CEZ boss dropped its cage + LE_BRAKVILEATACK = -6, // Brak's doing his LOS attack, oh noes + LE_TURRET = 32000, // THZ turret + LE_BRAKPLATFORM = 4200, // v2.0 Black Eggman destroys platform + LE_CAPSULE2 = 682, // Egg Capsule + LE_CAPSULE1 = 681, // Egg Capsule + LE_CAPSULE0 = 680, // Egg Capsule + LE_KOOPA = 650, // Distant cousin to Gay Bowser + LE_AXE = 649, // MKB Axe object + LE_PARAMWIDTH = -100 // If an object that calls LinedefExecute has a nonzero parameter value, this times the parameter will be subtracted. (Mostly for the purpose of coexisting bosses...) }; // Name of local directory for config files and savegames diff --git a/src/info.c b/src/info.c index a585da74e..8646a2ef1 100644 --- a/src/info.c +++ b/src/info.c @@ -916,7 +916,7 @@ state_t states[NUMSTATES] = {SPR_TRET, FF_FULLBRIGHT|2, 7, {A_Pain}, 0, 0, S_TURRETSHOCK7}, // S_TURRETSHOCK6 {SPR_TRET, FF_FULLBRIGHT|3, 7, {NULL}, 0, 0, S_TURRETSHOCK8}, // S_TURRETSHOCK7 {SPR_TRET, FF_FULLBRIGHT|4, 7, {NULL}, 0, 0, S_TURRETSHOCK9}, // S_TURRETSHOCK8 - {SPR_TRET, FF_FULLBRIGHT|4, 7, {A_LinedefExecute}, 32000, 0, S_XPLD1}, // S_TURRETSHOCK9 + {SPR_TRET, FF_FULLBRIGHT|4, 7, {A_LinedefExecute}, LE_TURRET, 0, S_XPLD1}, // S_TURRETSHOCK9 {SPR_TURR, 0, 1, {A_Look}, 1, 0, S_TURRETPOPDOWN8}, // S_TURRETLOOK {SPR_TURR, 0, 0, {A_FaceTarget}, 0, 0, S_TURRETPOPUP1}, // S_TURRETSEE @@ -1561,7 +1561,7 @@ state_t states[NUMSTATES] = {SPR_BRAK, 21, 3*TICRATE, {NULL}, 0, 0, S_BLACKEGG_DESTROYPLAT2}, // S_BLACKEGG_DESTROYPLAT1 {SPR_BRAK, 21, 1, {A_PlaySound}, sfx_s3k54, 0, S_BLACKEGG_DESTROYPLAT3}, // S_BLACKEGG_DESTROYPLAT2 - {SPR_BRAK, 21, 14, {A_LinedefExecute}, 4200, 0, S_BLACKEGG_STND}, // S_BLACKEGG_DESTROYPLAT3 + {SPR_BRAK, 21, 14, {A_LinedefExecute}, LE_BRAKPLATFORM, 0, S_BLACKEGG_STND}, // S_BLACKEGG_DESTROYPLAT3 {SPR_NULL, 0, 1, {A_CapeChase}, (160 - 20) << 16, 0, S_BLACKEGG_HELPER}, // S_BLACKEGG_HELPER diff --git a/src/p_enemy.c b/src/p_enemy.c index 486808226..3419d6135 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3740,7 +3740,10 @@ void A_BossDeath(mobj_t *mo) return; #endif - P_LinedefExecute(LE_BOSSDEAD, mo, NULL); + if (mo->spawnpoint && mo->spawnpoint->extrainfo) + P_LinedefExecute(LE_BOSSDEAD+(mo->spawnpoint->extrainfo*LE_PARAMWIDTH), mo, NULL); + else + P_LinedefExecute(LE_BOSSDEAD, mo, NULL); mo->health = 0; // Boss is dead (but not necessarily fleeing...) @@ -3778,11 +3781,11 @@ void A_BossDeath(mobj_t *mo) else { // Bring the egg trap up to the surface - junk.tag = 680; + junk.tag = LE_CAPSULE0; EV_DoElevator(&junk, elevateHighest, false); - junk.tag = 681; + junk.tag = LE_CAPSULE1; EV_DoElevator(&junk, elevateUp, false); - junk.tag = 682; + junk.tag = LE_CAPSULE2; EV_DoElevator(&junk, elevateHighest, false); } @@ -3806,7 +3809,7 @@ bossjustdie: } case MT_KOOPA: { - junk.tag = 650; + junk.tag = LE_KOOPA; EV_DoCeiling(&junk, raiseToHighest); return; } @@ -3866,15 +3869,17 @@ bossjustdie: mo2 = (mobj_t *)th; - if (mo2->type == MT_BOSSFLYPOINT) - { - // If this one's closer then the last one, go for it. - if (!mo->target || - P_AproxDistance(P_AproxDistance(mo->x - mo2->x, mo->y - mo2->y), mo->z - mo2->z) < - P_AproxDistance(P_AproxDistance(mo->x - mo->target->x, mo->y - mo->target->y), mo->z - mo->target->z)) - P_SetTarget(&mo->target, mo2); - // Otherwise... Don't! - } + if (mo2->type != MT_BOSSFLYPOINT) + continue; + + // If this one's further then the last one, don't go for it. + if (mo->target && + P_AproxDistance(P_AproxDistance(mo->x - mo2->x, mo->y - mo2->y), mo->z - mo2->z) > + P_AproxDistance(P_AproxDistance(mo->x - mo->target->x, mo->y - mo->target->y), mo->z - mo->target->z)) + continue; + + // Otherwise... Do! + P_SetTarget(&mo->target, mo2); } mo->flags |= MF_NOGRAVITY|MF_NOCLIP; @@ -6692,7 +6697,10 @@ void A_Boss1Chase(mobj_t *actor) } else { - P_LinedefExecute(LE_PINCHPHASE, actor, NULL); + if (actor->spawnpoint && actor->spawnpoint->extrainfo) + P_LinedefExecute(LE_PINCHPHASE+(actor->spawnpoint->extrainfo*LE_PARAMWIDTH), actor, NULL); + else + P_LinedefExecute(LE_PINCHPHASE, actor, NULL); P_SetMobjState(actor, actor->info->raisestate); } @@ -7897,6 +7905,8 @@ void A_LinedefExecute(mobj_t *actor) if (locvar2) tagnum += locvar2*(AngleFixed(actor->angle)>>FRACBITS); + else if (actor->spawnpoint && actor->spawnpoint->extrainfo) + tagnum += (actor->spawnpoint->extrainfo*LE_PARAMWIDTH); CONS_Debug(DBG_GAMELOGIC, "A_LinedefExecute: Running mobjtype %d's sector with tag %d\n", actor->type, tagnum); diff --git a/src/p_inter.c b/src/p_inter.c index 3dfdb7587..163d47eab 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1359,7 +1359,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (player->bot) return; - junk.tag = 649; + junk.tag = LE_AXE; EV_DoElevator(&junk, bridgeFall, false); // scan the remaining thinkers to find koopa @@ -1369,11 +1369,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) continue; mo2 = (mobj_t *)th; - if (mo2->type == MT_KOOPA) - { - mo2->momz = 5*FRACUNIT; - break; - } + + if (mo2->type != MT_KOOPA) + continue; + + mo2->momz = 5*FRACUNIT; + break; } } break;