From cea46f76e8aef1a7795b6d8c3dd1e80b21d89f98 Mon Sep 17 00:00:00 2001 From: Michael Shirt Date: Thu, 13 Oct 2016 18:29:13 -0600 Subject: [PATCH] Added footsplashes These can be controlled with switch 101, to be primarily used in the Tower area. This isn't finalized yet but works as is atm, will be finished soon. --- scripts/Game_Character 3.rb | 7 ++++++- scripts/Game_Player.rb | 1 + scripts/Scene_Map.rb | 3 +++ scripts/Sprite_Footsplash.rb | 34 ++++++++++++++++++++++++++++++++++ scripts/Spriteset_Map.rb | 3 +++ scripts/_scripts.txt | 1 + 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 scripts/Sprite_Footsplash.rb diff --git a/scripts/Game_Character 3.rb b/scripts/Game_Character 3.rb index 30b630d..644d68a 100644 --- a/scripts/Game_Character 3.rb +++ b/scripts/Game_Character 3.rb @@ -493,8 +493,13 @@ class Game_Character # * Emit Footprint #-------------------------------------------------------------------------- def emit_footprint(direction) - if $game_map.counter?(@x, @y) + if $game_map.counter?(@x, @y) && !$game_switches[101] $scene.new_footprint(direction, @x, @y) end end + def emit_footsplash(direction) + if $game_map.counter?(@x, @y) && $game_switches[101] + $scene.new_footsplash(direction, @x, @y) + end + end end diff --git a/scripts/Game_Player.rb b/scripts/Game_Player.rb index d272a50..ca8993a 100644 --- a/scripts/Game_Player.rb +++ b/scripts/Game_Player.rb @@ -268,5 +268,6 @@ class Game_Player < Game_Character vol = 70 + rand(20) Audio.se_play("Audio/SE/#{name}.wav", (vol * volume).to_i, pitch.to_i) end + emit_footsplash(@direction) end end diff --git a/scripts/Scene_Map.rb b/scripts/Scene_Map.rb index c30c991..3b68f1c 100644 --- a/scripts/Scene_Map.rb +++ b/scripts/Scene_Map.rb @@ -460,6 +460,9 @@ class Scene_Map def new_footprint(direction, x, y) @spriteset.new_footprint(direction, x, y) end + def new_footsplash(direction, x, y) + @spriteset.new_footsplash(direction, x, y) + end def menu_open? @menu.visible || @item_menu.visible end diff --git a/scripts/Sprite_Footsplash.rb b/scripts/Sprite_Footsplash.rb new file mode 100644 index 0000000..cee0fdc --- /dev/null +++ b/scripts/Sprite_Footsplash.rb @@ -0,0 +1,34 @@ +class Sprite_Footsplash < Sprite + def initialize(viewport, direction, x, y) + + super(viewport) + y = y + 1 + @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 + self.bitmap = RPG::Cache.misc('foot_splash') + self.src_rect.set(0, 0, 96, 96) + update + end + + def update + return if disposed? + + self.x = (@real_x - $game_map.display_x + 3) / 4 + 16 + self.y = (@real_y - $game_map.display_y + 3) / 4 + 32 + + self.opacity -= 6 + frameIndex = 12 - (self.opacity / 21) + frameX = frameIndex % 4 + frameY = frameIndex / 4 + self.src_rect.set(96*frameX, 96*frameY, 96, 96) + if self.opacity == 0 + dispose + end + end +end diff --git a/scripts/Spriteset_Map.rb b/scripts/Spriteset_Map.rb index 2ec8df9..808ace6 100644 --- a/scripts/Spriteset_Map.rb +++ b/scripts/Spriteset_Map.rb @@ -351,4 +351,7 @@ class Spriteset_Map def new_footprint(direction, x, y) @footprint_sprites << Sprite_Footprint.new(@viewport, direction, x, y) end + def new_footsplash(direction, x, y) + @footprint_sprites << Sprite_Footsplash.new(@viewport, direction, x, y) + end end diff --git a/scripts/_scripts.txt b/scripts/_scripts.txt index 52d3c27..43e046f 100644 --- a/scripts/_scripts.txt +++ b/scripts/_scripts.txt @@ -34,6 +34,7 @@ Sprite_Picture Sprite_Timer Sprite_Light Sprite_Footprint +Sprite_Footsplash Spriteset_Map FastTravel