mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
* Minor changes to make A_CrushclawAim more useful.
* Some fun with the chain. https://cdn.discordapp.com/attachments/402861856219463681/445539938633515018/srb20022.gif * More corrections to closed captions.
This commit is contained in:
parent
26d13db548
commit
3c50acd1bf
4 changed files with 39 additions and 29 deletions
|
@ -913,7 +913,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_CRAB, 0, 40, {NULL}, 0, 0, S_CRUSHSTACEAN_ROAM1}, // S_CRUSHSTACEAN_ROAMPAUSE
|
||||
{SPR_CRAB, 0, 10, {NULL}, 0, 0, S_CRUSHSTACEAN_PUNCH2}, // S_CRUSHSTACEAN_PUNCH1
|
||||
{SPR_CRAB, 0, -1, {A_CrushstaceanPunch}, 0, 0, S_CRUSHSTACEAN_ROAMPAUSE}, // S_CRUSHSTACEAN_PUNCH2
|
||||
{SPR_CRAB, 3, 1, {A_CrushclawAim}, 0, 0, S_CRUSHCLAW_AIM}, // S_CRUSHCLAW_AIM
|
||||
{SPR_CRAB, 3, 1, {A_CrushclawAim}, 40, 20, S_CRUSHCLAW_AIM}, // S_CRUSHCLAW_AIM
|
||||
{SPR_CRAB, 3, 1, {A_CrushclawLaunch}, 0, S_CRUSHCLAW_STAY, S_CRUSHCLAW_OUT}, // S_CRUSHCLAW_OUT
|
||||
{SPR_CRAB, 3, 10, {NULL}, 0, 0, S_CRUSHCLAW_IN}, // S_CRUSHCLAW_STAY
|
||||
{SPR_CRAB, 3, 1, {A_CrushclawLaunch}, 1, S_CRUSHCLAW_WAIT, S_CRUSHCLAW_IN}, // S_CRUSHCLAW_IN
|
||||
|
@ -4018,7 +4018,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
0, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
@ -1685,13 +1685,13 @@ void A_CrushstaceanPunch(mobj_t *actor)
|
|||
//
|
||||
// Description: Crushstacean claw aiming
|
||||
//
|
||||
// var1 = unused
|
||||
// var2 = unused
|
||||
// var1 = sideways offset
|
||||
// var2 = vertical offset
|
||||
//
|
||||
void A_CrushclawAim(mobj_t *actor)
|
||||
{
|
||||
//INT32 locvar1 = var1;
|
||||
//INT32 locvar2 = var2;
|
||||
INT32 locvar1 = var1;
|
||||
INT32 locvar2 = var2;
|
||||
mobj_t *crab = actor->tracer;
|
||||
angle_t ang;
|
||||
#ifdef HAVE_BLUA
|
||||
|
@ -1731,11 +1731,11 @@ void A_CrushclawAim(mobj_t *actor)
|
|||
#undef angfactor
|
||||
|
||||
P_TeleportMove(actor,
|
||||
crab->x + P_ReturnThrustX(actor, actor->angle, 40*crab->scale),
|
||||
crab->y + P_ReturnThrustY(actor, actor->angle, 40*crab->scale),
|
||||
crab->z + 20*crab->scale);
|
||||
crab->x + P_ReturnThrustX(actor, actor->angle, locvar1*crab->scale),
|
||||
crab->y + P_ReturnThrustY(actor, actor->angle, locvar1*crab->scale),
|
||||
crab->z + locvar2*crab->scale);
|
||||
|
||||
if (!crab->target || (statenum_t)(crab->state-states) == crab->info->missilestate)
|
||||
if (!crab->target || !crab->info->missilestate || (statenum_t)(crab->state-states) == crab->info->missilestate)
|
||||
return;
|
||||
|
||||
if (((ang + ANG1) < ANG2) || P_AproxDistance(crab->x - crab->target->x, crab->y - crab->target->y) < 333*crab->scale)
|
||||
|
@ -1855,6 +1855,8 @@ void A_CrushclawLaunch(mobj_t *actor)
|
|||
actor->extravalue1 = 0;
|
||||
P_SetMobjState(actor, locvar2);
|
||||
S_StopSound(actor);
|
||||
if (!locvar1)
|
||||
S_StartSound(actor, sfx_s3k64);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1868,6 +1870,7 @@ void A_CrushclawLaunch(mobj_t *actor)
|
|||
while (chain)
|
||||
{
|
||||
P_TeleportMove(chain, actor->target->x + idx, actor->target->y + idy, actor->target->z + idz);
|
||||
chain->watertop = chain->z;
|
||||
idx += dx;
|
||||
idy += dy;
|
||||
idz += dz;
|
||||
|
|
23
src/p_mobj.c
23
src/p_mobj.c
|
@ -7443,6 +7443,19 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
if (mobj->target && mobj->state-states >= S_SPINCUSHION_AIM1 && mobj->state-states <= S_SPINCUSHION_AIM5)
|
||||
mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->target->x, mobj->target->y);
|
||||
break;
|
||||
case MT_CRUSHCLAW:
|
||||
if (mobj->state-states == S_CRUSHCLAW_STAY && mobj->target)
|
||||
{
|
||||
mobj_t *chain = mobj->target->target;
|
||||
SINT8 sign = ((mobj->tics & 1) ? mobj->tics : -(SINT8)(mobj->tics));
|
||||
while (chain)
|
||||
{
|
||||
chain->z = chain->watertop + sign*mobj->scale;
|
||||
sign = -sign;
|
||||
chain = chain->target;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MT_SMASHINGSPIKEBALL:
|
||||
mobj->momx = mobj->momy = 0;
|
||||
if (mobj->state-states == S_SMASHSPIKE_FALL && P_IsObjectOnGround(mobj))
|
||||
|
@ -8551,14 +8564,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
break;
|
||||
case MT_CRUSHSTACEAN:
|
||||
{
|
||||
mobj_t *bigmeatyclaw;
|
||||
angle_t ang = mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270);
|
||||
bigmeatyclaw = P_SpawnMobjFromMobj(mobj,
|
||||
P_ReturnThrustX(mobj, ang, 40<<FRACBITS),
|
||||
P_ReturnThrustY(mobj, ang, 40<<FRACBITS),
|
||||
20*FRACUNIT,
|
||||
MT_CRUSHCLAW);
|
||||
bigmeatyclaw->angle = ang;
|
||||
mobj_t *bigmeatyclaw = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_CRUSHCLAW);
|
||||
bigmeatyclaw->angle = mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270);;
|
||||
P_SetTarget(&mobj->tracer, bigmeatyclaw);
|
||||
P_SetTarget(&bigmeatyclaw->tracer, mobj);
|
||||
mobj->reactiontime >>= 1;
|
||||
|
|
|
@ -306,7 +306,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Transformation"},
|
||||
{"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Rising dust"},
|
||||
{"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pulse"},
|
||||
{"s3k49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling rock"},
|
||||
{"s3k49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Impact"},
|
||||
{"s3k4a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Grab"},
|
||||
{"s3k4b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Water splash"},
|
||||
{"s3k4c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Heavy hit"},
|
||||
|
|
Loading…
Reference in a new issue