Project1

标题: 跟随脚本求改人物死亡不在大地图上显示其行走图 [打印本页]

作者: 无名小兵    时间: 2009-7-4 21:57
标题: 跟随脚本求改人物死亡不在大地图上显示其行走图
本帖最后由 无名小兵 于 2009-7-4 23:01 编辑

跟随脚本求改人物死亡不在大地图上显示其行走图,奉上跟随脚本。

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


# ————————————————————————————————————

# ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
# by fukuyama

#
# Train_Actor
#
# [email protected]
# http://www4.big.or.jp/~fukuyama/rgss/Train_Actor.txt
#

module Train_Actor




#是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
#开关打开,跟随的人物就消失了(其实只是变成透明而已)
TRANSPARENT_SWITCH = false
TRANSPARENT_SWITCHES_INDEX = 20
#举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。





#跟随人数的最大数目,可以更改为2、3什么的。
TRAIN_ACTOR_SIZE_MAX = 5





# 定数
#Input::DOWN = 2
#Input::LEFT = 4
#Input::RIGHT = 6
#Input::UP = 6
DOWN_LEFT = 1
DOWN_RIGHT = 3
UP_LEFT = 7
UP_RIGHT = 9
JUMP = 5

class Game_Party_Actor < Game_Character
def initialize
super()
@through = true
end
def setup(actor)
# キャラクターのファイル名と色相を設定
if actor != nil
@character_name = actor.character_name
@character_hue = actor.character_hue
#========此处修改=================
@animation_loop_id = actor.tz_id != -1 ? TaoZhuan::EQUIP[actor.tz_id][18] : 0
#=================================
else
@character_name = ""
@character_hue = 0
end
# 不透明度と合成方法を初期化
@opacity = 255
@blend_type = 0
end
def screen_z(height = 0)
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z(height) - 1
end
super(height)
end
#--------------------------------------------------------------------------
# ● 下に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# 下を向く
if turn_enabled
turn_down
end
# 通行可能な場合
if passable?(@x, @y, Input::DOWN)
# 下を向く
turn_down
# 座標を更新
@y += 1
end
end
#--------------------------------------------------------------------------
# ● 左に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# 左を向く
if turn_enabled
turn_left
end
# 通行可能な場合
if passable?(@x, @y, Input::LEFT)
# 左を向く
turn_left
# 座標を更新
@x -= 1
end
end
#--------------------------------------------------------------------------
# ● 右に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# 右を向く
if turn_enabled
turn_right
end
# 通行可能な場合
if passable?(@x, @y, Input::RIGHT)
# 右を向く
turn_right
# 座標を更新
@x += 1
end
end
#--------------------------------------------------------------------------
# ● 上に移動
# turn_enabled : その場での向き変更を許可するフラグ
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# 上を向く
if turn_enabled
turn_up
end
# 通行可能な場合
if passable?(@x, @y, Input::UP)
# 上を向く
turn_up
# 座標を更新
@y -= 1
end
end
#--------------------------------------------------------------------------
# ● 左下に移動
#--------------------------------------------------------------------------
def move_lower_left
# 向き固定でない場合
unless @direction_fix
# 右向きだった場合は左を、上向きだった場合は下を向く
@direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
end
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
# 座標を更新
@x -= 1
@y += 1
end
end
#--------------------------------------------------------------------------
# ● 右下に移動
#--------------------------------------------------------------------------
def move_lower_right
# 向き固定でない場合
unless @direction_fix
# 左向きだった場合は右を、上向きだった場合は下を向く
@direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
end
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
# 座標を更新
@x += 1
@y += 1
end
end
#--------------------------------------------------------------------------
# ● 左上に移動
#--------------------------------------------------------------------------
def move_upper_left
# 向き固定でない場合
unless @direction_fix
# 右向きだった場合は左を、下向きだった場合は上を向く
@direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
end
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
# 座標を更新
@x -= 1
@y -= 1
end
end
#--------------------------------------------------------------------------
# ● 右上に移動
#--------------------------------------------------------------------------
def move_upper_right
# 向き固定でない場合
unless @direction_fix
# 左向きだった場合は右を、下向きだった場合は上を向く
@direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
end
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
# 座標を更新
@x += 1
@y -= 1
end
end
attr_writer :move_speed
attr_writer :step_anime
end
module Spriteset_Map_Module
def setup_actor_character_sprites?
return @setup_actor_character_sprites_flag != nil
end
def setup_actor_character_sprites(characters)
if !setup_actor_character_sprites?
index_game_player = 0
@character_sprites.each_index do |i|
if @character_sprites.character.instance_of?(Game_Player)
index_game_player = i
break
end
end
for character in characters.reverse
@character_sprites.unshift(
Sprite_Character.new(@viewport1, character)
)
end
@setup_actor_character_sprites_flag = true
end
end
end
module Scene_Map_Module
def setup_actor_character_sprites(characters)
@spriteset.setup_actor_character_sprites(characters)
end
end
module Game_Party_Module
def set_transparent_actors(transparent)
@transparent = transparent
end
def setup_actor_character_sprites
if @characters == nil
@characters = []
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters.push(Game_Party_Actor.new)
end
end
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters[i - 1].setup(actors)
end
if $scene.class.method_defined?('setup_actor_character_sprites')
$scene.setup_actor_character_sprites(@characters)
end
end
def update_party_actors
setup_actor_character_sprites
transparent = $game_player.transparent
if transparent == false
if TRANSPARENT_SWITCH
transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
end
end
for character in @characters
character.transparent = transparent
character.move_speed = $game_player.move_speed
character.step_anime = $game_player.step_anime
character.update
end
end
def moveto_party_actors( x, y )
setup_actor_character_sprites
for character in @characters
character.moveto( x, y )
end
if @move_list == nil
@move_list = []
end
move_list_setup
end
def move_party_actors
if @move_list == nil
@move_list = []
move_list_setup
end
@move_list.each_index do |i|
if @characters != nil
case @move_list.type
when Input::DOWN
@characters.move_down(@move_list.args[0])
when Input::LEFT
@characters.move_left(@move_list.args[0])
when Input::RIGHT
@characters.move_right(@move_list.args[0])
when Input::UP
@characters.move_up(@move_list.args[0])
when DOWN_LEFT
@characters.move_lower_left
when DOWN_RIGHT
@characters.move_lower_right
when UP_LEFT
@characters.move_upper_left
when UP_RIGHT
@characters.move_upper_right
when JUMP
@characters.jump(@move_list.args[0],@move_list.args[1])
end
end
end
end
class Move_List_Element
def initialize(type,args)
@type = type
@args = args
end
def type() return @type end
def args() return @args end
end
def move_list_setup
for i in 0 .. TRAIN_ACTOR_SIZE_MAX
@move_list = nil
end
end
def add_move_list(type,*args)
@move_list.unshift(Move_List_Element.new(type,args)).pop
end
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::DOWN,turn_enabled)
end
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::LEFT,turn_enabled)
end
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::RIGHT,turn_enabled)
end
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::UP,turn_enabled)
end
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
end
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
end
def move_upper_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
end
def move_upper_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
end
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
end
end
module Game_Player_Module
def update
$game_party.update_party_actors
super
end
def moveto( x, y )
$game_party.moveto_party_actors( x, y )
super( x, y )
end
def move_down(turn_enabled = true)
if passable?(@x, @y, Input::DOWN)
$game_party.move_down_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_left(turn_enabled = true)
if passable?(@x, @y, Input::LEFT)
$game_party.move_left_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_right(turn_enabled = true)
if passable?(@x, @y, Input::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_up(turn_enabled = true)
if passable?(@x, @y, Input::UP)
$game_party.move_up_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_lower_left
# 下→左、左→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
$game_party.move_lower_left_party_actors
end
super
end
def move_lower_right
# 下→右、右→下 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
$game_party.move_lower_right_party_actors
end
super
end
def move_upper_left
# 上→左、左→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
$game_party.move_upper_left_party_actors
end
super
end
def move_upper_right
# 上→右、右→上 のどちらかのコースが通行可能な場合
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
$game_party.move_upper_right_party_actors
end
super
end
def jump(x_plus, y_plus)
# 新しい座標を計算
new_x = @x + x_plus
new_y = @y + y_plus
# 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
$game_party.jump_party_actors(x_plus, y_plus)
end
super(x_plus, y_plus)
end
attr_reader :move_speed
attr_reader :step_anime
end
end # module Train_Actor
class Game_Party
include Train_Actor::Game_Party_Module
end
class Game_Player
include Train_Actor::Game_Player_Module
end
class Spriteset_Map
include Train_Actor::Spriteset_Map_Module
end
class Scene_Map
include Train_Actor::Scene_Map_Module
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
作者: ONEWateR    时间: 2009-7-4 22:10
本帖最后由 ONEWateR 于 2009-7-4 22:13 编辑

没办法,一识别Smilies就像ls一样~ = =
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================


  4. # ————————————————————————————————————

  5. # ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
  6. # by fukuyama

  7. #
  8. # Train_Actor
  9. #
  10. # [email][email protected][/email]
  11. # [url]http://www4.big.or.jp/~fukuyama/rgss/Train_Actor.txt[/url]
  12. #

  13. module Train_Actor




  14. #是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
  15. #开关打开,跟随的人物就消失了(其实只是变成透明而已)
  16. TRANSPARENT_SWITCH = false
  17. TRANSPARENT_SWITCHES_INDEX = 20
  18. #举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。





  19. #跟随人数的最大数目,可以更改为2、3什么的。
  20. TRAIN_ACTOR_SIZE_MAX = 4





  21. # 定数
  22. #Input::DOWN = 2
  23. #Input::LEFT = 4
  24. #Input::RIGHT = 6
  25. #Input::UP = 6
  26. DOWN_LEFT = 1
  27. DOWN_RIGHT = 3
  28. UP_LEFT = 7
  29. UP_RIGHT = 9
  30. JUMP = 5

  31. class Game_Party_Actor < Game_Character
  32. def initialize
  33. super()
  34. @through = true
  35. end
  36. def setup(actor)
  37. # キャラクターのファイル名と色相を設定
  38. if actor != nil
  39. @character_name = actor.character_name
  40. @character_hue = actor.character_hue
  41. #========此处修改=================
  42. @animation_loop_id = actor.tz_id != -1 ? TaoZhuan::EQUIP[actor.tz_id][18] : 0
  43. #=================================
  44. else
  45. @character_name = ""
  46. @character_hue = 0
  47. end
  48. # 不透明度と合成方法を初期化
  49. @opacity = 255
  50. @blend_type = 0
  51. end
  52. def screen_z(height = 0)
  53. if $game_player.x == @x and $game_player.y == @y
  54. return $game_player.screen_z(height) - 1
  55. end
  56. super(height)
  57. end
  58. #--------------------------------------------------------------------------
  59. # ● 下に移動
  60. # turn_enabled : その場での向き変更を許可するフラグ
  61. #--------------------------------------------------------------------------
  62. def move_down(turn_enabled = true)
  63. # 下を向く
  64. if turn_enabled
  65. turn_down
  66. end
  67. # 通行可能な場合
  68. if passable?(@x, @y, Input::DOWN)
  69. # 下を向く
  70. turn_down
  71. # 座標を更新
  72. @y += 1
  73. end
  74. end
  75. #--------------------------------------------------------------------------
  76. # ● 左に移動
  77. # turn_enabled : その場での向き変更を許可するフラグ
  78. #--------------------------------------------------------------------------
  79. def move_left(turn_enabled = true)
  80. # 左を向く
  81. if turn_enabled
  82. turn_left
  83. end
  84. # 通行可能な場合
  85. if passable?(@x, @y, Input::LEFT)
  86. # 左を向く
  87. turn_left
  88. # 座標を更新
  89. @x -= 1
  90. end
  91. end
  92. #--------------------------------------------------------------------------
  93. # ● 右に移動
  94. # turn_enabled : その場での向き変更を許可するフラグ
  95. #--------------------------------------------------------------------------
  96. def move_right(turn_enabled = true)
  97. # 右を向く
  98. if turn_enabled
  99. turn_right
  100. end
  101. # 通行可能な場合
  102. if passable?(@x, @y, Input::RIGHT)
  103. # 右を向く
  104. turn_right
  105. # 座標を更新
  106. @x += 1
  107. end
  108. end
  109. #--------------------------------------------------------------------------
  110. # ● 上に移動
  111. # turn_enabled : その場での向き変更を許可するフラグ
  112. #--------------------------------------------------------------------------
  113. def move_up(turn_enabled = true)
  114. # 上を向く
  115. if turn_enabled
  116. turn_up
  117. end
  118. # 通行可能な場合
  119. if passable?(@x, @y, Input::UP)
  120. # 上を向く
  121. turn_up
  122. # 座標を更新
  123. @y -= 1
  124. end
  125. end
  126. #--------------------------------------------------------------------------
  127. # ● 左下に移動
  128. #--------------------------------------------------------------------------
  129. def move_lower_left
  130. # 向き固定でない場合
  131. unless @direction_fix
  132. # 右向きだった場合は左を、上向きだった場合は下を向く
  133. @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
  134. end
  135. # 下→左、左→下 のどちらかのコースが通行可能な場合
  136. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  137. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  138. # 座標を更新
  139. @x -= 1
  140. @y += 1
  141. end
  142. end
  143. #--------------------------------------------------------------------------
  144. # ● 右下に移動
  145. #--------------------------------------------------------------------------
  146. def move_lower_right
  147. # 向き固定でない場合
  148. unless @direction_fix
  149. # 左向きだった場合は右を、上向きだった場合は下を向く
  150. @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
  151. end
  152. # 下→右、右→下 のどちらかのコースが通行可能な場合
  153. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  154. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  155. # 座標を更新
  156. @x += 1
  157. @y += 1
  158. end
  159. end
  160. #--------------------------------------------------------------------------
  161. # ● 左上に移動
  162. #--------------------------------------------------------------------------
  163. def move_upper_left
  164. # 向き固定でない場合
  165. unless @direction_fix
  166. # 右向きだった場合は左を、下向きだった場合は上を向く
  167. @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
  168. end
  169. # 上→左、左→上 のどちらかのコースが通行可能な場合
  170. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  171. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  172. # 座標を更新
  173. @x -= 1
  174. @y -= 1
  175. end
  176. end
  177. #--------------------------------------------------------------------------
  178. # ● 右上に移動
  179. #--------------------------------------------------------------------------
  180. def move_upper_right
  181. # 向き固定でない場合
  182. unless @direction_fix
  183. # 左向きだった場合は右を、下向きだった場合は上を向く
  184. @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
  185. end
  186. # 上→右、右→上 のどちらかのコースが通行可能な場合
  187. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  188. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  189. # 座標を更新
  190. @x += 1
  191. @y -= 1
  192. end
  193. end
  194. attr_writer :move_speed
  195. attr_writer :step_anime
  196. end
  197. module Spriteset_Map_Module
  198. def setup_actor_character_sprites?
  199. return @setup_actor_character_sprites_flag != nil
  200. end
  201. def setup_actor_character_sprites(characters)
  202. if !setup_actor_character_sprites?
  203. index_game_player = 0
  204. @character_sprites.each_index do |i|
  205. if @character_sprites[i].character.instance_of?(Game_Player)
  206. index_game_player = i
  207. break
  208. end
  209. end
  210. for character in characters.reverse
  211. @character_sprites.unshift(
  212. Sprite_Character.new(@viewport1, character)
  213. )
  214. end
  215. @setup_actor_character_sprites_flag = true
  216. end
  217. end
  218. end
  219. module Scene_Map_Module
  220. def setup_actor_character_sprites(characters)
  221. @spriteset.setup_actor_character_sprites(characters)
  222. end
  223. end
  224. module Game_Party_Module
  225. def set_transparent_actors(transparent)
  226. @transparent = transparent
  227. end
  228. def setup_actor_character_sprites
  229. if @characters == nil
  230. @characters = []
  231. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  232. @characters.push(Game_Party_Actor.new)
  233. end
  234. end
  235. new_actor = []
  236. for actor in actors
  237.   new_actor.push(actor) if !actor.dead?
  238. end

  239. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  240. @characters[i - 1].setup(new_actor[i])
  241. end


  242. if $scene.class.method_defined?('setup_actor_character_sprites')
  243. $scene.setup_actor_character_sprites(@characters)
  244. end
  245. end
  246. def update_party_actors
  247. setup_actor_character_sprites
  248. transparent = $game_player.transparent
  249. if transparent == false
  250. if TRANSPARENT_SWITCH
  251. transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
  252. end
  253. end
  254. for character in @characters
  255. character.transparent = transparent
  256. character.move_speed = $game_player.move_speed
  257. character.step_anime = $game_player.step_anime
  258. character.update
  259. end
  260. end
  261. def moveto_party_actors( x, y )
  262. setup_actor_character_sprites
  263. for character in @characters
  264. character.moveto( x, y )
  265. end
  266. if @move_list == nil
  267. @move_list = []
  268. end
  269. move_list_setup
  270. end
  271. def move_party_actors
  272. if @move_list == nil
  273. @move_list = []
  274. move_list_setup
  275. end
  276. @move_list.each_index do |i|
  277. if @characters[i] != nil
  278. case @move_list[i].type
  279. when Input::DOWN
  280. @characters[i].move_down(@move_list[i].args[0])
  281. when Input::LEFT
  282. @characters[i].move_left(@move_list[i].args[0])
  283. when Input::RIGHT
  284. @characters[i].move_right(@move_list[i].args[0])
  285. when Input::UP
  286. @characters[i].move_up(@move_list[i].args[0])
  287. when DOWN_LEFT
  288. @characters[i].move_lower_left
  289. when DOWN_RIGHT
  290. @characters[i].move_lower_right
  291. when UP_LEFT
  292. @characters[i].move_upper_left
  293. when UP_RIGHT
  294. @characters[i].move_upper_right
  295. when JUMP
  296. @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
  297. end
  298. end
  299. end
  300. end
  301. class Move_List_Element
  302. def initialize(type,args)
  303. @type = type
  304. @args = args
  305. end
  306. def type() return @type end
  307. def args() return @args end
  308. end
  309. def move_list_setup
  310. for i in 0 .. TRAIN_ACTOR_SIZE_MAX
  311. @move_list[i] = nil
  312. end
  313. end
  314. def add_move_list(type,*args)
  315. @move_list.unshift(Move_List_Element.new(type,args)).pop
  316. end
  317. def move_down_party_actors(turn_enabled = true)
  318. move_party_actors
  319. add_move_list(Input::DOWN,turn_enabled)
  320. end
  321. def move_left_party_actors(turn_enabled = true)
  322. move_party_actors
  323. add_move_list(Input::LEFT,turn_enabled)
  324. end
  325. def move_right_party_actors(turn_enabled = true)
  326. move_party_actors
  327. add_move_list(Input::RIGHT,turn_enabled)
  328. end
  329. def move_up_party_actors(turn_enabled = true)
  330. move_party_actors
  331. add_move_list(Input::UP,turn_enabled)
  332. end
  333. def move_lower_left_party_actors
  334. move_party_actors
  335. add_move_list(DOWN_LEFT)
  336. end
  337. def move_lower_right_party_actors
  338. move_party_actors
  339. add_move_list(DOWN_RIGHT)
  340. end
  341. def move_upper_left_party_actors
  342. move_party_actors
  343. add_move_list(UP_LEFT)
  344. end
  345. def move_upper_right_party_actors
  346. move_party_actors
  347. add_move_list(UP_RIGHT)
  348. end
  349. def jump_party_actors(x_plus, y_plus)
  350. move_party_actors
  351. add_move_list(JUMP,x_plus, y_plus)
  352. end
  353. end
  354. module Game_Player_Module
  355. def update
  356. $game_party.update_party_actors
  357. super
  358. end
  359. def moveto( x, y )
  360. $game_party.moveto_party_actors( x, y )
  361. super( x, y )
  362. end
  363. def move_down(turn_enabled = true)
  364. if passable?(@x, @y, Input::DOWN)
  365. $game_party.move_down_party_actors(turn_enabled)
  366. end
  367. super(turn_enabled)
  368. end
  369. def move_left(turn_enabled = true)
  370. if passable?(@x, @y, Input::LEFT)
  371. $game_party.move_left_party_actors(turn_enabled)
  372. end
  373. super(turn_enabled)
  374. end
  375. def move_right(turn_enabled = true)
  376. if passable?(@x, @y, Input::RIGHT)
  377. $game_party.move_right_party_actors(turn_enabled)
  378. end
  379. super(turn_enabled)
  380. end
  381. def move_up(turn_enabled = true)
  382. if passable?(@x, @y, Input::UP)
  383. $game_party.move_up_party_actors(turn_enabled)
  384. end
  385. super(turn_enabled)
  386. end
  387. def move_lower_left
  388. # 下→左、左→下 のどちらかのコースが通行可能な場合
  389. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  390. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  391. $game_party.move_lower_left_party_actors
  392. end
  393. super
  394. end
  395. def move_lower_right
  396. # 下→右、右→下 のどちらかのコースが通行可能な場合
  397. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  398. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  399. $game_party.move_lower_right_party_actors
  400. end
  401. super
  402. end
  403. def move_upper_left
  404. # 上→左、左→上 のどちらかのコースが通行可能な場合
  405. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  406. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  407. $game_party.move_upper_left_party_actors
  408. end
  409. super
  410. end
  411. def move_upper_right
  412. # 上→右、右→上 のどちらかのコースが通行可能な場合
  413. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  414. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  415. $game_party.move_upper_right_party_actors
  416. end
  417. super
  418. end
  419. def jump(x_plus, y_plus)
  420. # 新しい座標を計算
  421. new_x = @x + x_plus
  422. new_y = @y + y_plus
  423. # 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
  424. if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  425. $game_party.jump_party_actors(x_plus, y_plus)
  426. end
  427. super(x_plus, y_plus)
  428. end
  429. attr_reader :move_speed
  430. attr_reader :step_anime
  431. end
  432. end # module Train_Actor
  433. class Game_Party
  434. include Train_Actor::Game_Party_Module
  435. end
  436. class Game_Player
  437. include Train_Actor::Game_Player_Module
  438. end
  439. class Spriteset_Map
  440. include Train_Actor::Spriteset_Map_Module
  441. end
  442. class Scene_Map
  443. include Train_Actor::Scene_Map_Module
  444. end

  445. #==============================================================================
  446. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  447. #==============================================================================
复制代码

作者: 无名小兵    时间: 2009-7-4 22:57
:'(太感谢了。。。困惑我好久好久的问题就这样简单被你解决了。。。。非常感谢。。。。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1