mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 10:52:23 +00:00
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.
This commit is contained in:
parent
c8d145e474
commit
3021116797
5 changed files with 55 additions and 28 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue