本帖最后由 英顺的马甲 于 2016-7-31 01:52 编辑
Scene_Battle = Class.new(Scene_Battle) { superclass.constants.each{|c|const_set(c, superclass.const_get(c))} const_set(:ACIION_RESULT_HOOKED, true) [:make_item_action_result, :make_skill_action_result].each do |m| define_method(m) do |*a| super(*a) if @common_event_id > 0 $game_system.battle_interpreter.instance_variable_set(:@attacker, @active_battler) $game_system.battle_interpreter.instance_variable_set(:@targets, @target_battlers) end end end } unless Scene_Battle.const_defined?(:ACIION_RESULT_HOOKED)
Scene_Battle = Class.new(Scene_Battle) {
superclass.constants.each{|c|const_set(c, superclass.const_get(c))}
const_set(:ACIION_RESULT_HOOKED, true)
[:make_item_action_result, :make_skill_action_result].each do |m|
define_method(m) do |*a|
super(*a)
if @common_event_id > 0
$game_system.battle_interpreter.instance_variable_set(:@attacker, @active_battler)
$game_system.battle_interpreter.instance_variable_set(:@targets, @target_battlers)
end
end
end
} unless Scene_Battle.const_defined?(:ACIION_RESULT_HOOKED)
用了这脚本后公共事件内就可以用脚本来获取攻击者及对象
@attacker 是攻击者
@targets 是对象的数组
虽然并不清楚能不能实现你想要的效果== |