|
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article.
|
A_FireShot is an action that makes the actor fire an Object at the target. Var1 determines the Object type the actor fires. Var2 determines the height offset the chosen Object is fired from, relative to a default offset of 48 fracunits above the bottom of the actor (negative values can be used). When the actor fires the chosen Object, the SeeSound
of the fired Object is played. In SRB2, this is used by the Robo-Hood to fire its arrows.
After firing, the actor's reaction time is set to a new value determined by the actor's ReactionTime
. Normally, the reaction time is set to a value of ReactionTime*TICRATE*2
(or 2×ReactionTime
seconds). In Ultimate mode, it is set to ReactionTime*TICRATE
(or ReactionTime
seconds) instead. However, if the actor has MF_BOSS
, the actor's reaction time will not be changed.
Object property
|
Use
|
SeeSound (of Object being shot) |
Played when fired
|
ReactionTime
|
New reaction time (ReactionTime*TICRATE*2 ; ReactionTime*TICRATE in Ultimate mode)
|
Code – A_FireShot
|
|
// Function: A_FireShot
//
// Description: Shoot an object at your target.
//
// var1 = object # to shoot
// var2 = height offset
//
void A_FireShot(mobj_t *actor)
{
fixed_t z;
INT32 locvar1 = var1;
INT32 locvar2 = var2;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_FireShot", actor))
return;
#endif
if (!actor->target)
return;
A_FaceTarget(actor);
if (actor->eflags & MFE_VERTICALFLIP)
z = actor->z + actor->height - FixedMul(48*FRACUNIT + locvar2*FRACUNIT, actor->scale);
else
z = actor->z + FixedMul(48*FRACUNIT + locvar2*FRACUNIT, actor->scale);
P_SpawnXYZMissile(actor, actor->target, locvar1, actor->x, actor->y, z);
if (!(actor->flags & MF_BOSS))
{
if (ultimatemode)
actor->reactiontime = actor->info->reactiontime*TICRATE;
else
actor->reactiontime = actor->info->reactiontime*TICRATE*2;
}
}
|
|