From d4036081896974e481829d343e51d479db7cb3f4 Mon Sep 17 00:00:00 2001 From: Michael Shirt Date: Mon, 17 Oct 2016 15:27:52 -0600 Subject: [PATCH] Finishing footsplashes for the water room. With these scripts the map properly loops and the footsplashes do as well. Footsplashes were also made bigger. --- scripts/Script.rb | 13 +++++++++++++ scripts/Sprite_Footprint.rb | 7 +++++++ scripts/Sprite_Footsplash.rb | 34 ++++++++++++++++++++++++++-------- scripts/Spriteset_Map.rb | 6 ++++++ 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/scripts/Script.rb b/scripts/Script.rb index 8f62c49..aa08943 100644 --- a/scripts/Script.rb +++ b/scripts/Script.rb @@ -31,6 +31,19 @@ module Script return false end + def self.fix_footsplashes(xDelta, yDelta) + $scene.fix_footsplashes(xDelta, yDelta) + end + + def self.move_player_relative(x, y) + $game_player.x += x + $game_player.y += y + $game_player.real_x += x * 4 * 32 + $game_player.real_y += y * 4 * 32 + $game_map.display_x += x * 4 * 32 + $game_map.display_y += y * 4 * 32 + end + def self.eve_x(name) for event in $game_map.events.values if event.name == name diff --git a/scripts/Sprite_Footprint.rb b/scripts/Sprite_Footprint.rb index c4965c9..43727f2 100644 --- a/scripts/Sprite_Footprint.rb +++ b/scripts/Sprite_Footprint.rb @@ -25,4 +25,11 @@ class Sprite_Footprint < Sprite dispose end end + + def correctX(xDelta) + @real_x += xDelta*4*32 + end + def correctY(yDelta) + @real_y += yDelta*4*32 + end end diff --git a/scripts/Sprite_Footsplash.rb b/scripts/Sprite_Footsplash.rb index cee0fdc..a5b4b36 100644 --- a/scripts/Sprite_Footsplash.rb +++ b/scripts/Sprite_Footsplash.rb @@ -2,17 +2,28 @@ class Sprite_Footsplash < Sprite def initialize(viewport, direction, x, y) super(viewport) - y = y + 1 + y = y + 2 @direction = direction @real_x = x * 4 * 32 @real_y = y * 4 * 32 - self.zoom_x = 1 - self.zoom_y = 1 - self.ox = 48 - self.oy = 96 + case direction + when 2 + @real_y -= 32 + when 4 + @real_x += 32 + when 6 + @real_x -= 32 + when 8 + @real_y += 32 + end + + self.zoom_x = 2 + self.zoom_y = 2 + self.ox = 40 + self.oy = 80 self.bitmap = RPG::Cache.misc('foot_splash') - self.src_rect.set(0, 0, 96, 96) + self.src_rect.set(0, 0, 80, 80) update end @@ -23,12 +34,19 @@ class Sprite_Footsplash < Sprite self.y = (@real_y - $game_map.display_y + 3) / 4 + 32 self.opacity -= 6 - frameIndex = 12 - (self.opacity / 21) + frameIndex = 20 - (self.opacity / 13) frameX = frameIndex % 4 frameY = frameIndex / 4 - self.src_rect.set(96*frameX, 96*frameY, 96, 96) + self.src_rect.set(80*frameX, 80*frameY, 80, 80) if self.opacity == 0 dispose end end + + def correctX(xDelta) + @real_x += xDelta*4*32 + end + def correctY(yDelta) + @real_y += yDelta*4*32 + end end diff --git a/scripts/Spriteset_Map.rb b/scripts/Spriteset_Map.rb index 808ace6..6fd22cc 100644 --- a/scripts/Spriteset_Map.rb +++ b/scripts/Spriteset_Map.rb @@ -354,4 +354,10 @@ class Spriteset_Map def new_footsplash(direction, x, y) @footprint_sprites << Sprite_Footsplash.new(@viewport, direction, x, y) end + def fix_footsplashes(x, y) + for footprint in @footprint_sprites + footprint.correctX(x) + footprint.correctY(y) + end + end end