Skip to content

Instantly share code, notes, and snippets.

@sleepypikachu
Last active June 21, 2019 15:38
Show Gist options
  • Save sleepypikachu/93ab72f00ea8b8bae2f2d1e9d45ad3b3 to your computer and use it in GitHub Desktop.
Save sleepypikachu/93ab72f00ea8b8bae2f2d1e9d45ad3b3 to your computer and use it in GitHub Desktop.
if (armor < dmg) { //This is a special case where we want to take off health
health -= (dmg - armor)
armor = 0 // Zero out our armor pool
} else { // This is the normal case where we just want to decrement armor
armor -= dmg
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment