I want to check if an enemy is flanked when it's hit or not and take into account combatmovement. GetFlankingBonus could possibly be used for this i suppose but does it return zero when the player doesn't flank an enemy or something else?
how to use Combat_GetFlankingBonus.
Débuté par
gordonbrown82
, juin 20 2010 09:32
#1
Posté 20 juin 2010 - 09:32
#2
Posté 21 juin 2010 - 01:43
If it can help you :
int AT_IsAtFlank(object oTarget)
{
float fAngle = GetAngleBetweenObjects(oTarget, OBJECT_SELF);
float fFlankingAngle = GetCreatureProperty(OBJECT_SELF, PROPERTY_ATTRIBUTE_FLANKING_ANGLE);
/* It is a bioware's patch. */
if (fFlankingAngle <= 10.0f)
fFlankingAngle = 60.0f;
else if (fFlankingAngle > 180.0f)
fFlankingAngle = 180.0f;
if ((fAngle >= (180.0f - fFlankingAngle))
&& (fAngle <= (180.0f + fFlankingAngle)))
return TRUE;
return FALSE;
}
int AT_IsAtFlank(object oTarget)
{
float fAngle = GetAngleBetweenObjects(oTarget, OBJECT_SELF);
float fFlankingAngle = GetCreatureProperty(OBJECT_SELF, PROPERTY_ATTRIBUTE_FLANKING_ANGLE);
/* It is a bioware's patch. */
if (fFlankingAngle <= 10.0f)
fFlankingAngle = 60.0f;
else if (fFlankingAngle > 180.0f)
fFlankingAngle = 180.0f;
if ((fAngle >= (180.0f - fFlankingAngle))
&& (fAngle <= (180.0f + fFlankingAngle)))
return TRUE;
return FALSE;
}
#3
Posté 21 juin 2010 - 07:22
does that code take into account combat movement?
#4
Posté 23 juin 2010 - 04:25
What do you mean ?
Being at flank or not is a state so I don't understand what you mean by "take into account combat movement"
Being at flank or not is a state so I don't understand what you mean by "take into account combat movement"
#5
Posté 23 juin 2010 - 04:47
well i just wanted to make sure that if the player has combat movement and gets an inreased flanking area because of that, the code in your first posts signals that the player is flanking. does the function you've written return 0 if the player is not flanking?
#6
Posté 23 juin 2010 - 05:07
gordonbrown82 wrote...
does the function you've written return 0 if the player is not flanking?
Yes, it does. It returns TRUE if the target object is at flank and FALSE if it isn't
Modifié par _L_o_B_o_, 23 juin 2010 - 05:07 .





Retour en haut






