Last active
March 13, 2023 01:52
-
-
Save danilogco/809eaa01981f3b1e766e67cf1703783a to your computer and use it in GitHub Desktop.
Pokemon moves score comparison script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Move | |
puts "Is the move the same type as the Pokemon? (0 - yes, 1 - no) " | |
same_type = gets.chomp.to_i | |
puts "What's the move type? (0 - attack, 1 - special attack) " | |
f = gets.chomp.to_i # 0 - attack / 1 - special attack | |
puts "What's the move attack power? (0-200) " | |
c = gets.chomp.to_i # move attack power | |
# Pokemon stats | |
if f.zero? | |
puts "What's the Pokémon attack stat value? (0-400) " | |
else | |
puts "What's the Pokémon special attack stat value? (0-400) " | |
end | |
b = gets.chomp.to_i # pokemon stat attack / special attack | |
x = same_type.zero? ? 1.5 : 1.0 # same type attack / sp bonus | |
d = 50 # defenser defense or sp d | |
y = 2 # type muldifiers | |
a = 50 # attackers lvl | |
z = 255 # random between 217-255 | |
res = (((((((((2 * a / 5) + 2) * b * c) / d) / 50) + 2) * x) * y / 10) * z) / 255 | |
print("Move score: #{res}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment