mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
Hardcoded A_Boss5PinchShot
This commit is contained in:
parent
6cd2b73273
commit
b4d8c2fa29
3 changed files with 39 additions and 0 deletions
|
@ -2231,6 +2231,7 @@ static actionpointer_t actionpointers[] =
|
|||
{{A_Boss5Calm}, "A_BOSS5CALM"},
|
||||
{{A_Boss5CheckOnGround}, "A_BOSS5CHECKONGROUND"},
|
||||
{{A_Boss5CheckFalling}, "A_BOSS5CHECKFALLING"},
|
||||
{{A_Boss5PinchShot}, "A_BOSS5PINCHSHOT"},
|
||||
{{A_LookForBetter}, "A_LOOKFORBETTER"},
|
||||
|
||||
{{NULL}, "NONE"},
|
||||
|
|
|
@ -245,6 +245,7 @@ void A_Boss5ExtraRepeat();
|
|||
void A_Boss5Calm();
|
||||
void A_Boss5CheckOnGround();
|
||||
void A_Boss5CheckFalling();
|
||||
void A_Boss5PinchShot();
|
||||
void A_LookForBetter();
|
||||
|
||||
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
|
||||
|
|
|
@ -272,6 +272,7 @@ void A_Boss5ExtraRepeat(mobj_t *actor);
|
|||
void A_Boss5Calm(mobj_t *actor);
|
||||
void A_Boss5CheckOnGround(mobj_t *actor);
|
||||
void A_Boss5CheckFalling(mobj_t *actor);
|
||||
void A_Boss5PinchShot(mobj_t *actor);
|
||||
void A_LookForBetter(mobj_t *actor);
|
||||
//for p_enemy.c
|
||||
|
||||
|
@ -12052,6 +12053,42 @@ void A_Boss5CheckFalling(mobj_t *actor)
|
|||
P_SetMobjState(actor, locvar2);
|
||||
}
|
||||
|
||||
// Function: A_Boss5PinchShot
|
||||
//
|
||||
// Description: Fires a missile directly upwards if in pinch.
|
||||
//
|
||||
// var1 = object # to shoot
|
||||
// var2 = height offset (from default of +48 FU)
|
||||
//
|
||||
void A_Boss5PinchShot(mobj_t *actor)
|
||||
{
|
||||
INT32 locvar1 = var1;
|
||||
INT32 locvar2 = var2;
|
||||
fixed_t zoffset;
|
||||
mobj_t *missile;
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_CallAction("A_Boss5PinchShot", actor))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (actor->health > actor->info->damage)
|
||||
return;
|
||||
|
||||
if (actor->eflags & MFE_VERTICALFLIP)
|
||||
zoffset = actor->z + actor->height - FixedMul((48 + locvar2)*FRACUNIT, actor->scale);
|
||||
else
|
||||
zoffset = actor->z + FixedMul((48 + locvar2)*FRACUNIT, actor->scale);
|
||||
|
||||
missile = P_SpawnPointMissile(actor, actor->x, actor->y, zoffset, locvar1,
|
||||
actor->x, actor->y, zoffset);
|
||||
|
||||
if (!missile)
|
||||
return;
|
||||
|
||||
missile->momx = missile->momy = 0;
|
||||
missile->momz = P_MobjFlip(actor)*missile->info->speed/2;
|
||||
}
|
||||
|
||||
// Function: A_LookForBetter
|
||||
//
|
||||
// Description: A_Look, except it finds a better target in multiplayer, and doesn't lose the target in singleplayer.
|
||||
|
|
Loading…
Reference in a new issue