Skip to content

Instantly share code, notes, and snippets.

@danilogco
Last active March 13, 2023 01:52
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 danilogco/809eaa01981f3b1e766e67cf1703783a to your computer and use it in GitHub Desktop.
Save danilogco/809eaa01981f3b1e766e67cf1703783a to your computer and use it in GitHub Desktop.
Pokemon moves score comparison script
# 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