脚本快捷方式
# @taroxd metadata 1.0
# @require taroxd_core
# @id eval
# @display 脚本快捷方式
# @deprecated 
module Taroxd::Eval

  Game_Character.send   :include, self
  Game_Interpreter.send :include, self
  # 脚本中的简称列表
  SCRIPT_ABBR_LIST = {
    'V' => '$game_variables',
    'S' => '$game_switches',
    'N' => '$game_actors',
    'A' => '$game_actors',
    'P' => '$game_party',
    'G' => '$game_party.gold',
    'E' => '$game_troop'
  }
  # 处理脚本用的正则表达式
  words = SCRIPT_ABBR_LIST.keys.join('|')
  SCRIPT_ABBR_RE = /(?<!::|['"\\\.])\b(?:#{words})\b(?! *[(@$\w'"])/


  module_function

  def process_script(script)
    script.gsub(SCRIPT_ABBR_RE, SCRIPT_ABBR_LIST)
  end

  def eval(script, *args)
    v = $game_variables
    s = $game_switches
    n = $game_actors
    a = $game_actors
    p = $game_party
    g = $game_party.gold
    e = $game_troop
    script = process_script(script)
    if args.empty?
      instance_eval(script, __FILE__, __LINE__)
    else
      Kernel.eval(script, *args)
    end
  end
end

class RPG::UsableItem::Damage
  def eval(a, b, v)
    value = Taroxd::Eval.eval(@formula, b.formula_binding(a, b, v))
    value > 0 ? value * sign : 0
  end
end

class Game_BattlerBase
  def formula_binding(a, b, v)
    s = $game_switches
    n = $game_actors
    p = $game_party
    g = $game_party.gold
    e = $game_troop
    binding
  end
end

class Window_Base < Window
  # 对 #{} 的处理
  process_expression = Proc.new do |old|
    old.gsub(/\e?#(?<brace>\{([^{}]|\g<brace>)*\})/) do |code|
      next code if code.slice!(0) == "\e"
      Taroxd::Eval.eval code[1..-2]
    end
  end
  def_with :convert_escape_characters, process_expression
end
调整敌人位置
# @taroxd metadata 1.0
# @require taroxd_core
# @id enemy_offset
# @display 调整敌人位置
# @help 

Taroxd::EnemyOffset = true

class RPG::Enemy < RPG::BaseItem
  note_i :offset_x
  note_i :offset_y
end

class Game_Troop
  def_after :setup do |_|
    @enemies.each do |enemy|
      enemy.screen_x += enemy.enemy.offset_x
      enemy.screen_y += enemy.enemy.offset_y
    end
  end
end
同名敌人不显示后缀
# @taroxd metadata 1.0
# @id enemy_no_suffix
# @display 同名敌人不显示后缀
# @require taroxd_core
# @help 同名的敌人不附加字母后缀
Taroxd::EnemyNoSuffix = false

class Game_Troop < Game_Unit
  def_after(:make_unique_names) { each { |enemy| enemy.letter = '' } }
end