NPC trainers' end of battle text is now read directly from the trainer object rather than extracted to an array

This commit is contained in:
Maruno17
2022-05-17 22:28:29 +01:00
parent cf338b3a6a
commit e12b6fde1d
7 changed files with 26 additions and 33 deletions

View File

@@ -412,9 +412,10 @@ class Battle
pbDisplayPaused(_INTL("You defeated {1}, {2} and {3}!", @opponent[0].full_name,
@opponent[1].full_name, @opponent[2].full_name))
end
@opponent.each_with_index do |_t, i|
@opponent.each_with_index do |trainer, i|
@scene.pbShowOpponent(i)
msg = (@endSpeeches[i] && @endSpeeches[i] != "") ? @endSpeeches[i] : "..."
msg = trainer.lose_text
msg = "..." if !msg || msg.empty?
pbDisplayPaused(msg.gsub(/\\[Pp][Nn]/, pbPlayer.name))
end
end
@@ -444,11 +445,12 @@ class Battle
# Lose money from losing a battle
pbLoseMoney
pbDisplayPaused(_INTL("You blacked out!")) if !@canLose
elsif @decision == 2
elsif @decision == 2 # Lost in a Battle Frontier battle
if @opponent
@opponent.each_with_index do |_t, i|
@opponent.each_with_index do |trainer, i|
@scene.pbShowOpponent(i)
msg = (@endSpeechesWin[i] && @endSpeechesWin[i] != "") ? @endSpeechesWin[i] : "..."
msg = trainer.win_text
msg = "..." if !msg || msg.empty?
pbDisplayPaused(msg.gsub(/\\[Pp][Nn]/, pbPlayer.name))
end
end