Project1

标题: 求个锁定飞艇的脚本。。。 [打印本页]

作者: 是猪别乱叫    时间: 2017-4-6 08:18
标题: 求个锁定飞艇的脚本。。。
当人物乘上飞艇时,除非某开关打开,否则就永远下不来。
(因为我是通过事件脚本来控制人物移动的,某些转换场景的时候总是自动下乘,并找不到飞艇了...)
作者: 魔法丶小肉包    时间: 2017-4-6 11:57
如果是飞艇的话,1号开关打开才可以降落
RUBY 代码复制
  1. class Game_Vehicle < Game_Character
  2.   def land_ok?(x, y, d)
  3.     if @type == :airship
  4.       return false unless $game_map.airship_land_ok?(x, y)
  5.       return false unless $game_map.events_xy(x, y).empty?
  6.       return false unless $game_switches[1]
  7.     else
  8.       x2 = $game_map.round_x_with_direction(x, d)
  9.       y2 = $game_map.round_y_with_direction(y, d)
  10.       return false unless $game_map.valid?(x2, y2)
  11.       return false unless $game_map.passable?(x2, y2, reverse_dir(d))
  12.       return false if collide_with_characters?(x2, y2)
  13.     end
  14.     return true
  15.   end
  16. end

作者: huivincent    时间: 2024-4-15 23:19
我也弄了个飞艇呼叫器。

  1. class Game_Interpreter
  2.   def 放下载具(type = '小舟')
  3.     x = $game_map.round_x_with_direction($game_player.x, $game_player.direction)
  4.     y = $game_map.round_y_with_direction($game_player.y, $game_player.direction)
  5.     if type == '小舟' && $game_map.boat_passable?(x, y)
  6.       vehicle = $game_map.vehicles[0]
  7.       vehicle.set_location($game_map.map_id, x, y) if vehicle
  8.       true
  9.     elsif type == '大船' && $game_map.ship_passable?(x, y)
  10.       vehicle = $game_map.vehicles[1]
  11.       vehicle.set_location($game_map.map_id, x, y) if vehicle
  12.       true
  13.       elsif type == '飞艇' && $game_map.airship_land_ok?(x, y)
  14.       vehicle = $game_map.vehicles[2]
  15.       vehicle.set_location($game_map.map_id, x, y) if vehicle
  16.       true
  17.     else false end
  18.   end
  19. end
复制代码





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