Skip to content

Commit

Permalink
Fixed type-boosting Gems being consumed when they shouldn't, fixed co…
Browse files Browse the repository at this point in the history
…mpiler error relating to replacing battle-starting methods
  • Loading branch information
Maruno17 committed May 19, 2022
1 parent e9cd62b commit 5fb8218
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Data/Scripts/011_Battle/005_AI/006_AI_Move_Utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def pbRoughDamage(move, user, target, skill, baseDmg)
Battle::ItemEffects.triggerDamageCalcFromUser(
user.item, user, target, move, multipliers, baseDmg, type
)
user.effects[PBEffects::GemConsumed] = nil # Untrigger consuming of Gems
end
end
if skill >= PBTrainerAI.bestSkill &&
Expand Down
1 change: 1 addition & 0 deletions Data/Scripts/019_Utilities/001_Utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def pbChangePlayer(id)
meta = GameData::PlayerMetadata.get(id)
return false if !meta
$player.character_ID = id
return true
end

def pbTrainerName(name = nil, outfit = 0)
Expand Down
6 changes: 3 additions & 3 deletions Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ def replace_old_battle_scripts(event, list, index)
elsif script[/^\s*pbTrainerBattle\((.+)\)\s*$/]
battle_params = $1.split(",")
trainer1 = "#{battle_params[0].strip}, #{battle_params[1].strip}"
trainer1 += ", #{battle_params[4].strip}" if battle_params[4].strip != "nil"
trainer1 += ", #{battle_params[4].strip}" if battle_params[4] && battle_params[4].strip != "nil"
list[index].parameters[1] = "TrainerBattle.start(#{trainer1})"
old_indent = list[index].indent
new_events = []
Expand All @@ -987,7 +987,7 @@ def replace_old_battle_scripts(event, list, index)
elsif script[/^\s*pbDoubleTrainerBattle\((.+)\)\s*$/]
battle_params = $1.split(",")
trainer1 = "#{battle_params[0].strip}, #{battle_params[1].strip}"
trainer1 += ", #{battle_params[2].strip}" if battle_params[2].strip != "nil"
trainer1 += ", #{battle_params[2].strip}" if battle_params[2] && battle_params[2].strip != "nil"
trainer2 = "#{battle_params[4].strip}, #{battle_params[5].strip}"
trainer2 += ", #{battle_params[6].strip}" if battle_params[6] && battle_params[6].strip != "nil"
list[index].parameters[1] = "TrainerBattle.start(#{trainer1}, #{trainer2})"
Expand All @@ -1014,7 +1014,7 @@ def replace_old_battle_scripts(event, list, index)
elsif script[/^\s*pbTripleTrainerBattle\((.+)\)\s*$/]
battle_params = $1.split(",")
trainer1 = "#{battle_params[0].strip}, #{battle_params[1].strip}"
trainer1 += ", #{battle_params[2].strip}" if battle_params[2].strip != "nil"
trainer1 += ", #{battle_params[2].strip}" if battle_params[2] && battle_params[2].strip != "nil"
trainer2 = "#{battle_params[4].strip}, #{battle_params[5].strip}"
trainer2 += ", #{battle_params[6].strip}" if battle_params[6] && battle_params[6].strip != "nil"
trainer3 = "#{battle_params[8].strip}, #{battle_params[9].strip}"
Expand Down

0 comments on commit 5fb8218

Please sign in to comment.