Skip to content

Instantly share code, notes, and snippets.

@gastrop0d
Last active February 9, 2018 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gastrop0d/b7e2d4734128b4a1ee65cacfd300a6e0 to your computer and use it in GitHub Desktop.
Save gastrop0d/b7e2d4734128b4a1ee65cacfd300a6e0 to your computer and use it in GitHub Desktop.
void ApplyDamage(Character attacker, Target target, float amount)
{
bool doCrit = attacker.QueryBoolOr(QUERY_ADVANTAGE_HAS)
|| target.QueryBoolOr(QUERY_ADVANTAGE_GRANTED);
if( doCrit )
{
amount += attacker.QueryFloatSum(QUERY_DAMAGE_CRIT);
}
target.Hit(amount);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment