Tweaks for footsteps and timer

This commit is contained in:
Mathew Velasquez 2016-03-11 02:29:08 -05:00
parent 737f0759e7
commit 62418329d4
3 changed files with 20 additions and 5 deletions

View file

@ -1,7 +1,6 @@
FOOTSTEP_SFX = [
# Start
['step_wood',
'step_carpet'],
['step_wood'],
# Blue
['step_gravel',
'step_wood'],
@ -41,5 +40,6 @@ FOOTSTEP_SFX = [
]
FOOTSTEP_AMT = {
'step_metal' => 4
'step_metal' => 4,
'step_tile' => 4,
}

View file

@ -63,7 +63,6 @@ class Game_Player < Game_Character
#--------------------------------------------------------------------------
def increase_steps
super
emit_footstep
# If move route is not forcing
unless @move_route_forcing
# Increase steps
@ -219,6 +218,16 @@ class Game_Player < Game_Character
last_real_x = @real_x
last_real_y = @real_y
super
# Emit footsteps
if moving? || last_real_x != @real_x || last_real_y != @real_y
@footstep_timer += 1
if (@move_speed <= 3 && @footstep_timer >= 16) || (@move_speed >= 4 && @footstep_timer >= 12)
emit_footstep
@footstep_timer = 0
end
else
@footstep_timer = 8
end
# If character moves down and is positioned lower than the center
# of the screen
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y

View file

@ -36,6 +36,9 @@ class Window_Message < Window_Selectable
@number_start = -1
# skip message proc if we have choices/numbers buffered
@skip_message_proc = false
# Text blip sound
@blipsound = nil
end
#--------------------------------------------------------------------------
# * Dispose
@ -90,6 +93,9 @@ class Window_Message < Window_Selectable
if $game_temp.message_text != nil && !$game_temp.message_text.empty?
text = $game_temp.message_text
# Determine blip sound
@blipsound = text.start_with?('[') ? 'text_robot' : 'text'
# Substitute variables, actors, player name, newlines, etc
text.gsub!(/\\v\[([0-9]+)\]/) do
$game_variables[$1.to_i]
@ -322,7 +328,7 @@ class Window_Message < Window_Selectable
@text_pause -= 1
else
if @blip >= BLIP_TIME
Audio.se_play('Audio/SE/text.wav') unless @text.empty?
Audio.se_play("Audio/SE/#{@blipsound}.wav", 50) unless @text.empty?
@blip = 0
else
@blip += 1