- #============================================================================== 
- # ■ 开关/变量在事件中简写 
- #------------------------------------------------------------------------------ 
- # 超级无用脚本,仅仅是不想打字而已。 
- # 使用方法:在可以输入脚本的地方输入\S[ID]表示ID号开关(true/false) 
- #           输入\V[ID]表示ID号变量(数字) 
- #============================================================================== 
-   
- # 移动路线里面的脚本 
-   
- class Game_Character 
-   # 重定义 move_type_custom 
-   alias mtc_swi move_type_custom 
-   def move_type_custom 
-     if @move_route.list[@move_route_index].code == 45 # 当执行内容是脚本时 
-       command.parameters[0].gsub!(/\\s\[(\d+)\]/i) do 
-         $game_switches[$1.to_i] ? "true" : "false"    # 替换开关 
-       end 
-       command.parameters[0].gsub!(/\\v\[(\d+)\]/i) do  # 替换变量 
-         $game_variables[$1.to_i].to_s 
-       end 
-     end 
-     mtc_swi # 刚刚加上去的,汗 
-   end 
- end 
-   
- # 事件中条件分歧的脚本和脚本 
- # 偷懒了,条件分歧里的直接替换了……应该没什么脚本在里面 
- class Game_Interpreter 
-   def command_111 
-     result = false 
-     case @params[0] 
-     when 0  # 开关 
-       result = ($game_switches[@params[1]] == (@params[2] == 0)) 
-     when 1  # 变量 
-       value1 = $game_variables[@params[1]] 
-       if @params[2] == 0 
-         value2 = @params[3] 
-       else 
-         value2 = $game_variables[@params[3]] 
-       end 
-       case @params[4] 
-       when 0  # 数值 1 等于 数值 2  
-         result = (value1 == value2) 
-       when 1  # 数值 1 大于或等于 数值 2  
-         result = (value1 >= value2) 
-       when 2  # 数值 1 小于等于 数值 2  
-         result = (value1 <= value2) 
-       when 3  # 数值 1 大于 数值 2  
-         result = (value1 > value2) 
-       when 4  # 数值 1 小于 数值 2  
-         result = (value1 < value2) 
-       when 5  # 数值 1 不等于 数值 2  
-         result = (value1 != value2) 
-       end 
-     when 2  # 独立开关 
-       if @original_event_id > 0 
-         key = [@map_id, @original_event_id, @params[1]] 
-         if @params[2] == 0 
-           result = ($game_self_switches[key] == true) 
-         else 
-           result = ($game_self_switches[key] != true) 
-         end 
-       end 
-     when 3  # 计时器 
-       if $game_system.timer_working 
-         sec = $game_system.timer / Graphics.frame_rate 
-         if @params[2] == 0 
-           result = (sec >= @params[1]) 
-         else 
-           result = (sec <= @params[1]) 
-         end 
-       end 
-     when 4  # 角色 
-       actor = $game_actors[@params[1]] 
-       if actor != nil 
-         case @params[2] 
-         when 0  # 角色在队伍中 
-           result = ($game_party.members.include?(actor)) 
-         when 1  # 角色名称 
-           result = (actor.name == @params[3]) 
-         when 2  # 角色已学会技能 
-           result = (actor.skill_learn?($data_skills[@params[3]])) 
-         when 3  # 角色已装备武器 
-           result = (actor.weapons.include?($data_weapons[@params[3]])) 
-         when 4  # 角色已装备武器 
-           result = (actor.armors.include?($data_armors[@params[3]])) 
-         when 5  # 状态 
-           result = (actor.state?(@params[3])) 
-         end 
-       end 
-     when 5  # 敌人 
-       enemy = $game_troop.members[@params[1]] 
-       if enemy != nil 
-         case @params[2] 
-         when 0  # 出现 
-           result = (enemy.exist?) 
-         when 1  # 状态为… 
-           result = (enemy.state?(@params[3])) 
-         end 
-       end 
-     when 6  # 角色 
-       character = get_character(@params[1]) 
-       if character != nil 
-         result = (character.direction == @params[2]) 
-       end 
-     when 7  # 金钱 
-       if @params[2] == 0 
-         result = ($game_party.gold >= @params[1]) 
-       else 
-         result = ($game_party.gold <= @params[1]) 
-       end 
-     when 8  # 物品 
-       result = $game_party.has_item?($data_items[@params[1]]) 
-     when 9  # 武器 
-       result = $game_party.has_item?($data_weapons[@params[1]], @params[2]) 
-     when 10  # 防具 
-       result = $game_party.has_item?($data_armors[@params[1]], @params[2]) 
-     when 11  # 按钮 
-       result = Input.press?(@params[1]) 
-     when 12  # 脚本 
-       #==================================================== 
-       @params[1].gsub!(/\\s\[(\d+)\]/i) do  # 替换开关 
-         $game_switches[$1.to_i] ? "true" : "false" 
-       end 
-       @params[1].gsub!(/\\v\[(\d+)\]/i) do  # 替换变量 
-         $game_variables[$1.to_i].to_s 
-       end 
-       #==================================================== 
-       result = eval(@params[1]) 
-     when 13  # 交通工具 
-       result = ($game_player.vehicle_type == @params[1]) 
-     end 
-     @branch[@indent] = result     # 判断结果保存在 hash 中 
-     if @branch[@indent] == true 
-       @branch.delete(@indent) 
-       return true 
-     end 
-     return command_skip 
-   end 
-   
-   def command_355 
-     script = @list[@index].parameters[0] + "\n" 
-     loop do 
-       if @list[@index+1].code == 655 # 下一个事件指令在脚本2行以上的情况下 
-         script += @list[@index+1].parameters[0] + "\n" 
-       else 
-         break 
-       end 
-       @index += 1 
-     end 
-     script.gsub!(/\\s\[(\d+)\]/i) do  # 替换开关 
-       $game_switches[$1.to_i] ? "true" : "false" 
-     end 
-     script.gsub!(/\\v\[(\d+)\]/i) do  # 替换变量 
-       $game_variables[$1.to_i].to_s 
-     end 
-     eval(script) 
-     return true 
-   end 
- end