Tweaks for footsteps and timer
This commit is contained in:
parent
737f0759e7
commit
62418329d4
|
|
@ -1,7 +1,6 @@
|
||||||
FOOTSTEP_SFX = [
|
FOOTSTEP_SFX = [
|
||||||
# Start
|
# Start
|
||||||
['step_wood',
|
['step_wood'],
|
||||||
'step_carpet'],
|
|
||||||
# Blue
|
# Blue
|
||||||
['step_gravel',
|
['step_gravel',
|
||||||
'step_wood'],
|
'step_wood'],
|
||||||
|
|
@ -41,5 +40,6 @@ FOOTSTEP_SFX = [
|
||||||
]
|
]
|
||||||
|
|
||||||
FOOTSTEP_AMT = {
|
FOOTSTEP_AMT = {
|
||||||
'step_metal' => 4
|
'step_metal' => 4,
|
||||||
|
'step_tile' => 4,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ class Game_Player < Game_Character
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def increase_steps
|
def increase_steps
|
||||||
super
|
super
|
||||||
emit_footstep
|
|
||||||
# If move route is not forcing
|
# If move route is not forcing
|
||||||
unless @move_route_forcing
|
unless @move_route_forcing
|
||||||
# Increase steps
|
# Increase steps
|
||||||
|
|
@ -219,6 +218,16 @@ class Game_Player < Game_Character
|
||||||
last_real_x = @real_x
|
last_real_x = @real_x
|
||||||
last_real_y = @real_y
|
last_real_y = @real_y
|
||||||
super
|
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
|
# If character moves down and is positioned lower than the center
|
||||||
# of the screen
|
# of the screen
|
||||||
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
|
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,9 @@ class Window_Message < Window_Selectable
|
||||||
@number_start = -1
|
@number_start = -1
|
||||||
# skip message proc if we have choices/numbers buffered
|
# skip message proc if we have choices/numbers buffered
|
||||||
@skip_message_proc = false
|
@skip_message_proc = false
|
||||||
|
|
||||||
|
# Text blip sound
|
||||||
|
@blipsound = nil
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Dispose
|
# * Dispose
|
||||||
|
|
@ -90,6 +93,9 @@ class Window_Message < Window_Selectable
|
||||||
if $game_temp.message_text != nil && !$game_temp.message_text.empty?
|
if $game_temp.message_text != nil && !$game_temp.message_text.empty?
|
||||||
text = $game_temp.message_text
|
text = $game_temp.message_text
|
||||||
|
|
||||||
|
# Determine blip sound
|
||||||
|
@blipsound = text.start_with?('[') ? 'text_robot' : 'text'
|
||||||
|
|
||||||
# Substitute variables, actors, player name, newlines, etc
|
# Substitute variables, actors, player name, newlines, etc
|
||||||
text.gsub!(/\\v\[([0-9]+)\]/) do
|
text.gsub!(/\\v\[([0-9]+)\]/) do
|
||||||
$game_variables[$1.to_i]
|
$game_variables[$1.to_i]
|
||||||
|
|
@ -322,7 +328,7 @@ class Window_Message < Window_Selectable
|
||||||
@text_pause -= 1
|
@text_pause -= 1
|
||||||
else
|
else
|
||||||
if @blip >= BLIP_TIME
|
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
|
@blip = 0
|
||||||
else
|
else
|
||||||
@blip += 1
|
@blip += 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue