Project1
标题:
怎么让一个开关打开,地形标志1不可通行?
[打印本页]
作者:
1095884734
时间:
2011-7-6 16:34
标题:
怎么让一个开关打开,地形标志1不可通行?
怎么让一个开关打开,地形标志1不可通行? dsu_plus_rewardpost_czw
作者:
羽落花翎结
时间:
2011-7-6 17:07
在那个位置设置一个事件,事件图形在上方有一个写着(元件)的双击你想要的,然后事件出现条件那里,你说的开关打开为 ON
作者:
Wind2010
时间:
2011-7-6 17:33
class Game_Map
TERRAIN_ID = 906 # 906号开关打开时1号地形不能通行
def passable?(x, y, d, self_event = nil)
unless valid?(x, y)
return false
end
if $game_switches[TERRAIN_ID]
case d
when 0
go_x = x
go_y = y
when 2
go_x = x
go_y = y+1
when 4
go_x = x-1
go_y = y
when 6
go_x = x+1
go_y = y
when 8
go_x = x
go_y = y-1
end
return false if terrain_tag(go_x,go_y) == 1
end
bit = (1 << (d / 2 - 1)) & 0x0f
for event in events.values
if event.tile_id >= 0 and event != self_event and
event.x == x and event.y == y and not event.through
if @passages[event.tile_id] & bit != 0
return false
elsif @passages[event.tile_id] & 0x0f == 0x0f
return false
elsif @priorities[event.tile_id] == 0
return true
end
end
end
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return false
elsif @passages[tile_id] & bit != 0
return false
elsif @passages[tile_id] & 0x0f == 0x0f
return false
elsif @priorities[tile_id] == 0
return true
end
end
return true
end
end
复制代码
未经试验
作者:
160445706
时间:
2011-7-6 19:57
本帖最后由 160445706 于 2011-7-8 14:25 编辑
在
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
复制代码
后面
插入:
if $game_map.terrain_tag(new_x,new_y)==1 and $game_switches[100]==true
return false
else
return true
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1