Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint32_t distance = std::max<uint32_t>(Position::getDistanceX(attackerPos, targetPos), Position::getDistanceY(attackerPos, targetPos));
- if (distance <= 1) {
- distance = 5;
- }
- distance *= 15;
- bool hit = false;
- if (rand() % distance <= skillValue) {
- hit = rand() % 100 <= hitChance;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement