diff --git a/src/info.c b/src/info.c index ff15d0c2..10200f28 100644 --- a/src/info.c +++ b/src/info.c @@ -3085,7 +3085,7 @@ state_t states[NUMSTATES] = {SPR_MARR, 0, 1, {A_MayonakaArrow}, 0, 0, S_MAYONAKAARROW}, //S_MAYONAKAARROW //Mementos stuff - {SPR_NULL, 0, TICRATE*130, {NULL}, 0, 0, S_REAPER}, //S_REAPER_INVIS + {SPR_NULL, 0, TICRATE*20, {NULL}, 0, 0, S_REAPER}, //S_REAPER_INVIS TODO: DON'T FORGET TO CHANGE THAT BACK TO 130*TICRATE WHEN TESTING IS OVER {SPR_REAP, 0, 1, {A_ReaperThinker}, 0, 0, S_REAPER}, //S_REAPER {SPR_NULL, 0, 1, {A_MementosTPParticles}, 0, 0, S_MEMENTOSTP}, //S_MEMENTOSTP diff --git a/src/p_enemy.c b/src/p_enemy.c index 4a89423c..b756a4ee 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8438,7 +8438,7 @@ void A_RandomShadowFrame(mobj_t *actor) #endif if (!actor->extravalue1) // Hack that spawns thoks that look like random shadows. Otherwise the state would overwrite our frame and that's a pain. - { + { fake = P_SpawnMobj(actor->x, actor->y, actor->z, MT_THOK); fake->sprite = SPR_ENM1; fake->frame = P_RandomRange(0, 6); @@ -8450,9 +8450,9 @@ void A_RandomShadowFrame(mobj_t *actor) actor->flags2 |= MF2_DONTDRAW; actor->extravalue1 = 1; } - + P_SetScale(actor, FRACUNIT*3/2); - + // I have NO CLUE how to hardcode all of that fancy Linedef Executor shit so the fire spinout will be done by these entities directly. if (P_LookForPlayers(actor, false, false, 512<extravalue2) { @@ -8499,7 +8499,7 @@ void A_RoamingShadowThinker(mobj_t *actor) actor->extravalue2 = 60; } // Search for and attack Players venturing too close in front of us. - + if (P_LookForPlayers(actor, false, false, 256<target && !actor->target->player->powers[pw_flashing] @@ -8545,7 +8545,7 @@ void A_MayonakaArrow(mobj_t *actor) // "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. - + actor->frame = flip; if (actor->extravalue1 >= TICRATE*7/2) actor->extravalue1 = 0; // reset to 0 and start a new cycle. @@ -8553,10 +8553,10 @@ void A_MayonakaArrow(mobj_t *actor) actor->frame = flip+2; else if (actor->extravalue1 > TICRATE*3 && leveltime%2 > 0) actor->frame = flip+1; - + actor->frame |= FF_PAPERSPRITE; actor->momz = 0; - return; + return; } // A_MementosTPParticles @@ -8568,21 +8568,21 @@ void A_MementosTPParticles(mobj_t *actor) mobj_t *mo2; int i = 0; thinker_t *th; - + #ifdef HAVE_BLUA if (LUA_CallAction("A_MementosTPParticles", (actor))) return; #endif for (; i<4; i++) - { + { particle = P_SpawnMobj(actor->x + (P_RandomRange(-256, 256)<y + (P_RandomRange(-256, 256)<z + (P_RandomRange(48, 256)<frame = 0; particle->color = ((i%2) ? (SKINCOLOR_RED) : (SKINCOLOR_BLACK)); particle->destscale = 1; P_HomingAttack(particle, actor); } - + // Although this is mostly used to spawn particles, we will also save the OTHER teleport inside actor->target. That way teleporting doesn't require a thinker iteration. // Doesn't seem like much given the small amount of mobjs this map has but heh. if (!actor->target) @@ -8610,75 +8610,80 @@ void A_ReaperThinker(mobj_t *actor) mobj_t *particle; // particles to spawn int i = 0; // for loops angle_t an = ANGLE_22h; // Reminder that angle constants suck. - + //Waypoint stuff: mobj_t *mo2; thinker_t *th; - + //Player targetting stuff: INT32 maxscore = 0; // we target the player with the highest score so yeah there you go. player_t *player; // used as a shortcut in a loop. mobj_t *targetplayermo; // the player mo we can eventually target, or whatever. - - + + #ifdef HAVE_BLUA if (LUA_CallAction("A_ReaperThinker", (actor))) return; #endif - + // We don't have custom variables or whatever so we'll do with whatever the fuck we have left. - + if (actor->health == 1000) // if health is 1000, set it to a small scale and have it start growing with destscale. Then set the health to uh, not 1000. - { + { actor->scale = 1; actor->destscale = 2<scalespeed = FRACUNIT/24; // Should take a bit less than 2 seconds to fully grow. S_StartSound(NULL, sfx_chain); actor->health--; // now we have 999 health, so that above won't happen again. Awesome. } - + if (actor->scale < 2<x + (P_RandomRange(-60, 60)<y + (P_RandomRange(-60, 60)<z, MT_THOK); particle->momz = 20<color = ((i%2 !=0) ? (SKINCOLOR_RED) : (SKINCOLOR_BLACK)); particle->frame = 0; P_SetScale(particle, FRACUNIT/2); } - + // Spawn particles in some edgy circle or w/e. - + if (leveltime%5 != 0) // spawn the thing under that every tic. return; - + i=0; for (; i<15; i++) // spawn in a circle formation or w/e. - { + { particle = P_SpawnMobj(actor->x, actor->y, actor->z, MT_THOK); particle->momz = 20<color = ((i%2 !=0) ? (SKINCOLOR_RED) : (SKINCOLOR_BLACK)); particle->frame = 0; P_SetScale(particle, FRACUNIT/2); - P_InstaThrust(particle, an*i, 30<flags = MF_NOGRAVITY|MF_PAIN|MF_SPECIAL|MF_NOCLIP|MF_NOCLIPHEIGHT; // set our flags to be a damaging thing. - + // Handle animation: + if (!(leveltime%5)) + actor->extravalue2 = (actor->extravalue2 < 9) ? (actor->extravalue2+1) : (0); // Ghetto animation, but hey it works for what it's worth + + actor->frame = actor->extravalue2; // yes i'm that bad at maths don't @ me. + if (!actor->target) { if (actor->hnext) - { + { P_SetTarget(&actor->target, actor->hnext); // Default back to last waypoint. return; - } - + } + // We have no target and oughta find one, so let's scan through thinkers for a waypoint of angle 0, or something. for (th = thinkercap.next; th != &thinkercap; th = th->next) { @@ -8701,28 +8706,28 @@ void A_ReaperThinker(mobj_t *actor) break; } } - } + } else // Awesome, we now have a target. - { + { // Follow target: P_InstaThrust(actor, R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y), 20<angle = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y); - + // The player we should target if it's near us: for (i=0; ilastlook]; if (player && player->mo && player->kartstuff[k_bumper] && player->score >= maxscore) - { + { targetplayermo = player->mo; maxscore = player->score; } } - + // Try to target that player: if (targetplayermo) { @@ -8734,17 +8739,17 @@ void A_ReaperThinker(mobj_t *actor) && !actor->target->player->kartstuff[k_spinouttimer])) P_SetTarget(&actor->target, actor->hnext); // if the above isn't correct, then we should go back to targetting waypoints or something. - } + } } - + // Waypoint behavior. if (actor->target->type == MT_REAPERWAYPOINT) - { - + { + if (R_PointToDist2(actor->x, actor->y, actor->target->x, actor->target->y) < 22<target, NULL); // remove target so we can default back to first waypoint if things go ham. - + // If we reach close to a waypoint, then we should go to the NEXT one. for (th = thinkercap.next; th != &thinkercap; th = th->next) { @@ -8757,15 +8762,15 @@ void A_ReaperThinker(mobj_t *actor) continue; if (mo2->spawnpoint->angle != actor->extravalue1+1) continue; - + P_SetTarget(&actor->target, mo2); // The main target we're pursing. P_SetTarget(&actor->hnext, mo2); // The last waypoint we hit. We will default back to that if a player goes out of our range! actor->extravalue1++; // This will store the angle of the last waypoint we touched. This will essentially be useful later on. break; } } - - + + if (!actor->target) // If we have no target, revert back to waypoint 0. { actor->extravalue1 = 0;