diff --git a/Data/Scripts/001_Technical/002_RubyUtilities.rb b/Data/Scripts/001_Technical/002_RubyUtilities.rb index c8ae85240..3e7076f34 100644 --- a/Data/Scripts/001_Technical/002_RubyUtilities.rb +++ b/Data/Scripts/001_Technical/002_RubyUtilities.rb @@ -26,22 +26,11 @@ class String return ['a', 'e', 'i', 'o', 'u'].include?(self[0, 1].downcase) end - def first(n = 1) - return self[0...n] - end + def first(n = 1); return self[0...n]; end - def last(n = 1) - return self[-n..-1] || self - end + def last(n = 1); return self[-n..-1] || self; end - def blank? - blank = true - s = self.scan(/./) - for l in s - blank = false if l != "" - end - return blank - end + def blank?; return self.strip.empty?; end def cut(bitmap, width) string = self diff --git a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb index 1319d0eae..303e88676 100644 --- a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb +++ b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb @@ -64,16 +64,14 @@ class Spriteset_Map end def dispose - if $scne.is_a?(Scene_Map) + if $scene.is_a?(Scene_Map) $scene.map_renderer.remove_tileset(@map.tileset_name) @map.autotile_names.each { |filename| $scene.map_renderer.remove_autotile(filename) } $scene.map_renderer.remove_extra_autotiles(@map.tileset_id) end @panorama.dispose @fog.dispose - for sprite in @character_sprites - sprite.dispose - end + @character_sprites.each { |sprite| sprite.dispose } @weather.dispose @panorama = nil @fog = nil diff --git a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb index 504379756..e7c3fe920 100644 --- a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb @@ -471,9 +471,20 @@ class Battle::Battler @battle.pbHideAbilitySplash(b) if b.damageState.magicBounce newChoice = choice.clone newChoice[3] = user.index - newTargets = pbFindTargets(newChoice, move, b) + newTargets = pbFindTargets(newChoice ,move, b) newTargets = pbChangeTargets(move, b, newTargets) - success = pbProcessMoveHit(move, b, newTargets, 0, false) + success = false + if !move.pbMoveFailed?(b, newTargets) + newTargets.each_with_index do |newTarget, idx| + if pbSuccessCheckAgainstTarget(move, b, newTarget, newTargets) + success = true + next + end + newTargets[idx] = nil + end + newTargets.compact! + end + pbProcessMoveHit(move, b, newTargets, 0, false) if success b.lastMoveFailed = true if !success targets.each { |otherB| otherB.pbFaint if otherB && otherB.fainted? } user.pbFaint if user.fainted? @@ -486,7 +497,10 @@ class Battle::Battler @battle.pbShowAbilitySplash(mc) if magicBouncer >= 0 @battle.pbDisplay(_INTL("{1} bounced the {2} back!", mc.pbThis, move.name)) @battle.pbHideAbilitySplash(mc) if magicBouncer >= 0 - success = pbProcessMoveHit(move, mc, [], 0, false) + success = false + if !move.pbMoveFailed?(mc, []) + success = pbProcessMoveHit(move, mc, [], 0, false) + end mc.lastMoveFailed = true if !success targets.each { |b| b.pbFaint if b && b.fainted? } user.pbFaint if user.fainted? diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index d109178de..6a7dcc658 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -34,6 +34,7 @@ module Compiler case settingname when "Name" rgnnames[currentmap] = record + sections[currentmap][schema[0]] = record when "Point" placenames.push(record[2]) placedescs.push(record[3])