From a24507b2eb83581124e3e53ec67b60d59144b9fb Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Thu, 25 Oct 2018 00:58:59 +0200 Subject: [PATCH] Midnight Channel: warning sign hardcode --- src/p_enemy.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index d77fdd4a..38e1e797 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8538,17 +8538,29 @@ void A_RoamingShadowThinker(mobj_t *actor) void A_MayonakaArrow(mobj_t *actor) { INT32 flip = 0; + INT32 iswarning; #ifdef HAVE_BLUA if (LUA_CallAction("A_MayonakaArrow", (actor))) return; -#endif - // "animtimer" is replaced by "extravalue1" here. - actor->extravalue1 = ((actor->extravalue1) ? (actor->extravalue1+1) : (P_RandomRange(0, TICRATE*3))); - flip = ((actor->spawnpoint->options & 1) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign. +#endif - actor->frame = flip; + iswarning = actor->spawnpoint->options & MTF_OBJECTSPECIAL; // is our object a warning sign? + // "animtimer" is replaced by "extravalue1" here. + actor->extravalue1 = ((actor->extravalue1) ? (actor->extravalue1+1) : (P_RandomRange(0, (iswarning) ? (TICRATE/2) : TICRATE*3))); + flip = ((actor->spawnpoint->options & 1) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign. + // special warning behavior: + if (iswarning) + flip = 6; + + actor->frame = flip + actor->extravalue2*3; + if (actor->extravalue1 >= TICRATE*7/2) + { actor->extravalue1 = 0; // reset to 0 and start a new cycle. + // special behavior for warning sign; swap from warning to sneaker & reverse + if (iswarning) + actor->extravalue2 = (actor->extravalue2) ? (0) : (1); + } else if (actor->extravalue1 > TICRATE*7/2 -4) actor->frame = flip+2; else if (actor->extravalue1 > TICRATE*3 && leveltime%2 > 0)