| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 7 |
| 经验 | |
| 最后登录 | 2021-10-29 |
| 在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 回帖
- 571

|
发表于 2012-9-23 20:00:30
|
显示全部楼层
本帖最后由 ML4455739 于 2012-9-23 20:03 编辑
[pre lang="ruby"] # 关闭判定的开关ID,默认5号开关为ON时关闭判定
JUDGE_SWITCHES = 5
# 按键判定类型 true为press,false为trigger,可以尝试一下
INPUT_TYPE = true # false
# 音效文件名,无需路径,无需后缀名
SE_NAME = "041-knock02"
# 音效音量,最大100
SE_VOLUME = 80
# 音效延迟时间(默认40帧 = 1秒)
SE_DELAY = 12
class Scene_Map
def rwa_extra_voice_run_in
td = $game_player
return true if td.moving? or $game_switches[JUDGE_SWITCHES]
case td.direction
when 8
if $game_map.check_event(td.x, td.y - 1).class != Fixnum
if INPUT_TYPE
return td.passable?(td.x, td.y - 1, td.direction) if Input.press?(Input::UP)
else
return td.passable?(td.x, td.y - 1, td.direction) if Input.trigger?(Input::UP)
end
end
when 6
if $game_map.check_event(td.x + 1, td.y).class != Fixnum
if INPUT_TYPE
return td.passable?(td.x + 1, td.y, td.direction) if Input.press?(Input::RIGHT)
else
return td.passable?(td.x + 1, td.y, td.direction) if Input.trigger?(Input::RIGHT)
end
end
when 4
if $game_map.check_event(td.x - 1, td.y).class != Fixnum
if INPUT_TYPE
return td.passable?(td.x - 1, td.y, td.direction) if Input.press?(Input::LEFT)
else
return td.passable?(td.x - 1, td.y, td.direction) if Input.trigger?(Input::LEFT)
end
end
when 2
if $game_map.check_event(td.x, td.y + 1).class != Fixnum
if INPUT_TYPE
return td.passable?(td.x, td.y + 1, td.direction) if Input.press?(Input::DOWN)
else
return td.passable?(td.x, td.y + 1, td.direction) if Input.trigger?(Input::DOWN)
end # if INPUT_TYPE
end # if $game_map.check_event
end # case
return true
end # def
alias rwa_extra_voice_run_in_update update
def update
rwa_extra_voice_run_in_update
return if $game_switches[JUDGE_SWITCHES]
if !$game_player.moving?
@@tdtime ||= []
@@tdtime[0] ||= 0
@@tdtime[1] ||= false
@@tdtime[0] >= SE_DELAY ? @@tdtime[1] = true : @@tdtime[0] += 1
@@tdtime[0] = 0 if @@tdtime[1]
end
if rwa_extra_voice_run_in == false and @@tdtime[1]
Audio.se_play("Audio/SE/#{SE_NAME}", SE_VOLUME, 100)
@@tdtime[1] = nil
end # if
end # def
end # class[/pre] |
评分
-
查看全部评分
|