Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. uint32_t distance = std::max<uint32_t>(Position::getDistanceX(attackerPos, targetPos), Position::getDistanceY(attackerPos, targetPos));
  2. if (distance <= 1) {
  3. distance = 5;
  4. }
  5.  
  6. distance *= 15;
  7.  
  8. bool hit = false;
  9.  
  10. if (rand() % distance <= skillValue) {
  11. hit = rand() % 100 <= hitChance;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement