Blaze Brigade
Static Public Member Functions | List of all members
Model.DamageCalculations Class Reference

This class calculates all damage related calculations More...

Static Public Member Functions

static int getDamageDealt (Unit attacker, Unit defender, bool physOrMagic)
 
static int getHitRate (Unit attacker, Unit defender)
 
static int getCritRate (Unit attacker, Unit defender)
 
static int getHitCount (Unit attacker, Unit defender)
 
static int finalDamage (Unit attacker, Unit defender, bool physOrMagic)
 

Detailed Description

This class calculates all damage related calculations

Member Function Documentation

§ finalDamage()

static int Model.DamageCalculations.finalDamage ( Unit  attacker,
Unit  defender,
bool  physOrMagic 
)
static

factors in damage dealt, hit rate, crit rate, and number of attacks (as in how above functions were calculated) to calculate actual damage dealt

Parameters
attackerThe unit performing the attack
defenderThe unit defending against the attack
physOrMagicBoolean that tells the controller if it's physical or magical damage to be calculated

§ getCritRate()

static int Model.DamageCalculations.getCritRate ( Unit  attacker,
Unit  defender 
)
static

passes in the 2 units, and returns the crit rate as a percentage out of 100 by taking into account both unit's skill

Parameters
attackerThe unit performing the attack
defenderThe unit defending against the attack

§ getDamageDealt()

static int Model.DamageCalculations.getDamageDealt ( Unit  attacker,
Unit  defender,
bool  physOrMagic 
)
static

passes in the 2 units, and a boolean on whether attack is physical (false), or magical (true), and returns damage dealt by taking into account an attacker's str/int, and defender def/res

Parameters
attackerThe unit performing the attack
defenderThe unit defending against the attack
physOrMagicBoolean that tells the controller if it's physical or magical damage to be calculated

§ getHitCount()

static int Model.DamageCalculations.getHitCount ( Unit  attacker,
Unit  defender 
)
static

passes in then 2 units, and determines how many attacks the attacker makes by factoring in both unit's relative speed

Parameters
attackerThe unit performing the attack
defenderThe unit defending against the attack

§ getHitRate()

static int Model.DamageCalculations.getHitRate ( Unit  attacker,
Unit  defender 
)
static

passes in the 2 units, and returns the hit rate as a percentage out of 100 by taking into account both unit's skill

Parameters
attackerThe unit performing the attack
defenderThe unit defending against the attack

The documentation for this class was generated from the following file: