Class Attack Data


This class is designed to help collect and determine dmg, direction and magniture of an attack during the 2nd phase of the main combat loop

This class is designed to be reset, then filled one by one with the needed points of data. When filled, the data is 'rolled' into a weighted average which will then be used to determine hit info.

SPoint* c_AttkData::GetPlrArr()

Conditions and returns a visual of the player's hitbox for the c_Console

SPoint* c_AttkData::GetSPArr()

Converts the AttkVtx array into an SPoint array for use with collision detection.

void c_AttkData::SetConOrigin(SPoint p)

Sets the origin, used for weighting.

SPoint c_AttkData::GetConOrigin()

Returns an SPoint, indicating the origin

double c_AttkData::GetConInter()

Scaling for drawing to the console.

void c_AttkData::PlayerHitBoxInput(SPoint* s)

Inputs the player's hitbox for console rendering.

void c_AttkData::SetAVals(SPoint p)

Sets alternative direction values for weighting.

void c_AttkData::addVal(SPoint p, double m, double di, double diDist, double dm, double w)

Adds a value point to the data.


p : location of the vertex to add
m : magnitude (or how hard the victim should fly)
di : direction the victim will move in
diDist : distance from the last input point. This is used to weight the average based on the perimiter. Since this is a convex polygon, a perimeter can be used to determine hit data since it directly relates to area.
double dm : damage to deal to the victim
double w : weight of this vertex. Weight determines direction; a weight of 1 will use vertex defined directions, a weight of 0 will simply obtain direction from the defined 'centre' of an attack. A value between these 2 will simply use a weighted average.

void c_AttkData::rollIntoAvg()

must be called to condition data collected with addVal() before it can be used

string c_AttkData::ResultString()

Returns a string to post to the text console.