Minor bugfiixes (#140)

* Fixed moves bounced back by Magic Coat/Bounced moves affecting Pokemon they normally shouldn't
* Fixed townmap compiler not saving any map names (doesn't make a difference; added for completionism)
* Update a few ruby utilities
* Fixed small typo bug in map renderer disposal
This commit is contained in:
Golisopod-User
2021-12-20 02:28:28 +05:30
committed by GitHub
parent 65b1a8d6c3
commit 7f86db6da9
4 changed files with 23 additions and 21 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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?

View File

@@ -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])