mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Fixed bad uses of .sample
This commit is contained in:
@@ -40,7 +40,7 @@ end
|
|||||||
def pbRandomMove
|
def pbRandomMove
|
||||||
keys = GameData::Move.keys
|
keys = GameData::Move.keys
|
||||||
loop do
|
loop do
|
||||||
move_id = keys[keys.sample]
|
move_id = keys.sample
|
||||||
move = GameData::Move.get(move_id)
|
move = GameData::Move.get(move_id)
|
||||||
next if move.id == :SKETCH || move.id == :STRUGGLE
|
next if move.id == :SKETCH || move.id == :STRUGGLE
|
||||||
return move.id
|
return move.id
|
||||||
@@ -153,7 +153,7 @@ def pbRandomPokemonFromRule(rules, trainer)
|
|||||||
keys = GameData::Species.keys
|
keys = GameData::Species.keys
|
||||||
loop do
|
loop do
|
||||||
loop do
|
loop do
|
||||||
species = keys[keys.sample]
|
species = keys.sample
|
||||||
break if GameData::Species.get(species).form == 0
|
break if GameData::Species.get(species).form == 0
|
||||||
end
|
end
|
||||||
r = rand(20)
|
r = rand(20)
|
||||||
@@ -175,7 +175,7 @@ def pbRandomPokemonFromRule(rules, trainer)
|
|||||||
nature = nil
|
nature = nil
|
||||||
keys = GameData::Nature.keys
|
keys = GameData::Nature.keys
|
||||||
loop do
|
loop do
|
||||||
nature = keys[keys.sample]
|
nature = keys.sample
|
||||||
nature_data = GameData::Nature.get(nature)
|
nature_data = GameData::Nature.get(nature)
|
||||||
if [:LAX, :GENTLE].include?(nature_data.id) || nature_data.stat_changes.length == 0
|
if [:LAX, :GENTLE].include?(nature_data.id) || nature_data.stat_changes.length == 0
|
||||||
next if rand(20) < 19
|
next if rand(20) < 19
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ def pbTrainerInfo(pokemonlist, trfile, rules)
|
|||||||
else
|
else
|
||||||
tr_typekeys = GameData::TrainerType.keys
|
tr_typekeys = GameData::TrainerType.keys
|
||||||
loop do
|
loop do
|
||||||
tr_type = tr_typekeys[tr_typekeys.sample]
|
tr_type = tr_typekeys.sample
|
||||||
tr_type_data = GameData::TrainerType.get(tr_type)
|
tr_type_data = GameData::TrainerType.get(tr_type)
|
||||||
next if tr_type_data.base_money >= 100
|
next if tr_type_data.base_money >= 100
|
||||||
trainerid = tr_type_data.id
|
trainerid = tr_type_data.id
|
||||||
|
|||||||
Reference in New Issue
Block a user