赞 | 0 |
VIP | 20 |
好人卡 | 50 |
积分 | 66 |
经验 | 109503 |
最后登录 | 2023-5-23 |
在线时间 | 2492 小时 |
Lv4.逐梦者
- 梦石
- 3
- 星屑
- 3605
- 在线时间
- 2492 小时
- 注册时间
- 2014-10-5
- 帖子
- 1768
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
module EventHelper def self.get_rpg_event(event_id, map_id=$game_map.map_id) map = $game_map.instance_variable_get(:@map) if map_id != $game_map.map_id map = load_data(sprintf("Data/Map%03d.rvdata2", map_id)) end return map.events[event_id] end ICE_REGION = 9 # 溜冰区域 end # 溜冰 class Game_Player alias ice_move_straight move_straight def move_straight(d, turn_ok = true) old_real_x, old_real_y = @real_x, @real_y n = ($game_player.region_id == EventHelper::ICE_REGION ? 1+rand(3) : 1) n.times { ice_move_straight(d, turn_ok) } @real_x, @real_y = old_real_x, old_real_y end alias ice_update_anime_pattern update_anime_pattern def update_anime_pattern ice_update_anime_pattern @pattern = @original_pattern if $game_player.region_id == EventHelper::ICE_REGION end end # 下一条字幕转脚本 by 晴兰 class Game_Interpreter def 字幕脚本 x,y = @index+1, @list if y[x].code==105 y[x].code = 355 y[x].parameters = [''] y[x].code = 655 while y[x+=1].code == 405 end end def hit_test_player evt = $game_map.events[@event_id] return (evt.x==$game_player.x and evt.y==$game_player.y) end def hit_test_event(ss="D") evt = $game_map.events[@event_id] list = $game_map.events.values.select{|e| e.x==evt.x and e.y==evt.y and !(e.erased)} if list.size > 1 list.each {|e| $game_self_switches[[$game_map.map_id, e.id, ss]] = true } end end # 点灯游戏和引爆器的4向触发器(十字型触发) def trigger_4way(kwargs={}) range = kwargs[:range] || (1..1) ss = kwargs[:self_switch] || "D" flip = kwargs[:flip] || false evt = $game_map.events[@event_id] list=[evt] range.each{|r| list += $game_map.events_xy(evt.x+r, evt.y) + $game_map.events_xy(evt.x-r, evt.y) + $game_map.events_xy(evt.x, evt.y+r) + $game_map.events_xy(evt.x, evt.y-r) } list.uniq! ntrue = list.select{|e|$game_self_switches[[$game_map.map_id, e.id, ss]]}.size list.each {|e| $game_self_switches[[$game_map.map_id, e.id, ss]] = flip ? (!$game_self_switches[[$game_map.map_id, e.id, ss]]) : true } ntrue_new = list.select{|e|$game_self_switches[[$game_map.map_id, e.id, ss]]}.size return ntrue_new - ntrue #返回:触发区域内增加的打开的独立开关的个数 end # 两个事件之间的坐标距离 def event_dist(a, b) ($game_map.events[a].x - $game_map.events[b].x).abs + ($game_map.events[a].y - $game_map.events[b].y).abs end end class Game_Event attr_accessor :id attr_accessor :erased end class Game_Map # rpg_evt:需要刷新的事件RPG::Event, 用上面的get_rpg_event获得 # xy:坐标 # dir:朝向 # ss:需要打开的独立开关列表("ABCD") def spawn_event(rpg_evt, x, y, dir=2, ss="") new_id = 1 + @map.events.keys.max new_evt = RPG::Event.new(x, y) new_evt.id = new_id new_evt.pages = rpg_evt.pages @map.events[new_id] = new_evt @events[new_id] = Game_Event.new(@map_id, new_evt) @events[new_id].set_direction(dir) ss.each_char{|c| $game_self_switches[[@map_id, new_id, c]] = true } # 刷新图块 refresh_tile_events SceneManager.scene.instance_eval { @spriteset.refresh_characters } end end
module EventHelper
def self.get_rpg_event(event_id, map_id=$game_map.map_id)
map = $game_map.instance_variable_get(:@map)
if map_id != $game_map.map_id
map = load_data(sprintf("Data/Map%03d.rvdata2", map_id))
end
return map.events[event_id]
end
ICE_REGION = 9 # 溜冰区域
end
# 溜冰
class Game_Player
alias ice_move_straight move_straight
def move_straight(d, turn_ok = true)
old_real_x, old_real_y = @real_x, @real_y
n = ($game_player.region_id == EventHelper::ICE_REGION ? 1+rand(3) : 1)
n.times { ice_move_straight(d, turn_ok) }
@real_x, @real_y = old_real_x, old_real_y
end
alias ice_update_anime_pattern update_anime_pattern
def update_anime_pattern
ice_update_anime_pattern
@pattern = @original_pattern if $game_player.region_id == EventHelper::ICE_REGION
end
end
# 下一条字幕转脚本 by 晴兰
class Game_Interpreter
def 字幕脚本
x,y = @index+1, @list
if y[x].code==105
y[x].code = 355
y[x].parameters = ['']
y[x].code = 655 while y[x+=1].code == 405
end
end
def hit_test_player
evt = $game_map.events[@event_id]
return (evt.x==$game_player.x and evt.y==$game_player.y)
end
def hit_test_event(ss="D")
evt = $game_map.events[@event_id]
list = $game_map.events.values.select{|e|
e.x==evt.x and e.y==evt.y and !(e.erased)}
if list.size > 1
list.each {|e|
$game_self_switches[[$game_map.map_id, e.id, ss]] = true }
end
end
# 点灯游戏和引爆器的4向触发器(十字型触发)
def trigger_4way(kwargs={})
range = kwargs[:range] || (1..1)
ss = kwargs[:self_switch] || "D"
flip = kwargs[:flip] || false
evt = $game_map.events[@event_id]
list=[evt]
range.each{|r|
list += $game_map.events_xy(evt.x+r, evt.y) +
$game_map.events_xy(evt.x-r, evt.y) +
$game_map.events_xy(evt.x, evt.y+r) +
$game_map.events_xy(evt.x, evt.y-r)
}
list.uniq!
ntrue = list.select{|e|$game_self_switches[[$game_map.map_id, e.id, ss]]}.size
list.each {|e|
$game_self_switches[[$game_map.map_id, e.id, ss]] =
flip ? (!$game_self_switches[[$game_map.map_id, e.id, ss]]) : true
}
ntrue_new = list.select{|e|$game_self_switches[[$game_map.map_id, e.id, ss]]}.size
return ntrue_new - ntrue #返回:触发区域内增加的打开的独立开关的个数
end
# 两个事件之间的坐标距离
def event_dist(a, b)
($game_map.events[a].x - $game_map.events[b].x).abs +
($game_map.events[a].y - $game_map.events[b].y).abs
end
end
class Game_Event
attr_accessor :id
attr_accessor :erased
end
class Game_Map
# rpg_evt:需要刷新的事件RPG::Event, 用上面的get_rpg_event获得
# xy:坐标
# dir:朝向
# ss:需要打开的独立开关列表("ABCD")
def spawn_event(rpg_evt, x, y, dir=2, ss="")
new_id = 1 + @map.events.keys.max
new_evt = RPG::Event.new(x, y)
new_evt.id = new_id
new_evt.pages = rpg_evt.pages
@map.events[new_id] = new_evt
@events[new_id] = Game_Event.new(@map_id, new_evt)
@events[new_id].set_direction(dir)
ss.each_char{|c| $game_self_switches[[@map_id, new_id, c]] = true }
# 刷新图块
refresh_tile_events
SceneManager.scene.instance_eval { @spriteset.refresh_characters }
end
end
用于放置事件的发射器事件
这东西出现一个错误:就是在放置事件的时候,在切换完场景后再回到有发射器的场景那里。
再次发射的时候发射器里的子弹只前进一步就没了,过了较长时间此错误才自动消失。望能修复此bug。
由于重置的工会筹划奇遇记要用很多次发射器,切来切去子弹只跑一步...
这长篇将近一个g...
|
|