diff --git a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb index 6c5bea3df..1619f3db5 100644 --- a/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb +++ b/Data/Scripts/004_Game classes/012_Game_FollowerFactory.rb @@ -278,14 +278,8 @@ class Game_FollowerFactory facing_tile = $map_factory.getFacingTile # Assumes player is 1x1 tile in size each_follower do |event, follower| - if event.at_coordinate?($game_player.x, $game_player.y) # Underneath player - next if !event.over_trigger? - elsif facing_tile && event.map.map_id == facing_tile[0] && - event.at_coordinate?(facing_tile[1], facing_tile[2]) # On facing tile - next if event.over_trigger? - else # Somewhere else - next - end + next if !facing_tile || event.map.map_id != facing_tile[0] || + !event.at_coordinate?(facing_tile[1], facing_tile[2]) # Not on facing tile next if event.jumping? follower.interact(event) end diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 9917a92ef..2a306b881 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -935,58 +935,67 @@ def drawBitmapBuffer(chars) end def drawSingleFormattedChar(bitmap, ch) - if ch[5] # If a graphic + if ch[5] # If a graphic graphic = Bitmap.new(ch[0]) graphicRect = ch[15] bitmap.blt(ch[1], ch[2], graphic, graphicRect, ch[8].alpha) graphic.dispose + return + end + bitmap.font.bold = ch[6] if bitmap.font.bold != ch[6] + bitmap.font.italic = ch[7] if bitmap.font.italic != ch[7] + bitmap.font.name = ch[12] if bitmap.font.name != ch[12] + bitmap.font.size = ch[13] if bitmap.font.size != ch[13] + if ch[9] # shadow + if ch[10] # underline + bitmap.fill_rect(ch[1], ch[2] + ch[4] - [(ch[4] - bitmap.font.size) / 2, 0].max - 2, + ch[3], 4, ch[9]) + end + if ch[11] # strikeout + bitmap.fill_rect(ch[1], ch[2] + 2 + (ch[4] / 2), ch[3], 4, ch[9]) + end + end + if ch[0] == "\n" || ch[0] == "\r" || ch[0] == " " || isWaitChar(ch[0]) + bitmap.font.color = ch[8] if bitmap.font.color != ch[8] else - bitmap.font.size = ch[13] if bitmap.font.size != ch[13] - if ch[0] != "\n" && ch[0] != "\r" && ch[0] != " " && !isWaitChar(ch[0]) - bitmap.font.bold = ch[6] if bitmap.font.bold != ch[6] - bitmap.font.italic = ch[7] if bitmap.font.italic != ch[7] - bitmap.font.name = ch[12] if bitmap.font.name != ch[12] - offset = 0 - if ch[9] # shadow - bitmap.font.color = ch[9] - if (ch[16] & 1) != 0 # outline - offset = 1 - bitmap.draw_text(ch[1], ch[2], ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1], ch[2] + 1, ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1], ch[2] + 2, ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 1, ch[2], ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 1, ch[2] + 2, ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 2, ch[2], ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 2, ch[2] + 1, ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 2, ch[2] + 2, ch[3] + 2, ch[4], ch[0]) - elsif (ch[16] & 2) != 0 # outline 2 - offset = 2 - bitmap.draw_text(ch[1], ch[2], ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1], ch[2] + 2, ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1], ch[2] + 4, ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 2, ch[2], ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 2, ch[2] + 4, ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 4, ch[2], ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 4, ch[2] + 2, ch[3] + 4, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 4, ch[2] + 4, ch[3] + 4, ch[4], ch[0]) - else - bitmap.draw_text(ch[1] + 2, ch[2], ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1], ch[2] + 2, ch[3] + 2, ch[4], ch[0]) - bitmap.draw_text(ch[1] + 2, ch[2] + 2, ch[3] + 2, ch[4], ch[0]) - end + offset = 0 + if ch[9] # shadow + bitmap.font.color = ch[9] + if (ch[16] & 1) != 0 # outline + offset = 1 + bitmap.draw_text(ch[1], ch[2], ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1], ch[2] + 1, ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1], ch[2] + 2, ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 1, ch[2], ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 1, ch[2] + 2, ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 2, ch[2], ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 2, ch[2] + 1, ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 2, ch[2] + 2, ch[3] + 2, ch[4], ch[0]) + elsif (ch[16] & 2) != 0 # outline 2 + offset = 2 + bitmap.draw_text(ch[1], ch[2], ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1], ch[2] + 2, ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1], ch[2] + 4, ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 2, ch[2], ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 2, ch[2] + 4, ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 4, ch[2], ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 4, ch[2] + 2, ch[3] + 4, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 4, ch[2] + 4, ch[3] + 4, ch[4], ch[0]) + else + bitmap.draw_text(ch[1] + 2, ch[2], ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1], ch[2] + 2, ch[3] + 2, ch[4], ch[0]) + bitmap.draw_text(ch[1] + 2, ch[2] + 2, ch[3] + 2, ch[4], ch[0]) end - bitmap.font.color = ch[8] if bitmap.font.color != ch[8] - bitmap.draw_text(ch[1] + offset, ch[2] + offset, ch[3], ch[4], ch[0]) - elsif bitmap.font.color != ch[8] - bitmap.font.color = ch[8] - end - if ch[10] # underline - bitmap.fill_rect(ch[1], ch[2] + ch[4] - 4 - [(ch[4] - bitmap.font.size) / 2, 0].max - 2, - ch[3] - 2, 2, ch[8]) - end - if ch[11] # strikeout - bitmap.fill_rect(ch[1], ch[2] + (ch[4] / 2) - 4, ch[3] - 2, 2, ch[8]) end + bitmap.font.color = ch[8] if bitmap.font.color != ch[8] + bitmap.draw_text(ch[1] + offset, ch[2] + offset, ch[3], ch[4], ch[0]) + end + if ch[10] # underline + bitmap.fill_rect(ch[1], ch[2] + ch[4] - [(ch[4] - bitmap.font.size) / 2, 0].max - 2, + ch[3] - 2, 2, ch[8]) + end + if ch[11] # strikeout + bitmap.fill_rect(ch[1], ch[2] + 2 + (ch[4] / 2), ch[3] - 2, 2, ch[8]) end end diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index d098be41a..0f1153a43 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -819,7 +819,7 @@ def pbShowCommandsWithHelp(msgwindow, commands, help, cmdIfCancel = 0, defaultCm Input.update end msgwin.letterbyletter = oldlbl - msgwin.dispose if !msgwindow + pbDisposeMessageWindow(msgwin) if !msgwindow return ret end diff --git a/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb b/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb index 27d35437a..1ebf1ccec 100644 --- a/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb +++ b/Data/Scripts/011_Battle/002_Battler/004_Battler_Statuses.rb @@ -24,7 +24,7 @@ class Battle::Battler def pbCanInflictStatus?(newStatus, user, showMessages, move = nil, ignoreStatus = false) return false if fainted? - selfInflicted = (user && user.index == @index) + self_inflicted = (user && user.index == @index) # Rest and Flame Orb/Toxic Orb only # Already have that status problem if self.status == newStatus && !ignoreStatus if showMessages @@ -41,13 +41,13 @@ class Battle::Battler return false end # Trying to replace a status problem with another one - if self.status != :NONE && !ignoreStatus && !selfInflicted + if self.status != :NONE && !ignoreStatus && !(self_inflicted && move) # Rest can replace a status problem @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) if showMessages return false end # Trying to inflict a status problem on a Pokémon behind a substitute if @effects[PBEffects::Substitute] > 0 && !(move && move.ignoresSubstitute?(user)) && - !selfInflicted + !self_inflicted @battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true))) if showMessages return false end @@ -105,7 +105,7 @@ class Battle::Battler immAlly = nil if Battle::AbilityEffects.triggerStatusImmunityNonIgnorable(self.ability, self, newStatus) immuneByAbility = true - elsif selfInflicted || !@battle.moldBreaker + elsif self_inflicted || !@battle.moldBreaker if abilityActive? && Battle::AbilityEffects.triggerStatusImmunity(self.ability, self, newStatus) immuneByAbility = true else @@ -163,7 +163,7 @@ class Battle::Battler return false end # Safeguard immunity - if pbOwnSide.effects[PBEffects::Safeguard] > 0 && !selfInflicted && move && + if pbOwnSide.effects[PBEffects::Safeguard] > 0 && !self_inflicted && move && !(user && user.hasActiveAbility?(:INFILTRATOR)) @battle.pbDisplay(_INTL("{1}'s team is protected by Safeguard!", pbThis)) if showMessages return false diff --git a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb index 80cd6ad22..1271ab429 100644 --- a/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb +++ b/Data/Scripts/012_Overworld/006_Overworld_BerryPlants.rb @@ -259,7 +259,8 @@ class BerryPlantSprite when 2 then @event.turn_down # X sprouted when 3 then @event.turn_left # X taller when 4 then @event.turn_right # X flowering - when 5 then @event.turn_up # X berries + else + @event.turn_up if berry_plant.growth_stage >= 5 # X berries end else @event.character_name = "Object ball"