Merge branch 'master' into dev

This commit is contained in:
Maruno17
2021-08-12 20:37:25 +01:00
7 changed files with 20 additions and 8 deletions

View File

@@ -367,11 +367,7 @@ class PokemonEncounters
chance_total = 0
enc_list.each { |a| chance_total += a[0] }
# Choose a random entry in the encounter table based on entry probabilities
rnd = 0
chance_rolls.times do
r = rand(chance_total)
rnd = r if r > rnd # Prefer rarer entries if rolling repeatedly
end
rnd = rand(chance_total)
encounter = nil
enc_list.each do |enc|
rnd -= enc[0]