diff --git a/Data/Scripts/001_Technical/005_PluginManager.rb b/Data/Scripts/001_Technical/005_PluginManager.rb index df77cf554..2cc6097d3 100644 --- a/Data/Scripts/001_Technical/005_PluginManager.rb +++ b/Data/Scripts/001_Technical/005_PluginManager.rb @@ -556,8 +556,18 @@ module PluginManager return true if $full_compile return true if !FileTest.exist?("Data/PluginScripts.rxdata") Input.update + # Force compiling if holding Shift or Ctrl return true if Input.press?(Input::SHIFT) || Input.press?(Input::CTRL) - # analyze whether or not to push recompile + # Should compile if the number of plugins has changed + scripts = load_data("Data/PluginScripts.rxdata") + return true if scripts.length != plugins.length + # Should compile if any plugins have changed version or been replaced + found_plugins = [] + plugins.each_pair { |name, meta| found_plugins.push([meta[:name], meta[:version]]) } + existing_plugins = [] + scripts.each { |plugin| existing_plugins.push([plugin[1][:name], plugin[1][:version]]) } + return true if found_plugins != existing_plugins + # Should compile if any plugin files have been recently modified mtime = File.mtime("Data/PluginScripts.rxdata") order.each do |o| # go through all the registered plugin scripts diff --git a/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb b/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb index 02eb581df..3be480c3d 100644 --- a/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb +++ b/Data/Scripts/011_Battle/003_Move/013_MoveEffects_SwitchingActing.rb @@ -897,16 +897,12 @@ class Battle::Move::DisableTargetHealingMoves < Battle::Move end #=============================================================================== -# Target cannot use sound-based moves for 2 more rounds. (Throat Chop) +# Target cannot use sound-based moves for 2 rounds. (Throat Chop) #=============================================================================== class Battle::Move::DisableTargetSoundMoves < Battle::Move def pbAdditionalEffect(user, target) return if target.fainted? || target.damageState.substitute - if target.effects[PBEffects::ThroatChop] == 0 - @battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!", - @name, target.pbThis(true))) - end - target.effects[PBEffects::ThroatChop] = 3 + target.effects[PBEffects::ThroatChop] = 2 if target.effects[PBEffects::ThroatChop] == 0 end end diff --git a/Data/Scripts/011_Battle/006_AI MoveEffects/009_AI_MoveEffects_SwitchingActing.rb b/Data/Scripts/011_Battle/006_AI MoveEffects/009_AI_MoveEffects_SwitchingActing.rb index e7c610998..c3cd43116 100644 --- a/Data/Scripts/011_Battle/006_AI MoveEffects/009_AI_MoveEffects_SwitchingActing.rb +++ b/Data/Scripts/011_Battle/006_AI MoveEffects/009_AI_MoveEffects_SwitchingActing.rb @@ -842,7 +842,8 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DisableTargetHealingMove #=============================================================================== Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DisableTargetSoundMoves", proc { |score, move, user, target, ai, battle| - next score if target.effects[PBEffects::ThroatChop] > 1 + next score if target.effects[PBEffects::ThroatChop] >= 1 + next score if target.effects[PBEffects::Substitute] > 0 next score if !target.check_for_move { |m| m.soundMove? } # Check additional effect chance add_effect = move.get_score_change_for_additional_effect(user, target)