From 49e9f81953eefa7f41e99395f6967462a0e5ba81 Mon Sep 17 00:00:00 2001 From: Mathew Velasquez Date: Thu, 25 Feb 2016 19:32:40 -0500 Subject: [PATCH] Dynamic footsteps --- scripts/Data_Footsteps.rb | 14 +++++++++----- scripts/Game_Player.rb | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/Data_Footsteps.rb b/scripts/Data_Footsteps.rb index ac84ec6..ecb3704 100644 --- a/scripts/Data_Footsteps.rb +++ b/scripts/Data_Footsteps.rb @@ -16,8 +16,8 @@ FOOTSTEP_SFX = [ ['step_grass', 'step_tile'], # Red - ['step_metal', - 'step_metal_light'], + ['step_grate', + 'step_metal'], # Red Interior ['step_tile', 'step_wood'], @@ -28,14 +28,18 @@ FOOTSTEP_SFX = [ # Blank [], # Blue Factory Interior - ['step_metal_light'], + ['step_metal'], # Red Ground [], # Red Factory [], # Red Factory Interior - ['step_metal_light'], + ['step_metal'], # Red observation deck - ['step_metal_light', + ['step_metal', 'step_tile'], ] + +FOOTSTEP_AMT = { + 'step_metal' => 4 +} diff --git a/scripts/Game_Player.rb b/scripts/Game_Player.rb index 81ada46..8879725 100644 --- a/scripts/Game_Player.rb +++ b/scripts/Game_Player.rb @@ -264,7 +264,11 @@ class Game_Player < Game_Character return unless $game_temp.footstep_sfx tag = $game_map.terrain_tag(@x, @y) - 1 if tag >= 0 && tag < $game_temp.footstep_sfx.size - Audio.se_play("Audio/SE/#{$game_temp.footstep_sfx[tag]}.wav", 50) + name = $game_temp.footstep_sfx[tag] + if FOOTSTEP_AMT.include? name + name += '%02d' % [rand(FOOTSTEP_AMT[name]) + 1] + end + Audio.se_play("Audio/SE/#{name}.wav", 80) end end end