Tidied up semicolon use, refactored random dungeon generation code, fixed visual bug in Day Care debug screen

This commit is contained in:
Maruno17
2021-08-22 23:18:34 +01:00
parent ecc5a040cd
commit 8bb70a226e
64 changed files with 1286 additions and 926 deletions

View File

@@ -134,9 +134,7 @@ class PBPokemon
move_data = GameData::Move.try_get(moves[i])
moveid.push(move_data.id) if move_data
end
if moveid.length == 0
GameData::Move.each { |mov| moveid.push(mov.id); break } # Get any one move
end
moveid.push(GameData::Move.keys.first) if moveid.length == 0 # Get any one move
return self.new(species, item, nature, moveid[0], moveid[1], moveid[2], moveid[3], ev_array)
end

View File

@@ -379,8 +379,7 @@ def pbRuledBattle(team1, team2, rule)
decision = pbDecideWinner(party1, party2, team1.rating, team2.rating)
else
level = rule.ruleset.suggestedLevel
t_type = nil
GameData::TrainerType.each { |t| t_type = t.id; break }
t_type = GameData::TrainerType.keys.first
trainer1 = NPCTrainer.new("PLAYER1", t_type)
trainer2 = NPCTrainer.new("PLAYER2", t_type)
items1 = []