|
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.
|
|
This article or section is outdated and has not been fully updated to reflect the current version of SRB2.
Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.
|
|
To do Rewrite description for 2.2.0
|
A_SharpSpin is an action which is used as the thinker for the Spincushion's spin attack. The actor will continuously spin anti-clockwise (requires the action to be called over multiple states for this to work), while chasing towards the target (Speed
sets the actor's speed). Each time this action is used, the actor's threshold is reduced by 1. When the actor's threshold reaches 0, or the actor doesn't have a target, the actor will go to its SpawnState
, setting it to use A_Look
(with Var1 = 1). ReactionTime
sets the actor's reaction time for when it goes back to SpawnState
. If the actor is dead, the actor goes to its DeathState
. Note that if you want to set an Object's threshold value, you will need a Lua script, since the threshold value cannot be modified via SOC.
Object property
|
Use
|
SpawnState |
Goes to this state when threshold = 0
|
DeathState |
Goes to this state if the actor is dead
|
ReactionTime |
Sets the actor's reaction time for when it goes back to SpawnState
|
Speed |
Speed
|
Code – A_SharpSpin
|
|
// Function: A_SharpSpin
//
// Description: Spin chase routine for Spincushions
//
// var1 = object # to spawn as dust (if not provided not done)
// var2 = if nonzero, do the old-style spinning using this as the angle difference
//
void A_SharpSpin(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 locvar2 = var2;
angle_t oldang = actor->angle;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_SharpSpin", actor))
return;
#endif
if (actor->threshold && actor->target)
{
angle_t ang = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y);
P_Thrust(actor, ang, actor->info->speed*actor->scale);
if (locvar2)
actor->angle += locvar2; // ANGLE_22h;
else
actor->angle = ang;
actor->threshold--;
if (leveltime & 1)
S_StartSound(actor, actor->info->painsound);
}
else
{
actor->reactiontime = actor->info->reactiontime;
P_SetMobjState(actor, actor->info->meleestate);
}
P_SharpDust(actor, locvar1, oldang);
}
|
|