#============================================================================== #-------------------------怪物追跡------------------------------------------------------- #------------------[url]http://blog.sina.com.cn/rpgs---------------------------------------[/url] #使用方法,在事件的名称上加enemy #在运动规则 类型——随机 # 速度——自己选(别太快,别高过反应后的速度) # 频率——最高 #与事件接触 #然后在内容加个战斗就OK了 #不知道怎么用的可以跟我拿范例 #animation_id =怪物反应动画 57,82行 #move_speed =怪物反应后的速度 1为最低,5为最高 #名字可以自己改在53,54行。 #============================================================================ # ■ Game_Character #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● 更新 #-------------------------------------------------------------------------- alias update_n03 update def update update_n03 seek_player end #-------------------------------------------------------------------------- # ●用追跡判定 #-------------------------------------------------------------------------- def distance_player return false if (@x - $game_player.x).abs > 3 return false if (@y - $game_player.y).abs > 3 return true end #-------------------------------------------------------------------------- # ●用追跡判定 #-------------------------------------------------------------------------- def distance_player2 return true if (@y - $game_player.y) == 0 return false end #-------------------------------------------------------------------------- # ● 用追跡判定 #-------------------------------------------------------------------------- def sight_out return false if (@x - $game_player.x).abs < 5 return false if (@y - $game_player.y).abs < 5 return true end #-------------------------------------------------------------------------- # ● 用追跡判定 #-------------------------------------------------------------------------- def seek_player return if @event == nil return special_seek if @event.name == "enemy2" return if @event.name != "enemy" return if @transparent if !@seeking && distance_player @animation_id = 93 @remain = [@move_type, @move_speed] @seeking = true @move_type = 2 @move_speed = 3 elsif @seeking && sight_out @seeking = false if @remain != nil @move_type = @remain[0] @move_speed = @remain[1] end end end #-------------------------------------------------------------------------- # ● 特殊追跡 #-------------------------------------------------------------------------- def special_seek if !@seeking && distance_player2 @animation_id = 93 @remain = [@move_type, @move_speed] @seeking = true @move_type = 2 @move_speed = 4 end end end
360.7 KB, 下载次数: 87
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |