Project1
标题:
『悬赏任务已完成』主角移动时同步发出脚步声for xp
[打印本页]
作者:
做游戏的新手
时间:
2008-9-29 03:09
标题:
『悬赏任务已完成』主角移动时同步发出脚步声for xp
名称:主角移动时同步发出脚步声
语种:Japanese
来源URL:http://members.jcom.home.ne.jp/cogwheel/script/footstep.txt
http://rpg.blue/viewthread.php?tid=96686
版权说明:脚本里没有= =
截图:这有啥好截的{/gg},算了截两张
{/hx}
下载地址或脚本:范例工程有问题
贴脚本
# 主角移动时同步发出脚步声 Ver1.00
# 友情网站:
# http://members.jcom.home.ne.jp/cogwheel/
#==============================================================================
# ■ Game_Character (分割定义 2)
#------------------------------------------------------------------------------
# 处理角色的类。本类作为 Game_Player 类与 Game_Event
# 类的超级类使用。
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# ● 脚步声
#--------------------------------------------------------------------------
def step_sound
if self == $game_player
vol = 75
else
vol = [75 - Math.sqrt(($game_player.real_x - self.real_x) ** 2 +
($game_player.real_y - self.real_y) ** 2) / 64, 0].max
end
if @character_name[/\[(\d+)\]/]
pattern1 = ($1 - 1) / 4
pattern2 = ($1 - 1) * 3 / 4
else
pattern1 = 1
pattern2 = 3
end
if @pattern == pattern1
case terrain_tag
when 0 # 地板
Audio.se_play("Audio/SE/016-Jump02", vol, 120)
end
elsif @pattern == pattern2
case terrain_tag
when 0 # 地板
Audio.se_play("Audio/SE/016-Jump02", vol, 100)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 跳跃中、移动中、停止中的分岐
if jumping?
update_jump
elsif moving?
update_move
else
update_stop
end
# 动画计数超过最大值的情况下
# ※最大值等于基本值减去移动速度 * 1 的值
# 在文件名有[n]的时候,刷新模式用常规(n-1)/4的速度
if @character_name[/\[(\d+)\]/]
@anime_count = 20 if @anime_count > 0 and @pattern == @original_pattern
if @anime_count * ($1.to_i - 1) / 4 > 18 - @move_speed * 2
# 停止动画为 OFF 并且在停止中的情况下
if not @step_anime and @stop_count > 0
# 还原为原来的图形
@pattern = @original_pattern
# 停止动画为 ON 并且在移动中的情况下
else
# 更新图形
@pattern = @pattern % ($1.to_i - 1) + 1
# 发出脚步声
if self.is_a?(Game_Player) or (@name[/\\[Ff]/] and
@stop_count == 0 and @locked == false and @character_name != "")
step_sound
end
end
# 清除动画计数
@anime_count = 0
end
else
# 复制图形更新处理(默认的处理)
if @anime_count > 18 - @move_speed * 2
# 停止动画为 OFF 并且在停止中的情况下
if not @step_anime and @stop_count > 0
# 还原为原来的图形
@pattern = @original_pattern
# 停止动画为 ON 并且在移动中的情况下
else
# 更新图形
@pattern = (@pattern + 1) % 4
if self.is_a?(Game_Player) or (@name[/\\[Ff]/] and
@stop_count == 0 and @locked == false and @character_name != "")
step_sound
end
end
# 清除动画计数
@anime_count = 0
end
end
# 等待中的情况下
if @wait_count > 0
# 减少等待计数
@wait_count -= 1
return
end
# 强制移动路线的场合
if @move_route_forcing
# 自定义移动
move_type_custom
return
end
# 事件执行待机中并且为锁定状态的情况下
if @starting or lock?
# 不做规则移动
return
end
# 如果停止计数超过了一定的值(由移动频度算出)
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
# 移动类型分支
case @move_type
when 1 # 随机
move_type_random
when 2 # 接近
move_type_toward_player
when 3 # 自定义
move_type_custom
end
end
end
end
#==============================================================================
# ■ Game_Event
#------------------------------------------------------------------------------
# 处理事件的类。条件判断、事件页的切换、并行处理、执行事件功能
# 在 Game_Map 类的内部使用。
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :name # 名字
#--------------------------------------------------------------------------
# ● 初始化对像
# map_id : 地图 ID
# event : 事件 (RPG::Event)
#--------------------------------------------------------------------------
alias :initialize_spirit :initialize
def initialize(map_id, event)
@name = event.name
initialize_spirit(map_id, event)
end
end
复制代码
原版下载地址:
(脚本就免了)
说明:XDD,弄点外快积分
作者:
偶尔杀人越货
时间:
2008-9-29 03:31
分數已經匯入翻譯者帳下,請注意查收
作者:
做游戏的新手
时间:
2008-9-29 03:33
看到了
已查收
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1