From dd50990e85199f80d93ed19d2b419d9b944096b3 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 3 May 2020 15:22:13 +0200 Subject: [PATCH] Add "trigger egg capsule" linedef executor --- extras/conf/SRB2-22.cfg | 8 ++++++++ src/p_spec.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index ea783908a..75563e505 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -2218,6 +2218,13 @@ linedeftypes prefix = "(462)"; flags8text = "[3] Set delay by backside sector"; } + + 464 + { + title = "Trigger Egg Capsule"; + prefix = "(464)"; + flags64text = "[6] Don't end level"; + } } linedefexecmisc @@ -3704,6 +3711,7 @@ thingtypes width = 8; height = 16; sprite = "internal:capsule"; + angletext = "Tag"; } 292 { diff --git a/src/p_spec.c b/src/p_spec.c index cebab0902..e7a600875 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4010,6 +4010,47 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } break; + case 464: // Trigger Egg Capsule + { + thinker_t *th; + mobj_t *mo2; + + // Find the center of the Eggtrap and release all the pretty animals! + // The chimps are my friends.. heeheeheheehehee..... - LouisJM + for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) + { + if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) + continue; + + mo2 = (mobj_t *)th; + + if (mo2->type != MT_EGGTRAP) + continue; + + if (!mo2->spawnpoint) + continue; + + if (mo2->spawnpoint->angle != line->tag) + continue; + + P_KillMobj(mo2, NULL, mo, 0); + } + + if (!(line->flags & ML_NOCLIMB)) + { + INT32 i; + + // Mark all players with the time to exit thingy! + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i]) + continue; + P_DoPlayerExit(&players[i]); + } + } + } + break; + #ifdef POLYOBJECTS case 480: // Polyobj_DoorSlide case 481: // Polyobj_DoorSwing