Внимание!
Все дополнения требуют: Расширенные Настройки
Все дополнения устанавливать ниже основного скрипта и ниже зависимостей. Все зависимости и инструкции написаны в шапке скрипта
Внимание!
Все дополнения требуют: Расширенные Настройки
Все дополнения устанавливать ниже основного скрипта и ниже зависимостей. Все зависимости и инструкции написаны в шапке скрипта
Последний раз редактировалось DK; 17.10.2015 в 16:01.
Дополнение Настройки для Глобальные Настройки
Автор: Я (Денис Кузнецов)
Версия: 1.3 от 12.08.15
Тип: Добавляющий возможности
Скриншоты:
Спойлер Скриншоты:
Рекомендован к установке!
Данное дополнение позволяет настроить скрипт Глобальные Настройки
Спойлер Код:Код:=begin ############################################################################### # # # Аддон к Extended Settings # # # ############################################################################### Автор: Денис Кузнецов (http://vk.com/id8137201) Группа ВК: https://vk.com/scriptsrpgmakervxace Зависимости: Extended_Settings (Глобальные настройки) by Denis Kyznetsov (версия 1.2) Установка: разместить ниже зависимостей =end $Extended_Settings_Command_List.push({ :command_name => "Настройки скрипта", :command_symbol => :den_kyz_extended_settings_settings_command_symbol, :method => :den_kyz_extended_settings_settings_method, :enabled => true, :author => "Денис Кузнецов", :version => "1.3", :date => "12.08.15", :description => "Настройки главного скрипта VX ACE\nВы можете настроить следующие\nпараметры:\nСортировка списка, управление\nсписком, настройка анимации" }) module Extended_Settings_Settings # Начало настройки скрипта # Символ кнопки, которая вызывает этот скрипт в настройках EXTENDED_SETTINGS_SETTINGS_BUTTON = :Z # Конец настройки скрипта EXTENDED_SETTINGS_SETTINGS_COMMAND_LIST = [ "Сортировка списка", "Отображение списка", "Прочее" ] end # module Extended_Settings_Settings class Extended_Settings_Scene < Scene_Base def den_kyz_extended_settings_settings_method SceneManager.call(Extended_Settings_Settings_Scene) end alias den_kyz_extended_settings_settings_update update def update den_kyz_extended_settings_settings_update den_kyz_extended_settings_settings_method if Input.trigger?(Extended_Settings_Settings::EXTENDED_SETTINGS_SETTINGS_BUTTON) end end # class Extended_Settings_Scene < Scene_Base class Extended_Settings_Settings_Scene < Scene_Base include Extended_Settings_Settings def start @animation = 0 super create_command_window create_info_window end def create_command_window @create_command_window = Extended_Settings_Settings_Command_Window.new @create_command_window.set_handler(:cancel, method(:return_scene)) @create_command_window.set_handler(EXTENDED_SETTINGS_SETTINGS_COMMAND_LIST[0].to_sym, method(:create_control_command_window)) @create_command_window.set_handler(EXTENDED_SETTINGS_SETTINGS_COMMAND_LIST[1].to_sym, method(:create_control_command_window)) @create_command_window.set_handler(EXTENDED_SETTINGS_SETTINGS_COMMAND_LIST[2].to_sym, method(:setup_enable_settings)) end def create_info_window @create_info_window = Extended_Settings_Settings_Info_Window.new(@create_command_window) end def create_control_command_window dispose_control_command_window @create_control_command_window = Extended_Settings_Settings_Control_Command_Window.new(@create_command_window, @create_info_window) @create_control_command_window.set_handler(:cancel, method(:deactivate_control_window)) $Extended_Settings_Command_List.each do |index| @create_control_command_window.set_handler((index[:command_name] + "sort").to_sym, method(:setup_extended_list_sort)) end $Extended_Settings_Command_List.each do |index| @create_control_command_window.set_handler((index[:command_name] + "activate").to_sym, method(:setup_extended_list_enabled)) end @create_control_command_window.x = Graphics.width @create_command_window.deactivate @animation = 1 end def deactivate_control_window if @create_control_command_window.sort_index != -1 @create_control_command_window.sort_index = -1 return end @create_command_window.activate @animation = 2 while @animation != 0 update end dispose_control_command_window end def dispose_control_command_window return if @create_control_command_window.nil? @create_control_command_window.dispose @create_control_command_window = nil end # метод сортировки списка def setup_extended_list_sort if @create_control_command_window.sort_index == -1 @create_control_command_window.sort_index = @create_control_command_window.index else list_sort(@create_control_command_window.sort_index, @create_control_command_window.index) @create_control_command_window.sort_index = -1 end @create_info_window.force_update end # вызывается в методе сортировки списка. перестановка выбранных команд def list_sort(one, two) temp = $Extended_Settings_Command_List[one] $Extended_Settings_Command_List[one] = $Extended_Settings_Command_List[two] $Extended_Settings_Command_List[two] = temp end # вкл / выкл выбранную команду def setup_extended_list_enabled index = @create_control_command_window.index $Extended_Settings_Command_List[index][:enabled] = !$Extended_Settings_Command_List[index][:enabled] @create_control_command_window.activate @create_info_window.force_update end # вкл / выкл настройки def setup_enable_settings $Extended_Settings_Command_List.each do |index| index[:enabled] = !index[:enabled] if index[:command_symbol] == :den_kyz_extended_settings_settings_command_symbol end @create_command_window.activate @create_info_window.force_update end def update super play_animation if @animation != 0 end # 0 - выключена, 1 - смещение влево, 2 - смещение вправо def play_animation if @animation == 1 @create_info_window.width -= 15 @create_info_window.animation_update @create_control_command_window.x -= 15 if @create_control_command_window.x <= Graphics.width / 5 * 3 @create_info_window.width = Graphics.width / 5 * 3 @create_info_window.animation_update @create_control_command_window.x = Graphics.width / 5 * 3 @animation = 0 end else @create_info_window.width += 15 @create_info_window.animation_update @create_control_command_window.x += 15 if @create_control_command_window.x >= Graphics.width @create_info_window.width = Graphics.width @create_info_window.animation_update @create_control_command_window.x = Graphics.width @animation = 0 end end end end # class Extended_Settings_Settings_Scene < Scene_Base class Extended_Settings_Settings_Command_Window < Window_HorzCommand include Extended_Settings_Settings def initialize super(0, 0) end def col_max 3 end def window_width Graphics.width end def make_command_list EXTENDED_SETTINGS_SETTINGS_COMMAND_LIST.each do |index| add_command(index, index.to_sym) end end end # class Extended_Settings_Settings_Command_Window < Window_Command class Extended_Settings_Settings_Info_Window < Window_Base def initialize(create_command_window) @create_command_window = create_command_window super(0, line_height * 2, Graphics.width, Graphics.height - line_height * 2) end def animation_update create_contents force_update end def force_update @create_command_window_last_index = -1 update end def update return if @create_command_window_last_index == @create_command_window.index @create_command_window_last_index = @create_command_window.index contents.clear static_text = "" dynamic_text = "" case @create_command_window.index when 0 static_text = "\\c[14]Отсортируйте список команд\\c[0]\n\nСписок активных команд:\n" i = 1 $Extended_Settings_Command_List.each do |index| dynamic_text += i.to_s + ") " + index[:command_name] + "\n" if index[:enabled] i += 1 if index[:enabled] end when 1 static_text = "\\c[14]Отображение команд списка\\c[0]\n\nСписок команд:\n" i = 1 $Extended_Settings_Command_List.each do |index| command_enable = index[:enabled] dynamic_text += i.to_s + ") " + index[:command_name] dynamic_text += " (" + on_off_text_color(command_enable, command_enable) + on_off_text(command_enable) + ")" + "\n" i += 1 end when 2 static_text = "\\c[14]Отображение настроек в списке\\c[0]\n\nВы всегда можете вызвать их с помощью кнопки,\nнастроенной в скрипте\n\nОтображение: " command_enable = extended_settings_settings_enabled_in_list dynamic_text = on_off_text_color(command_enable, true) + on_off_text(true) + " " + on_off_text_color(command_enable, false) + on_off_text(false) end draw_text_ex(0, 0, static_text + dynamic_text) end def on_off_text_color(enable1, enable2) return "\\c[3]" if enable1 && enable2 return "\\c[2]" if !enable1 && !enable2 return "\\c[0]" end def on_off_text(enable) return "Вкл.\\c[0]" if enable return "Выкл.\\c[0]" end # информация о текущем скрипте в списке команд def extended_settings_settings_enabled_in_list array = $Extended_Settings_Command_List array.each_index do |i| return array[i][:enabled] if array[i][:command_symbol] == :den_kyz_extended_settings_settings_command_symbol end end end # class Extended_Settings_Settings_Info_Window < Window_Base class Extended_Settings_Settings_Control_Command_Window < Window_Command attr_accessor :sort_index def initialize(create_command_window, create_info_window) @create_command_window = create_command_window @create_info_window = create_info_window @sort_index = -1 # индекс первой команды для начала сортировки super(0, line_height * 2) end def sort_index=(sort_index) @sort_index = sort_index refresh activate end def window_width Graphics.width / 5 * 2 + 4 end def window_height Graphics.height - line_height * 2 end def draw_item(index) if index == @sort_index color = text_color(24) else color = normal_color end change_color(color, command_enabled?(index)) draw_text(item_rect_for_text(index), command_name(index), alignment) end def make_command_list case @create_command_window.index when 0 $Extended_Settings_Command_List.each do |index| add_command(index[:command_name], (index[:command_name] + "sort").to_sym) end when 1 $Extended_Settings_Command_List.each do |index| add_command(index[:command_name], (index[:command_name] + "activate").to_sym) end end end def cursor_pageup @create_info_window.oy += line_height @create_info_window.oy = 0 if @create_info_window.oy > 0 end def cursor_pagedown @create_info_window.oy -= line_height end end # class Extended_Settings_Settings_Control_Command_Window < Window_Command module DataManager class << self alias den_kyz_extended_settings_settings_make_save_contents make_save_contents alias den_kyz_extended_settings_settings_extract_save_contents extract_save_contents end def self.make_save_contents contents = den_kyz_extended_settings_settings_make_save_contents contents[:Extended_Settings_Command_List] = $Extended_Settings_Command_List contents end def self.extract_save_contents(contents) denis_kyznetsov_dt_mngr_extract_save_contents(contents) $Extended_Settings_Command_List = contents[:Extended_Settings_Command_List] end end # module DataManager
Последний раз редактировалось DK; 22.08.2015 в 13:33.
Дополнение для Время/Дата
Автор: Я (Денис Кузнецов)
Версия: 2.0 от 17.10.15
Тип: Добавляющий возможности
Скриншоты:
Спойлер Скриншоты:
Зависимости:
Глобальные Настройки: минимальная версия 2.0
Время/Дата: минимальная версия 6.0
Необязательные зависимости:
Погода (Game Weather): минимальная версия 3.0
Данное дополнение позволяет настроить скрипт Время/Дата, а также скрипт Погода (опционально)
Спойлер Код:Код:=begin ############################################################################### # # # Аддон к Extended Settings # # # ############################################################################### Автор: Денис Кузнецов (http://vk.com/id8137201) Группа ВК: https://vk.com/scriptsrpgmakervxace Зависимости: Game Time (Время/Дата) by Denis Kyznetsov (версия 6.0) Extended_Settings (Глобальные настройки) by Denis Kyznetsov (версия 2.0) Необязательная зависимость: Game Weather (Погода) by Denis Kyznetsov (версия 3.0) Установка: разместить ниже зависимостей У данного скрипта нет никаких настроек. Установите и используйте. =end $Extended_Settings_Command_List.push({ :command_name => "Время/Дата", :command_symbol => :den_kyz_game_time_settings_command_symbol, :method => :den_kyz_game_time_extended_settings_method, :enabled => true, :author => "Денис Кузнецов", :version => "2.0", :date => "17.10.15", :description => "Настройка скрипта Время/Дата и\nПогода для VX ACE" }) module Game_Time_Extended_Settings MAIN_COMMAND_LIST = ["Время/Дата", "Погода"] GAME_TIME_COMMAND_LIST = ["Время", "Дата", "Освещение", "Скорость времени", "Обновление времени"] GAME_WEATHER_COMMAND_LIST = ["Изменить погоду", "Остановить погоду", "Лимит погоды", "Сила погоды", "Погода в бою"] GAME_TIME_CLOCK = { :x => Graphics.width * 2 / 5, :y => 0, :width => Graphics.width * 3 / 5, :height => 72, :custom_clock_time => ["Час", ":", "Минуты"] } end # module Game_Time_Extended_Settings class Extended_Settings_Scene < Scene_Base def den_kyz_game_time_extended_settings_method SceneManager.call(Game_Time_Extended_Settings_Scene) if $imported["DenKyz_Game_Time"] end end # class Extended_Settings_Scene < Scene_Base class Game_Time_Extended_Settings_Scene < Scene_Base include Game_Time_Settings def start super create_main_command_window create_info_window create_control_command_window create_game_time_window end def create_main_command_window @create_main_command_window = Game_Time_Extended_Settings_Main_Command_Window.new @create_main_command_window.set_handler(:cancel, method(:return_scene)) @create_main_command_window.set_handler(:ok, method(:activate_control_window)) end def create_info_window dispose_info_window @create_info_window = Game_Time_Extended_Settings_Info_Window.new(@create_main_command_window) end def create_control_command_window @create_control_command_window = Game_Time_Extended_Settings_Control_Command_Window.new(@create_main_command_window) @create_control_command_window.deactivate @create_control_command_window.set_handler(:cancel, method(:deactivate_control_window)) @create_control_command_window.set_handler(:ok, method(:activate_process_window)) end def create_process_command_window dispose_process_command_window @create_process_command_window = Game_Time_Extended_Settings_Process_Command_Window.new(@create_main_command_window, @create_control_command_window) @create_process_command_window.set_handler(:cancel, method(:deactivate_process_command_window)) @create_process_command_window.set_handler(:change_game_time, method(:change_game_time)) @create_process_command_window.set_handler(:change_game_date, method(:change_game_date)) @create_process_command_window.set_handler(:use_khas_day_light, method(:change_use_khas_day_light)) @create_process_command_window.set_handler(:static_light_hour, method(:change_static_light_hour)) @create_process_command_window.set_handler(:time_speed, method(:change_time_speed)) @create_process_command_window.set_handler(:time_update, method(:change_time_update)) @create_process_command_window.set_handler(:change_game_weather_type, method(:change_game_weather_type)) @create_process_command_window.set_handler(:stop_game_weather, method(:stop_game_weather)) @create_process_command_window.set_handler(:change_game_weather_limit, method(:change_game_weather_limit)) @create_process_command_window.set_handler(:change_game_weather_power, method(:change_game_weather_power)) @create_process_command_window.set_handler(:change_game_weather_in_battle, method(:change_game_weather_in_battle)) end def create_game_time_window @create_game_time_window = Game_Time_Window.new(Game_Time_Extended_Settings::GAME_TIME_CLOCK) end def activate_control_window @create_main_command_window.deactivate @create_control_command_window.activate end def deactivate_control_window @create_main_command_window.activate @create_control_command_window.select(0) @create_control_command_window.deactivate end def activate_process_window dispose_info_window @create_control_command_window.deactivate create_process_command_window end def deactivate_process_command_window if @create_process_command_window.layer == 0 @create_control_command_window.activate create_info_window dispose_process_command_window else @create_process_command_window.layer = 0 end end def dispose_info_window return if @create_info_window.nil? @create_info_window.dispose @create_info_window = nil end def dispose_process_command_window return if @create_process_command_window.nil? @create_process_command_window.dispose @create_process_command_window = nil end def change_game_time sec = @create_process_command_window.sec min = @create_process_command_window.min hour = @create_process_command_window.hour day = $Game_Time.day dayweek = $Game_Time.dayweek + 1 month = $Game_Time.month + 1 year = $Game_Time.year $Game_Time.set_time(sec, min, hour, day, dayweek, month, year) deactivate_process_command_window end def change_game_date sec = $Game_Time.sec min = $Game_Time.min hour = $Game_Time.hour day = @create_process_command_window.day dayweek = @create_process_command_window.dayweek + 1 month = @create_process_command_window.month + 1 year = @create_process_command_window.year $Game_Time.set_time(sec, min, hour, day, dayweek, month, year) deactivate_process_command_window end def change_use_khas_day_light Game_Time_Functions.setup_use_khas_day_light(@create_process_command_window.use_khas_day_light) @create_process_command_window.layer = 1 end def change_static_light_hour $Game_Time_Tint.static_light_hour = @create_process_command_window.static_light_hour deactivate_process_command_window deactivate_process_command_window if GAME_TIME_KHAS_LIGHT && GAME_TIME_KHAS_LIGHT_SWITCH != -1 end def change_time_speed $Game_Time.time_speed = @create_process_command_window.time_speed deactivate_process_command_window end def change_time_update $Game_Time.time_update = @create_process_command_window.time_update deactivate_process_command_window end def change_game_weather_type $Game_Weather.weather[@create_process_command_window.game_weather_cursor].type = @create_process_command_window.game_weather_type deactivate_process_command_window end def stop_game_weather $Game_Weather.dispose_weather($Game_Weather.weather[@create_process_command_window.game_weather_cursor]) deactivate_process_command_window end def change_game_weather_limit $GAME_WEATHER_LIMIT = @create_process_command_window.game_weather_limit deactivate_process_command_window end def change_game_weather_power $GAME_WEATHER_POWER = @create_process_command_window.game_weather_power deactivate_process_command_window end def change_game_weather_in_battle $GAME_WEATHER_IN_BATTLE = @create_process_command_window.game_weather_in_battle deactivate_process_command_window end end # class Game_Time_Extended_Settings_Scene < Scene_Base class Game_Time_Extended_Settings_Main_Command_Window < Window_Command include Game_Time_Extended_Settings def initialize super(0, 0) end def window_width Graphics.width * 2 / 5 end def window_height line_height * 3 end def make_command_list MAIN_COMMAND_LIST.each do |index| add_command(index, :ok) end end end # class Game_Time_Settings_Command_Window < Window_Command class Game_Time_Extended_Settings_Info_Window < Window_Base def initialize(create_main_command_window) @create_main_command_window = create_main_command_window super(Graphics.width * 2 / 5, 72, Graphics.width * 3 / 5, Graphics.height - 72) end def update return if @create_main_command_window_last_index == @create_main_command_window.index @create_main_command_window_last_index = @create_main_command_window.index contents.clear case @create_main_command_window.index when 0 text = "Здесь можно изменить время и\nдату, а также управлять\nосвещением, скоростью времени\nи обновлением времени" when 1 text = "Здесь можно изменять настройки погоды\nизменять текущую погоду,\nуправлять лимитом, силой и\nбитвой" end draw_text_ex(0, contents_height / 3, text) end end # class Game_Time_Extended_Settings_Info_Window < Window_Base class Game_Time_Extended_Settings_Control_Command_Window < Window_Command include Game_Time_Extended_Settings def initialize(create_main_command_window) @create_main_command_window = create_main_command_window super(0, line_height * 3) end def window_width Graphics.width * 2 / 5 end def window_height Graphics.height - line_height * 3 end def make_command_list command_list = [] case @create_main_command_window.index when 0 command_list = GAME_TIME_COMMAND_LIST when 1 command_list = GAME_WEATHER_COMMAND_LIST if $imported["DenKyz_Game_Weather"] end command_list.each do |index| add_command(index, :ok) end end def update super # если мы перемещаемся по окну команд, то обновляем окно контроля return if @create_main_command_window_last_index == @create_main_command_window.index @create_main_command_window_last_index = @create_main_command_window.index refresh end end # class Game_Time_Extended_Settings_Control_Command_Window < Window_Command class Game_Time_Extended_Settings_Process_Command_Window < Window_Command include Game_Date_Settings, Game_Time_Settings attr_reader :layer attr_reader :sec attr_reader :min attr_reader :hour attr_reader :day attr_reader :dayweek attr_reader :month attr_reader :year attr_reader :use_khas_day_light attr_reader :static_light_hour attr_reader :time_speed attr_reader :time_update attr_reader :game_weather_cursor attr_reader :game_weather_type attr_reader :game_weather_limit attr_reader :game_weather_power attr_reader :game_weather_in_battle def initialize(create_main_command_window, create_control_command_window) @create_main_command_window = create_main_command_window @create_control_command_window = create_control_command_window @layer = 0 # какой уровень команд отображать setup_all_variables super(Graphics.width * 2 / 5, line_height * 3) end def setup_all_variables @sec = $Game_Time.sec @min = $Game_Time.min @hour = $Game_Time.hour @day = $Game_Time.day @dayweek = $Game_Time.dayweek % GAME_TIME_DAYS_WEEK.size @month = $Game_Time.month @year = $Game_Time.year @use_khas_day_light = $GAME_TIME_USE_KHAS_DAY_LIGHT @static_light_hour = $Game_Time_Tint.static_light_hour @time_speed = $Game_Time.time_speed @time_update = $Game_Time.time_update if $imported["DenKyz_Game_Weather"] @game_weather_cursor = 0 @game_weather_type = 0 @game_weather_type = $Game_Weather.weather[@game_weather_cursor].type if $Game_Weather.weather != [] @game_weather_limit = $GAME_WEATHER_LIMIT @game_weather_power = $GAME_WEATHER_POWER @game_weather_in_battle = $GAME_WEATHER_IN_BATTLE end end def layer=(layer) @layer = layer refresh activate end def alignment 1 end def window_width Graphics.width * 3 / 5 end def window_height Graphics.height - line_height * 3 end def item_rect(index) rect = Rect.new rect.width = item_width / 2 rect.height = item_height rect.x = contents_width - rect.width rect.y = index / col_max * item_height rect.y += line_height if @layer == 0 && @create_main_command_window.index == 0 && @create_control_command_window.index == 2 && GAME_TIME_KHAS_LIGHT && GAME_TIME_KHAS_LIGHT_SWITCH != -1 rect.y += line_height if @layer == 0 && @create_main_command_window.index == 1 && @create_control_command_window.index == 4 rect end def make_command_list case @create_main_command_window.index when 0 case @create_control_command_window.index when 0 add_command(@hour.to_s, :change_game_time) add_command(@min.to_s, :change_game_time) add_command(@sec.to_s, :change_game_time) when 1 add_command(@day.to_s, :change_game_date) add_command(GAME_TIME_DAYS_WEEK[@dayweek], :change_game_date) add_command(GAME_TIME_MONTHS[@month], :change_game_date) add_command(@year.to_s, :change_game_date) when 2 if @layer == 0 && GAME_TIME_KHAS_LIGHT && GAME_TIME_KHAS_LIGHT_SWITCH != -1 add_command(@use_khas_day_light ? "Да" : "Нет", :use_khas_day_light) else add_command(@static_light_hour.to_s, :static_light_hour) end when 3 add_command(@time_speed.to_s, :time_speed) when 4 add_command(@time_update ? "Да" : "Нет", :time_update) end when 1 case @create_control_command_window.index when 0 return if $Game_Weather.weather == [] add_command($Game_Weather.weather[@game_weather_cursor].name, :change_game_weather_type) add_command($Game_Weather.weather[@game_weather_cursor].power.to_s, :change_game_weather_type, false) add_command(@game_weather_type.to_s, :change_game_weather_type) when 1 return if $Game_Weather.weather == [] add_command($Game_Weather.weather[@game_weather_cursor].name, :stop_game_weather) add_command($Game_Weather.weather[@game_weather_cursor].power.to_s, :stop_game_weather, false) add_command(@game_weather_type.to_s, :stop_game_weather, false) when 2 add_command(@game_weather_limit.to_s, :change_game_weather_limit) when 3 add_command(@game_weather_power.to_s, :change_game_weather_power) when 4 add_command(@game_weather_in_battle ? "Вкл." : "Выкл.", :change_game_weather_in_battle) end end end def refresh super case @create_main_command_window.index when 0 case @create_control_command_window.index when 0 draw_text_ex(0, 0, "Часы") draw_text_ex(0, line_height, "Минуты") draw_text_ex(0, line_height * 2, "Секунды") when 1 draw_text_ex(0, 0, "День") draw_text_ex(0, line_height, "День недели") draw_text_ex(0, line_height * 2, "Месяц") draw_text_ex(0, line_height * 3, "Год") when 2 if @layer == 0 && GAME_TIME_KHAS_LIGHT && GAME_TIME_KHAS_LIGHT_SWITCH != -1 draw_text_ex(0, 0, "Использовать переключатель\nсвета Khas ?") else draw_text_ex(0, 0, "Час освещения") draw_text_ex(0, line_height, "-1, чтобы не устанавливать") end when 3 draw_text_ex(0, 0, "Скорость") when 4 draw_text_ex(0, 0, "Обновление") end when 1 case @create_control_command_window.index when 0..1 draw_text_ex(0, 0, "Имя погоды") draw_text_ex(0, line_height, "Сила погоды") draw_text_ex(0, line_height * 2, "Тип погоды") when 2 draw_text_ex(0, 0, "Лимит погоды") when 3 draw_text_ex(0, 0, "Сила погоды") when 4 draw_text_ex(0, 0, "Использовать отображение\nпогоды в бою ?") end end end def cursor_right(wrap = false) case @create_main_command_window.index when 0 case @create_control_command_window.index when 0 increase_time when 1 increase_date when 2 if @layer == 0 && GAME_TIME_KHAS_LIGHT && GAME_TIME_KHAS_LIGHT_SWITCH != -1 change_use_khas_day_light else increase_light_hour end when 3 increase_time_speed when 4 change_time_update end when 1 case @create_control_command_window.index when 0 increase_game_weather_cursor if index == 0 increase_game_weather_type if index == 2 when 1 increase_game_weather_cursor when 2 increase_game_weather_limit when 3 increase_game_weather_power when 4 change_game_weather_in_battle end end refresh end def cursor_left(wrap = false) case @create_main_command_window.index when 0 case @create_control_command_window.index when 0 decrease_time when 1 decrease_date when 2 if @layer == 0 && GAME_TIME_KHAS_LIGHT && GAME_TIME_KHAS_LIGHT_SWITCH != -1 change_use_khas_day_light else decrease_light_hour end when 3 decrease_time_speed when 4 change_time_update end when 1 case @create_control_command_window.index when 0 decrease_game_weather_cursor if index == 0 decrease_game_weather_type if index == 2 when 1 decrease_game_weather_cursor when 2 decrease_game_weather_limit when 3 decrease_game_weather_power when 4 change_game_weather_in_battle end end refresh end def cursor_pagedown 5.times { cursor_right } end def cursor_pageup 5.times { cursor_left } end def increase_time case index when 0 @hour += 1 @hour = @hour % GAME_TIME_HOURS_IN_DAY when 1 @min += 1 @min = @min % GAME_TIME_MINUTES_IN_HOUR when 2 @sec += 1 @sec = @sec % GAME_TIME_SECONDS_IN_MINUTE end end def decrease_time case index when 0 @hour -= 1 @hour = GAME_TIME_HOURS_IN_DAY - 1 if @hour < 0 when 1 @min -= 1 @min = GAME_TIME_MINUTES_IN_HOUR - 1 if @min < 0 when 2 @sec -= 1 @sec = GAME_TIME_SECONDS_IN_MINUTE - 1 if @sec < 0 end end def increase_date case index when 0 @day += 1 @day = @day % (GAME_TIME_DAYS[@month] + 1) @day = 1 if @day == 0 when 1 @dayweek += 1 @dayweek = @dayweek % GAME_TIME_DAYS_WEEK.size when 2 @month += 1 @month = @month % GAME_TIME_MONTHS.size when 3 @year += 1 end end def decrease_date case index when 0 @day -= 1 @day = GAME_TIME_DAYS[@month] if @day < 1 when 1 @dayweek -= 1 @dayweek = GAME_TIME_DAYS_WEEK.size - 1 if @dayweek < 0 when 2 @month -= 1 @month = GAME_TIME_MONTHS.size - 1 if @month < 0 when 3 @year -= 1 @year = 0 if @year < 0 end end def change_use_khas_day_light @use_khas_day_light = !@use_khas_day_light end def increase_light_hour @static_light_hour += 1 @static_light_hour = -1 if @static_light_hour == GAME_TIME_HOURS_IN_DAY end def decrease_light_hour @static_light_hour -= 1 @static_light_hour = GAME_TIME_HOURS_IN_DAY - 1 if @static_light_hour < -1 end def increase_time_speed @time_speed += 1 @time_speed = [1, @time_speed % 121].max end def decrease_time_speed @time_speed -= 1 @time_speed = 120 if @time_speed < 1 end def change_time_update @time_update = !@time_update end def increase_game_weather_cursor @game_weather_cursor += 1 @game_weather_cursor = @game_weather_cursor % $Game_Weather.weather.size @game_weather_type = $Game_Weather.weather[@game_weather_cursor].type end def decrease_game_weather_cursor @game_weather_cursor -= 1 @game_weather_cursor = @game_weather_cursor % $Game_Weather.weather.size @game_weather_type = $Game_Weather.weather[@game_weather_cursor].type end def increase_game_weather_type @game_weather_type += 1 @game_weather_type = @game_weather_type % (17 + Game_Weather_Settings::GAME_WEATHER_CUSTOM_TYPES.size) end def decrease_game_weather_type @game_weather_type -= 1 @game_weather_type = @game_weather_type % (17 + Game_Weather_Settings::GAME_WEATHER_CUSTOM_TYPES.size) end def increase_game_weather_limit @game_weather_limit += 1 end def decrease_game_weather_limit @game_weather_limit -= 1 @game_weather_limit = 1 if @game_weather_limit < 1 end def increase_game_weather_power @game_weather_power += 1 end def decrease_game_weather_power @game_weather_power -= 1 @game_weather_power = 0 if @game_weather_power < 0 end def change_game_weather_in_battle @game_weather_in_battle = !@game_weather_in_battle end end # class Game_Time_Extended_Settings_Process_Command_Window < Window_Command
Последний раз редактировалось DK; 17.10.2015 в 16:02. Причина: Обновление
Дополнение для Полоса Энергии
Автор: Я (Денис Кузнецов)
Версия: 1.0 от 13.04.15
Тип: Добавляющий возможности
Зависимости:
Глобальные Настройки: минимальная версия 1.2
Полоса энергии: минимальная версия 1.43
Данное дополнение позволяет настроить скрипт Полоса Энергии
Спойлер Код:Код:=begin ############################################################################### # # # Аддон к Восстанавливающаяся полоса # # # ############################################################################### Автор: Денис Кузнецов (http://vk.com/id8137201) =end $Extended_Settings_Command_List.push({ :command_name => "Энергия", :command_symbol => :den_kyz_energy_bar_settings_command_symbol, :method => :den_kyz_energy_bar_settings_method, :enabled => true, :author => "Денис Кузнецов", :version => 1.0, :date => "13.04.15", :description => "Настройка скрипта\n"Восстанавливающаяся полоса"" }) class Extended_Settings_Scene < Scene_Base def den_kyz_energy_bar_settings_method SceneManager.call(Energy_Bar_Settings_Scene) if $imported["DenKyz_EnergyBar"] end end # class Extended_Settings_Scene < Scene_Base class Energy_Bar_Settings_Scene < Scene_Base def start super create_command_window create_info_window create_process_window end def create_energy_bar_window $ENERGY_BAR_ARRAY.push({ :text => "Тест", :max => 250, :now => 175, :use_speed => 0, :restore_speed => 0, :color => rand(33), :inverse => false, :event => [], :event_ok => false, :button => -1, :auto => false }) @create_energy_bar_window = Energy_Bar_Window.new @create_energy_bar_window.z = 200 end def create_command_window @create_command_window = Energy_Bar_Settings_Command_Window.new @create_command_window.set_handler(:cancel, method(:return_scene)) @create_command_window.set_handler(:activate_process_window, method(:activate_process_window)) end def create_info_window @create_info_window = Energy_Bar_Settings_Info_Window.new(@create_command_window) @create_additional_info_window = Energy_Bar_Settings_Additional_Info_Window.new end def create_process_window @create_process_window = Energy_Bar_Settings_Process_Window.new(@create_command_window) @create_process_window.set_handler(:cancel, method(:deactivate_process_window)) @create_process_window.set_handler(:window_settings_ok, method(:deactivate_process_window)) @create_process_window.deactivate @create_process_window.cursor_rect.empty end def activate_process_window return @create_command_window.activate if $ENERGY_BAR_ARRAY.empty? && @create_command_window.index == 1 @create_command_window.deactivate @create_process_window.refresh @create_process_window.activate ### if @create_command_window.index == 0 create_energy_bar_window if @create_energy_bar_window == nil end ### end def deactivate_process_window @create_command_window.activate @create_process_window.select(0) @create_process_window.deactivate @create_process_window.refresh @create_process_window.cursor_rect.empty ### if @create_command_window.index == 0 && !@create_energy_bar_window.nil? if $ENERGY_BAR_ARRAY.size > 1 $ENERGY_BAR_ARRAY[-1] = nil else $ENERGY_BAR_ARRAY[0] = nil end $ENERGY_BAR_ARRAY.compact! @create_energy_bar_window.dispose @create_energy_bar_window = nil end ### end def update super if @last_command_window_index != @create_command_window.index @last_command_window_index = @create_command_window.index @create_process_window.refresh @create_process_window.cursor_rect.empty end end end # class Energy_Bar_Settings_Scene < Scene_Base class Energy_Bar_Settings_Command_Window < Window_HorzCommand def initialize super(0, 48) end def col_max 3 end def window_width Graphics.width end def make_command_list add_command("Настройка окна", :activate_process_window) add_command("Настройка полос", :activate_process_window) add_command("Другие настройки", :activate_process_window) end def cursor_down(wrap = false) process_ok end end # class Energy_Bar_Settings_Command_Window < Window_HorzCommand class Energy_Bar_Settings_Info_Window < Window_Base def initialize(command_window) @command_window = command_window super(0, 0, Graphics.width, 48) end def update super contents.clear case @command_window.index when 0 draw_text(0, 0, contents_width, contents_height, "Настройте положение окна на экране", 1) when 1 draw_text(0, 0, contents_width, contents_height, "Управляйте своими полосами", 1) when 2 draw_text(0, 0, contents_width, contents_height, "Настройте остальные параметры", 1) end end end # class Energy_Bar_Settings_Info_Window < Window_Base class Energy_Bar_Settings_Additional_Info_Window < Window_Base def initialize super(0, Graphics.height - 48, Graphics.width, 48) self.arrows_visible = false @text_index = 0 @text_info = ["Изменяйте параметры стрелками влево/вправо", "Используйте след./пред. стр. для изменения параметров", "Спасибо, что используете мой скрипт"] draw_text(0, 0, contents_width, contents_height, @text_info[@text_index], 1) end def draw_info_text contents.clear draw_text(0, 0, contents_width, contents_height, @text_info[@text_index], 1) end def update if Graphics.frame_count % 10 == 0 self.oy += 1 end if self.oy == 24 @text_index += 1 @text_index %= @text_info.size draw_info_text self.oy = -24 end end end # class Energy_Bar_Settings_Additional_Info_Window < Window_Base class Energy_Bar_Settings_Process_Window < Window_Command def initialize(command_window) @command_window = command_window @energy_bar_index = 0 super(0, 48 * 2) end def alignment 1 end def window_width Graphics.width end def window_height Graphics.height - 48 * 3 end def item_rect(index) rect = Rect.new rect.height = item_height rect.width = contents_width / 2 rect.x = rect.width + index % col_max * (item_width + spacing) rect.y = index / col_max * item_height if @command_window.index == 1 if index == 0 rect.width = item_width rect.x = index % col_max * (item_width + spacing) rect.y = item_height + index / col_max * item_height else rect.width = contents_width / 2 rect.x = rect.width + index % col_max * (item_width + spacing) rect.y = item_height + index / col_max * item_height end end rect end def draw_energy_bar_color(index) rect = item_rect(index) rect.x += 2 rect.y += 2 rect.width -= 4 rect.height -= 4 contents.fill_rect(rect, text_color($ENERGY_BAR_ARRAY[@energy_bar_index][:color])) end def draw_item(index) return draw_energy_bar_color(index) if index == 5 change_color(normal_color, command_enabled?(index)) draw_text(item_rect_for_text(index), command_name(index), alignment) end def make_command_list case @command_window.index when 0 add_command($ENERGY_BAR_WINDOW_X.to_s, :window_settings_ok) add_command($ENERGY_BAR_WINDOW_Y.to_s, :window_settings_ok) add_command($ENERGY_BAR_WINDOW_WIDTH.to_s, :window_settings_ok) when 1 if $ENERGY_BAR_ARRAY.size > @energy_bar_index add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:text], :window_settings_ok) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:now].to_s, :window_settings_ok) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:max].to_s, :window_settings_ok) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed].to_s, :window_settings_ok) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed].to_s, :window_settings_ok) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:color].to_i.to_s, :sym) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:inverse] ? "Да" : "Нет", :window_settings_ok) for i in 0..Energy_Bar_Settings::ENERGY_BAR_EVENTS.size - 1 break if $ENERGY_BAR_ARRAY[@energy_bar_index][:event] == Energy_Bar_Settings::ENERGY_BAR_EVENTS[i] end add_command(i.to_s, :window_settings_ok) add_command($ENERGY_BAR_ARRAY[@energy_bar_index][:auto] ? "Использовать" : "Восстанавливать", :window_settings_ok) if !$ENERGY_BAR_ARRAY[@energy_bar_index][:button].is_a?(Symbol) end when 2 add_command($ENERGY_BAR_MESSAGE_STOP ? "Да" : "Нет", :window_settings_ok) add_command($ENERGY_BAR_SPEED.to_s, :window_settings_ok) add_command($USE_ENERGY_BAR_WINDOW_PERCENT ? "Да" : "Нет", :window_settings_ok) add_command($USE_MINIMAL_ENERGY_BAR_STYLE ? "Да" : "Нет", :window_settings_ok) end end def refresh super case @command_window.index when 0 mas = ["X:", "Y:", "Ширина:"] for i in 0..mas.size - 1 draw_text(0, item_height * i, contents_width / 2, item_height, mas[i], 1) end when 1 if $ENERGY_BAR_ARRAY.empty? draw_text(0, 0, contents_width, contents_height, "У Вас нет еще полос", 1) else draw_text(0, 0, contents_width, item_height, "Выберите полосу (" + (@energy_bar_index + 1).to_s + "/" + ($ENERGY_BAR_ARRAY.size).to_s + ")", 1) mas = ["Текущее значение:", "Максимальное значение:", "Использование:", "Восстановление:", "Цвет:", "Инвертирование:", "Событие:", "Статус:"] for i in 0..mas.size - 1 break if i == mas.size - 1 && $ENERGY_BAR_ARRAY[@energy_bar_index][:button].is_a?(Symbol) draw_text(0, item_height * (i + 2), contents_width / 2, item_height, mas[i], 1) end end when 2 mas = ["Пауза при сообщениях:", "Скорость полосы:", "Показывать проценты:", "Минимальный стиль:"] for i in 0..mas.size - 1 draw_text(0, item_height * i, contents_width / 2, item_height, mas[i], 1) end end end def cursor_right(wrap = false) case @command_window.index when 0 case index when 0 $ENERGY_BAR_WINDOW_X += 1 when 1 $ENERGY_BAR_WINDOW_Y += 1 when 2 $ENERGY_BAR_WINDOW_WIDTH += 1 end when 1 case index when 0 @energy_bar_index += 1 @energy_bar_index = @energy_bar_index % $ENERGY_BAR_ARRAY.size when 1 $ENERGY_BAR_ARRAY[@energy_bar_index][:now] += 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:now] = $ENERGY_BAR_ARRAY[@energy_bar_index][:max] if $ENERGY_BAR_ARRAY[@energy_bar_index][:now] >= $ENERGY_BAR_ARRAY[@energy_bar_index][:max] when 2 $ENERGY_BAR_ARRAY[@energy_bar_index][:max] += 0.125 when 3 $ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed] += 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed] = $ENERGY_BAR_ARRAY[@energy_bar_index][:max] if $ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed] >= $ENERGY_BAR_ARRAY[@energy_bar_index][:max] when 4 $ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed] += 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed] = $ENERGY_BAR_ARRAY[@energy_bar_index][:max] if $ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed] >= $ENERGY_BAR_ARRAY[@energy_bar_index][:max] when 5 $ENERGY_BAR_ARRAY[@energy_bar_index][:color] += 1 $ENERGY_BAR_ARRAY[@energy_bar_index][:color] = $ENERGY_BAR_ARRAY[@energy_bar_index][:color] % 32 # 32 цвета всего when 6 $ENERGY_BAR_ARRAY[@energy_bar_index][:inverse] = !$ENERGY_BAR_ARRAY[@energy_bar_index][:inverse] when 7 for i in 0..Energy_Bar_Settings::ENERGY_BAR_EVENTS.size - 1 break if $ENERGY_BAR_ARRAY[@energy_bar_index][:event] == Energy_Bar_Settings::ENERGY_BAR_EVENTS[i] end $ENERGY_BAR_ARRAY[@energy_bar_index][:event] = Energy_Bar_Settings::ENERGY_BAR_EVENTS[(i + 1) % (Energy_Bar_Settings::ENERGY_BAR_EVENTS.size)] when 8 $ENERGY_BAR_ARRAY[@energy_bar_index][:auto] = !$ENERGY_BAR_ARRAY[@energy_bar_index][:auto] end when 2 case index when 0 $ENERGY_BAR_MESSAGE_STOP = !$ENERGY_BAR_MESSAGE_STOP when 1 $ENERGY_BAR_SPEED += 1 $ENERGY_BAR_SPEED = [2, $ENERGY_BAR_SPEED % 31].max when 2 $USE_ENERGY_BAR_WINDOW_PERCENT = !$USE_ENERGY_BAR_WINDOW_PERCENT when 3 $USE_MINIMAL_ENERGY_BAR_STYLE = !$USE_MINIMAL_ENERGY_BAR_STYLE end end refresh end def cursor_left(wrap = false) case @command_window.index when 0 case index when 0 $ENERGY_BAR_WINDOW_X -= 1 $ENERGY_BAR_WINDOW_X = 0 if $ENERGY_BAR_WINDOW_X < 0 when 1 $ENERGY_BAR_WINDOW_Y -= 1 $ENERGY_BAR_WINDOW_Y = 0 if $ENERGY_BAR_WINDOW_Y < 0 when 2 $ENERGY_BAR_WINDOW_WIDTH -= 1 $ENERGY_BAR_WINDOW_WIDTH = 0 if $ENERGY_BAR_WINDOW_WIDTH < 0 end when 1 case index when 0 @energy_bar_index -= 1 @energy_bar_index = @energy_bar_index % $ENERGY_BAR_ARRAY.size when 1 $ENERGY_BAR_ARRAY[@energy_bar_index][:now] -= 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:now] = 0 if $ENERGY_BAR_ARRAY[@energy_bar_index][:now] <= 0 when 2 $ENERGY_BAR_ARRAY[@energy_bar_index][:max] -= 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:max] = 1 if $ENERGY_BAR_ARRAY[@energy_bar_index][:max] <= 1 $ENERGY_BAR_ARRAY[@energy_bar_index][:now] = $ENERGY_BAR_ARRAY[@energy_bar_index][:max] if $ENERGY_BAR_ARRAY[@energy_bar_index][:now] >= $ENERGY_BAR_ARRAY[@energy_bar_index][:max] when 3 $ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed] -= 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed] = 0 if $ENERGY_BAR_ARRAY[@energy_bar_index][:use_speed] <= 0 when 4 $ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed] -= 0.125 $ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed] = 0 if $ENERGY_BAR_ARRAY[@energy_bar_index][:restore_speed] <= 0 when 5 $ENERGY_BAR_ARRAY[@energy_bar_index][:color] -= 1 $ENERGY_BAR_ARRAY[@energy_bar_index][:color] = $ENERGY_BAR_ARRAY[@energy_bar_index][:color] % 32 # 32 цвета всего when 6 $ENERGY_BAR_ARRAY[@energy_bar_index][:inverse] = !$ENERGY_BAR_ARRAY[@energy_bar_index][:inverse] when 7 for i in 0..Energy_Bar_Settings::ENERGY_BAR_EVENTS.size - 1 break if $ENERGY_BAR_ARRAY[@energy_bar_index][:event] == Energy_Bar_Settings::ENERGY_BAR_EVENTS[i] end $ENERGY_BAR_ARRAY[@energy_bar_index][:event] = Energy_Bar_Settings::ENERGY_BAR_EVENTS[(i - 1) % (Energy_Bar_Settings::ENERGY_BAR_EVENTS.size)] when 8 $ENERGY_BAR_ARRAY[@energy_bar_index][:auto] = !$ENERGY_BAR_ARRAY[@energy_bar_index][:auto] end when 2 case index when 0 $ENERGY_BAR_MESSAGE_STOP = !$ENERGY_BAR_MESSAGE_STOP when 1 $ENERGY_BAR_SPEED -= 1 $ENERGY_BAR_SPEED = 30 if $ENERGY_BAR_SPEED < 2 when 2 $USE_ENERGY_BAR_WINDOW_PERCENT = !$USE_ENERGY_BAR_WINDOW_PERCENT when 3 $USE_MINIMAL_ENERGY_BAR_STYLE = !$USE_MINIMAL_ENERGY_BAR_STYLE end end refresh end def cursor_pagedown 10.times do cursor_right end end def cursor_pageup 10.times do cursor_left end end end # class Energy_Bar_Settings_Process_Window < Window_Command
Дополнение Игровые Параметры
Автор: Я (Денис Кузнецов)
Версия: 1.2 от 02.02.15
Тип: Добавляющий возможности
Скриншоты:
Спойлер Скриншоты:
Зависимости:
Глобальные Настройки: минимальная версия 1.2
Данное дополнение позволяет изменять игровые параметры (деньги, жизни, партию и т.д.)
Спойлер Код:Код:=begin ############################################################################### # # # Аддон к Extended Settings # # # ############################################################################### Автор: Денис Кузнецов (http://vk.com/id8137201) =end $Extended_Settings_Command_List.push({ :command_name => "Параметры игры", :command_symbol => :den_kyz_game_test_command_symbol, :method => :den_kyz_game_test_settings_method, :enabled => true, :author => "Денис Кузнецов", :version => "1.2", :date => "02.02.15", :description => "Игровые настройки для VX ACE\nВы можете настроить следующие\nпараметры:\nДеньги, Жизни, Уровень, Магия,\nТелепорт, Статы, Вещи, Оружие,\nБроня, Навыки, Классы, Партия" }) module Game_Test_Settings_Module ANIMATION_SPEED = 10 # Скорость анимации (больше 0) USE_REGULAR_ITEM_FILTR = true # Использовать фильтр для вещей # Например, если вы составляете базу данных с использованием заглавий # Например: 001:---Зелья--- 002: Зелье жизни 003: Зелье маны и т.д. # Ниже не трогать :) COMMAND_LIST = [ "Деньги", "Жизни", "Уровень", "Магия", "Телепорт", "Статы", "Вещи", "Оружие", "Броня", "Навыки", "Классы", "Партия" ] end # module Game_Test_Module class Extended_Settings_Scene < Scene_Base def den_kyz_game_test_settings_method SceneManager.call(Game_Test_Settings_Scene) end end # class Extended_Settings_Scene < Scene_Base class Game_Test_Settings_Scene < Scene_Base include Game_Test_Settings_Module def start super @animation = false @animation_type = 0 @window_activate = 0 create_command_window create_info_window create_control_window end def create_command_window @create_command_window = Game_Test_Settings_Command_Window.new(0, 0) COMMAND_LIST.each do |index| @create_command_window.set_handler(index.to_sym, method(:press_ok_command_window)) end end def create_info_window @create_info_window = Game_Test_Settings_Info_Window.new(Graphics.width / 3, 0, Graphics.width * 2 / 3, Graphics.height) end def create_control_window @create_control_window = Game_Test_Settings_Control_Window.new(Graphics.width / 3, 0) @create_control_window.opacity = 0 @create_control_window.contents_opacity = 0 @create_control_window.deactivate @create_control_window.set_handler(:increase, method(:next_layer)) @create_control_window.set_handler(:decrease, method(:next_layer)) @create_control_window.set_handler(:setup, method(:next_layer)) @create_control_window.set_handler(:all, method(:next_layer)) $game_party.members.each do |index| @create_control_window.set_handler(index.name.to_sym, method(:next_layer)) end $data_mapinfos.each do |index| @create_control_window.set_handler(index[1].name.to_sym, method(:next_layer)) end $data_system.terms.params.each do |index| @create_control_window.set_handler(index.to_sym, method(:next_layer)) end $data_items.each do |index| next if next_add_command?(index) @create_control_window.set_handler(index.name.to_sym, method(:next_layer)) if index.name != "" end $data_weapons.each do |index| next if next_add_command?(index) @create_control_window.set_handler(index.name.to_sym, method(:next_layer)) if index.name != "" end $data_armors.each do |index| next if next_add_command?(index) @create_control_window.set_handler(index.name.to_sym, method(:next_layer)) if index.name != "" end @create_control_window.set_handler(:money, method(:change_money)) @create_control_window.set_handler(:hp, method(:change_hp)) @create_control_window.set_handler(:lvl, method(:change_lvl)) @create_control_window.set_handler(:mp, method(:change_mp)) @create_control_window.set_handler(:teleport, method(:teleport)) @create_control_window.set_handler(:stats, method(:change_stats)) @create_control_window.set_handler(:items, method(:change_items_weapons_armors)) @create_control_window.set_handler(:weapons, method(:change_items_weapons_armors)) @create_control_window.set_handler(:armors, method(:change_items_weapons_armors)) $data_skills.each do |index| next if next_add_command?(index) @create_control_window.set_handler(index.name.to_sym, method(:change_skills)) if index.name != "" end $data_classes.each do |index| next if next_add_command?(index) @create_control_window.set_handler(index.name.to_sym, method(:change_class)) if index.name != "" end $data_actors.each do |index| next if next_add_command?(index) @create_control_window.set_handler((index.name + "change_party").to_sym, method(:change_party)) if index.name != "" end end def next_add_command?(index) return true if index == nil return true if index.name == "" return true if index.name =~ /(?:[\Q \- !@#\$%^&*)_= \[ \] (}{ \/ \\ .|?+>< \E]+)(?:[\wа-яА-Я]*)(?:[\Q \- !@#\$%^&*)_= \[ \] (}{ \/ \\ .|?+<> \E]+)/ && USE_REGULAR_ITEM_FILTR return false end def next_layer # следующий уровень 2 окна reactivate_control_window(@create_control_window.layer + 1) end def change_money # Увеличиваем/уменьшаем деньги case @create_control_window.cursor_layer_0 when 0 $game_party.gain_gold(@create_control_window.money) when 1 $game_party.lose_gold(@create_control_window.money) when 2 $game_party.lose_gold($game_party.gold) $game_party.gain_gold(@create_control_window.money) end post_complete_process end def change_hp case @create_control_window.cursor_layer_0 when 0 # увеличить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| index.change_hp(@create_control_window.hp, false) end else $game_party.members[@create_control_window.cursor_layer_1 - 1].change_hp(@create_control_window.hp, false) end when 1 # уменьшить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| index.change_hp(-@create_control_window.hp, false) end else $game_party.members[@create_control_window.cursor_layer_1 - 1].change_hp(-@create_control_window.hp, false) end when 2 # установить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| index.change_hp(-$game_party.members[@create_control_window.cursor_layer_1 - 1].hp, false) index.change_hp(@create_control_window.hp, false) end else $game_party.members[@create_control_window.cursor_layer_1 - 1].change_hp(-$game_party.members[@create_control_window.cursor_layer_1 - 1].hp, false) $game_party.members[@create_control_window.cursor_layer_1 - 1].change_hp(@create_control_window.hp, false) end end post_complete_process end def change_lvl case @create_control_window.cursor_layer_0 when 0 # увеличить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| for i in 0..@create_control_window.lvl - 1 index.level_up end end else # для кого-то из партии for i in 0..@create_control_window.lvl - 1 $game_party.members[@create_control_window.cursor_layer_1 - 1].level_up end end when 1 # уменьшить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| for i in 0..@create_control_window.lvl - 1 index.level_down end end else # для кого-то из партии for i in 0..@create_control_window.lvl - 1 $game_party.members[@create_control_window.cursor_layer_1 - 1].level_down end end when 2 # установить if @create_control_window.cursor_layer_1 == 0 # для всей партии $game_party.members.each do |index| for i in 0..@create_control_window.lvl - 1 index.change_level(@create_control_window.lvl, false) end end else # для кого-то из партии $game_party.members[@create_control_window.cursor_layer_1 - 1].change_level(@create_control_window.lvl, false) end end post_complete_process end def change_mp case @create_control_window.cursor_layer_0 when 0 # увеличить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| index.mp += @create_control_window.mp end else $game_party.members[@create_control_window.cursor_layer_1 - 1].mp += @create_control_window.mp end when 1 # уменьшить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| index.mp -= @create_control_window.mp end else $game_party.members[@create_control_window.cursor_layer_1 - 1].mp -= @create_control_window.mp end when 2 # установить if @create_control_window.cursor_layer_1 == 0 # если для всей партии $game_party.members.each do |index| index.mp = @create_control_window.mp end else $game_party.members[@create_control_window.cursor_layer_1 - 1].mp = @create_control_window.mp end end post_complete_process end def teleport i = 0 $data_mapinfos.map.each do |index| if i == @create_control_window.cursor_layer_0 $game_map.setup(index[0]) $game_player.moveto(@create_control_window.teleport_x, @create_control_window.teleport_y) $game_player.refresh end i += 1 end post_complete_process end def change_stats case @create_control_window.cursor_layer_0 when 0 # увеличить if @create_control_window.cursor_layer_1 == 0 # если всей партии if @create_control_window.cursor_layer_2 == 0 # если все статы i = 0 $data_system.terms.params.each do |index| $game_party.members.each do |actor| actor.add_param(i, @create_control_window.stats) end i += 1 end else # если один стат всей партии $game_party.members.each do |actor| actor.add_param(@create_control_window.cursor_layer_2 - 1, @create_control_window.stats) end end else # если один стат одному $game_party.members[@create_control_window.cursor_layer_1 - 1].add_param(@create_control_window.cursor_layer_2 - 1, @create_control_window.stats) end when 1 if @create_control_window.cursor_layer_1 == 0 # если всей партии if @create_control_window.cursor_layer_2 == 0 # если все статы i = 0 $data_system.terms.params.each do |index| $game_party.members.each do |actor| actor.add_param(i, -@create_control_window.stats) end i += 1 end else # если один стат всей партии $game_party.members.each do |actor| actor.add_param(@create_control_window.cursor_layer_2 - 1, -@create_control_window.stats) end end else # если один стат одному $game_party.members[@create_control_window.cursor_layer_1 - 1].add_param(@create_control_window.cursor_layer_2 - 1, -@create_control_window.stats) end when 2 if @create_control_window.cursor_layer_1 == 0 # если всей партии if @create_control_window.cursor_layer_2 == 0 # если все статы i = 0 $data_system.terms.params.each do |index| $game_party.members.each do |actor| actor.add_param(i, -actor.param(i)) actor.add_param(i, @create_control_window.stats) actor.hp += @create_control_window.stats if i == 1 actor.mp += @create_control_window.stats if i == 2 end i += 1 end else # если один стат всей партии $game_party.members.each do |actor| actor.add_param(@create_control_window.cursor_layer_2 - 1, -actor.param(@create_control_window.cursor_layer_2 - 1)) actor.add_param(@create_control_window.cursor_layer_2 - 1, @create_control_window.stats) actor.hp += @create_control_window.stats if @create_control_window.cursor_layer_2 == 1 actor.mp += @create_control_window.stats if @create_control_window.cursor_layer_2 == 2 end end else # если один стат одному #выбрал нужного персонажа, добавляю ему выбранный параметр, отнимая, что уже есть $game_party.members[@create_control_window.cursor_layer_1 - 1].add_param(@create_control_window.cursor_layer_2 - 1, -$game_party.members[@create_control_window.cursor_layer_1 - 1].param(@create_control_window.cursor_layer_2 - 1)) #выбрал персонажа, добавляю ему выбранный параметр $game_party.members[@create_control_window.cursor_layer_1 - 1].add_param(@create_control_window.cursor_layer_2 - 1, @create_control_window.stats) #восстанавливаем hp и mp $game_party.members[@create_control_window.cursor_layer_1 - 1].hp += @create_control_window.stats if @create_control_window.cursor_layer_2 == 1 $game_party.members[@create_control_window.cursor_layer_1 - 1].hp += @create_control_window.stats if @create_control_window.cursor_layer_2 == 2 end end post_complete_process end def change_items_weapons_armors case @create_command_window.current_index when 6 array = $data_items num = @create_control_window.items when 7 array = $data_weapons num = @create_control_window.weapons when 8 array = $data_armors num = @create_control_window.armors end array_index = @create_control_window.visible_items layer_cursor = @create_control_window.cursor_layer_1 znak = 1 # прибавить вещь znak *= -1 if @create_control_window.cursor_layer_0 == 1 # отнять вещь $game_party.gain_item(array[array_index[layer_cursor]], num * znak) post_complete_process end def change_skills visible_items = @create_control_window.visible_items cursor = @create_control_window.cursor_layer_2 if @create_control_window.cursor_layer_1 == 0 $game_party.members.each do |index| if @create_control_window.cursor_layer_0 == 0 index.learn_skill(visible_items[cursor]) else index.forget_skill(visible_items[cursor]) end end else actor = $game_party.members[@create_control_window.cursor_layer_1 - 1] if @create_control_window.cursor_layer_0 == 0 actor.learn_skill(visible_items[cursor]) else actor.forget_skill(visible_items[cursor]) end end post_complete_process end def change_class visible_items = @create_control_window.visible_items cursor = @create_control_window.cursor_layer_2 if @create_control_window.cursor_layer_0 == 0 $game_party.members.each do |actor| level = actor.level - 1 if @create_control_window.cursor_layer_1 # -1 потому что ниже times начинает с 0 actor.change_class(visible_items[cursor]) level.times do actor.level_up end if @create_control_window.cursor_layer_1 == 0 end else actor = $game_party.members[@create_control_window.cursor_layer_0 - 1] level = actor.level - 1 if @create_control_window.cursor_layer_1 # -1 потому что ниже times начинает с 0 actor.change_class(visible_items[cursor]) level.times do actor.level_up end if @create_control_window.cursor_layer_1 == 0 end post_complete_process end def change_party visible_items = @create_control_window.visible_items cursor = @create_control_window.cursor_layer_1 if @create_control_window.cursor_layer_0 == 0 $game_party.add_actor(visible_items[cursor]) else $game_party.remove_actor(visible_items[cursor]) end post_complete_process end def post_complete_process # после добавления чего-либо вернуть 1 окно @window_activate = 0 @animation = true activate_window update end def reactivate_control_window(layer) # Переактивируем окно и устанавливаем уровень @create_control_window.layer = layer @create_control_window.refresh @create_control_window.select(0) @create_control_window.activate end def press_ok_command_window @animation = true @animation_type = rand(4) pre_animation_setting @window_activate = 1 update_window_cursors reactivate_control_window(0) activate_window update end def pre_animation_setting @create_info_window.x = Graphics.width / 3 @create_info_window.y = 0 @create_control_window.opacity = 0 @create_control_window.contents_opacity = 0 @create_control_window.x = Graphics.width / 3 @create_control_window.y = 0 @create_control_window.x = Graphics.width if @animation_type == 2 end def activate_window case @window_activate when 0 @create_command_window.activate @create_control_window.deactivate when 1 @create_command_window.deactivate @create_control_window.activate end end def update update_window_cursors super if !@animation && Input.trigger?(:B) # обработка нажатия кнопки Esc case @window_activate when 0 Sound.play_cancel return_scene when 1 if @create_control_window.layer == 0 Sound.play_cancel @window_activate = 0 activate_window @animation = true else Sound.play_cancel reactivate_control_window(@create_control_window.layer - 1) end end end animation_type if @animation end def update_window_cursors if @window_activate == 0 @create_info_window.command = @create_command_window.current_index else @create_control_window.command = @create_command_window.current_index end end def animation_type case @animation_type when 0 # первая анимация case @window_activate # вернуть первое окно when 0 @create_info_window.x -= ANIMATION_SPEED @create_info_window.opacity += ANIMATION_SPEED @create_info_window.contents_opacity += ANIMATION_SPEED @create_control_window.opacity -= ANIMATION_SPEED @create_control_window.contents_opacity -= ANIMATION_SPEED if @create_control_window.opacity == 0 @animation = false end when 1 # показать второе окно @create_info_window.x += ANIMATION_SPEED @create_info_window.opacity -= ANIMATION_SPEED @create_info_window.contents_opacity -= ANIMATION_SPEED @create_control_window.opacity += ANIMATION_SPEED @create_control_window.contents_opacity += ANIMATION_SPEED if @create_control_window.opacity == 255 @animation = false end end when 1 case @window_activate when 0 @create_info_window.y -= ANIMATION_SPEED @create_info_window.opacity += ANIMATION_SPEED @create_info_window.contents_opacity += ANIMATION_SPEED @create_control_window.opacity -= ANIMATION_SPEED @create_control_window.contents_opacity -= ANIMATION_SPEED if @create_control_window.opacity == 0 @animation = false end when 1 @create_info_window.y += ANIMATION_SPEED @create_info_window.opacity -= ANIMATION_SPEED @create_info_window.contents_opacity -= ANIMATION_SPEED @create_control_window.opacity += ANIMATION_SPEED @create_control_window.contents_opacity += ANIMATION_SPEED if @create_control_window.opacity == 255 @animation = false end end when 2 # вторая анимация case @window_activate when 0 @create_info_window.x += ANIMATION_SPEED @create_info_window.opacity += ANIMATION_SPEED @create_info_window.contents_opacity += ANIMATION_SPEED @create_control_window.x += ANIMATION_SPEED @create_control_window.opacity -= ANIMATION_SPEED @create_control_window.contents_opacity -= ANIMATION_SPEED if @create_info_window.x >= Graphics.width / 3 @create_info_window.x = Graphics.width / 3 @animation = false end when 1 @create_info_window.x -= ANIMATION_SPEED @create_info_window.opacity -= ANIMATION_SPEED @create_info_window.contents_opacity -= ANIMATION_SPEED @create_control_window.x -= ANIMATION_SPEED @create_control_window.opacity += ANIMATION_SPEED @create_control_window.contents_opacity += ANIMATION_SPEED if @create_control_window.x <= Graphics.width / 3 @create_control_window.x = Graphics.width / 3 @animation = false end end when 3 # третья анимация case @window_activate # вернуть первое окно when 0 @create_info_window.opacity += ANIMATION_SPEED / 2 @create_info_window.contents_opacity += ANIMATION_SPEED / 2 @create_control_window.opacity -= ANIMATION_SPEED / 2 @create_control_window.contents_opacity -= ANIMATION_SPEED / 2 if @create_control_window.opacity == 0 @animation = false end when 1 # установить второе окно @create_info_window.opacity -= ANIMATION_SPEED / 2 @create_info_window.contents_opacity -= ANIMATION_SPEED / 2 @create_control_window.opacity += ANIMATION_SPEED / 2 @create_control_window.contents_opacity += ANIMATION_SPEED / 2 if @create_control_window.opacity == 255 @animation = false end end end end end # class Game_Test_Settings_Scene < Scene_Base class Game_Test_Settings_Command_Window < Window_Command include Game_Test_Settings_Module def initialize(x, y) super(x, y) end def window_width Graphics.width / 3 end def window_height Graphics.height end def make_command_list COMMAND_LIST.each do |index| add_command(index, index.to_sym) end end def current_index for i in 0..@list.size-1 return i if @list[i][:symbol] == current_symbol end end end # class Game_Test_Settings_Command_Window < Window_Command class Game_Test_Settings_Info_Window < Window_Base attr_accessor :command def initialize(x, y, w, h) @command = 0 # какая команда выбрана на окне команд super(x, y, w, h) end def update super contents.clear draw_text(0, 30, 450, 32, "Возможности:") case @command when 0 draw_text(0, 0, 450, 32, "Управление деньгами") draw_text(0, 60, 450, 32, "1) Увеличить деньги") draw_text(0, 90, 450, 32, "2) Уменьшить деньги") draw_text(0, 120, 450, 32, "3) Установить определенный уровень") when 1 draw_text(0, 0, 450, 32, "Управление здоровьем") draw_text(0, 60, 450, 32, "1) Восстановить жизни") draw_text(0, 90, 450, 32, "2) Отнять жизни") draw_text(0, 120, 450, 32, "3) Установить определенный уровень") when 2 draw_text(0, 0, 450, 32, "Управление уровнями") draw_text(0, 60, 450, 32, "1) Прибавить уровень") draw_text(0, 90, 450, 32, "2) Отнять уровень") draw_text(0, 120, 450, 32, "3) Установить определенный уровень") when 3 draw_text(0, 0, 450, 32, "Управление магией") draw_text(0, 60, 450, 32, "1) Восстановить магию") draw_text(0, 90, 450, 32, "2) Отнять магию") draw_text(0, 120, 450, 32, "3) Установить определенный уровень") when 4 draw_text(0, 0, 450, 32, "Управление телепортом") draw_text(0, 60, 450, 32, "Телепортироваться на любую карту") when 5 draw_text(0, 0, 450, 32, "Управление статами") draw_text(0, 60, 450, 32, "1) Увеличить стат") draw_text(0, 90, 450, 32, "2) Уменьшить стат") draw_text(0, 120, 450, 32, "3) Установить определенный уровень") when 6 draw_text(0, 0, 450, 32, "Управление вещами") draw_text(0, 60, 450, 32, "1) Добавить вещь") draw_text(0, 90, 450, 32, "2) Отнять вещь") when 7 draw_text(0, 0, 450, 32, "Управление оружием") draw_text(0, 60, 450, 32, "1) Добавить оружие") draw_text(0, 90, 450, 32, "2) Отнять оружие") when 8 draw_text(0, 0, 450, 32, "Управление броней") draw_text(0, 60, 450, 32, "1) Добавить броню") draw_text(0, 90, 450, 32, "2) Отнять броню") when 9 draw_text(0, 0, 450, 32, "Управление навыками") draw_text(0, 60, 450, 32, "1) Добавить навык") draw_text(0, 90, 450, 32, "2) Отнять навык") when 10 draw_text(0, 0, 450, 32, "Управление классами") draw_text(0, 60, 450, 32, "Изменить класс персонажа") when 11 draw_text(0, 0, 450, 32, "Управление партией") draw_text(0, 60, 450, 32, "1) Добавить персонажа") draw_text(0, 90, 450, 32, "2) Удалить персонажа") end end end # class Game_Test_Settings_Info_Window < Window_Base class Game_Test_Settings_Control_Window < Window_Command include Game_Test_Settings_Module attr_accessor :layer attr_accessor :money attr_accessor :hp attr_accessor :lvl attr_accessor :mp attr_accessor :teleport_x attr_accessor :teleport_y attr_accessor :stats attr_accessor :items attr_accessor :weapons attr_accessor :armors attr_accessor :visible_items attr_accessor :cursor_layer_0 attr_accessor :cursor_layer_1 attr_accessor :cursor_layer_2 attr_accessor :command def initialize(x, y) @layer = 0 # уровень отображения кнопок @money = 1 # деньги @hp = 1 # жизни @lvl = 1 # уровень @mp = 1 # магия @teleport_x = 0 # x для телепорта @teleport_y = 0 # y для телепорта @stats = 1 # статы @items = 1 # вещи @weapons = 1 # оружие @armors = 1 # броня @visible_items = [] # реальные индексы вещей в базе данных @actor_data = [] # индексы, что есть у определенного персонажа (навыки) @cursor_layer_0 = 0 # какая кнопка была нажата на layer == 0 @cursor_layer_1 = 0 # какая кнопка была нажата на layer == 1 @cursor_layer_2 = 0 # какая кнопка была нажата на layer == 2 @command = 0 # какая команда была выбрана из COMMAND_LIST super(x, y) end def current_index for i in 0..@list.size-1 return i if @list[i][:symbol] == current_symbol end end def window_width Graphics.width * 2 /3 end def window_height Graphics.height end def make_command_list if @layer == 0 && @command != 4 && @command != 10 add_command("Увеличить", :increase) add_command("Уменьшить", :decrease) add_command("Установить", :setup) if @command < 6 end if @layer == 1 && (@command != 0 && @command != 4 && @command < 6 || @command == 9) || (@layer == 0 && @command == 10) # 4 - телепорт, 5 - статы add_command("Всей партии", :all) $game_party.members.each do |index| add_command(index.name, index.name.to_sym) end end case @command when 0 add_command(@money.to_s, :money) if @layer == 1 when 1 add_command(@hp.to_s, :hp) if @layer == 2 when 2 add_command(@lvl.to_s, :lvl) if @layer == 2 when 3 add_command(@mp.to_s, :mp) if @layer == 2 when 4 if @layer == 0 $data_mapinfos.each do |index| add_command(index[1].name, index[1].name.to_sym) end end if @layer == 1 add_command("x = " + @teleport_x.to_s, :teleport_x) add_command("y = " + @teleport_y.to_s, :teleport_y) add_command("Телепортироваться", :teleport) end when 5 if @layer == 2 add_command("Все статы", :all) # all ? $data_system.terms.params.each do |index| add_command(index.to_s, index.to_sym) end end add_command(@stats.to_s, :stats) if @layer == 3 when 6..8 case @command when 6 array = $data_items if @cursor_layer_0 == 0 array = $game_party.items if @cursor_layer_0 == 1 add_command(@items.to_s, :items) if @layer == 2 when 7 array = $data_weapons if @cursor_layer_0 == 0 array = $game_party.weapons if @cursor_layer_0 == 1 add_command(@weapons.to_s, :weapons) if @layer == 2 when 8 array = $data_armors if @cursor_layer_0 == 0 array = $game_party.armors if @cursor_layer_0 == 1 add_command(@armors.to_s, :armors) if @layer == 2 end if @layer == 1 array.each do |index| next if next_add_command?(index) @visible_items.push(index.id) add_command(index.name, index.name.to_sym) end add_command("Ничего нет", :nothing) if array.size == 0 end when 9 # навыки if @layer == 2 if @cursor_layer_0 == 0 # выбрали увеличить if @cursor_layer_1 == 0 # выбрали для всех $data_skills.each do |index| next if next_add_command?(index) next if index.id < 3 # не включать навыки атаки и защиты name = $data_system.skill_types[index.stype_id] @visible_items.push(index.id) add_command(index.name + " (" + name + ")" , index.name.to_sym) end else # увеличить для кого-то одного actor = $game_party.members[@cursor_layer_1 - 1] $data_skills.each do |index| next if next_add_command?(index) next if index.id < 3 # не включать навыки атаки и защиты find_actor_data(actor.skills) # находим индексы всех навыков персонажа next if @actor_data.include?(index.id) # зачем добавлять, если у персонажа уже есть name = $data_system.skill_types[index.stype_id] @visible_items.push(index.id) add_command(index.name + " (" + name + ")" , index.name.to_sym) end end else # если уменьшить if @cursor_layer_1 == 0 #уменьшить у всех $game_party.members.each do |actor| actor.skills.each do |index| next if next_add_command?(index) next if @visible_items.include?(index.id) name = $data_system.skill_types[index.stype_id] @visible_items.push(index.id) add_command(index.name + " (" + name + ")" , index.name.to_sym) end end else # уменьшить у одного actor = $game_party.members[@cursor_layer_1 - 1] actor.skills.each do |index| next if next_add_command?(index) name = $data_system.skill_types[index.stype_id] @visible_items.push(index.id) add_command(index.name + " (" + name + ")" , index.name.to_sym) end end end end when 10 # классы if @layer == 1 # increase и decrease потому что они тоже отвечают за переход на следующий layer # так зачем использовать лишние символы add_command("Да", :increase) add_command("Нет", :decrease) end if @layer == 2 $data_classes.each do |index| next if next_add_command?(index) if @cursor_layer_0 != 0 next if $game_party.members[@cursor_layer_0 - 1].class_id == index.id end @visible_items.push(index.id) add_command(index.name, index.name.to_sym) end end when 11 # партия if @layer == 1 if @cursor_layer_0 == 0 # увеличить партию $data_actors.each do |index| next if next_add_command?(index) find_actor_data($game_party.members) # находим индексы персонажей в партии next if @actor_data.include? (index.id) # зачем добавлять, если они уже в партии #~ next if index.name =~ /(?:[\Q \- !@#\$%^&*)_= \[ \] (}{ \/ \\ .|?+>< \E]+)(?:[\wа-яА-Я]*)(?:[\Q \- !@#\$%^&*)_= \[ \] (}{ \/ \\ .|?+<> \E]+)/ && USE_REGULAR_ITEM_FILTR @visible_items.push(index.id) add_command(index.name, (index.name + "change_party").to_sym) end else # уменьшить партию if $game_party.members.size == 1 add_command("Нельзя удалить последнего персонажа", :nothing) else $game_party.members.each do |index| next if next_add_command?(index) @visible_items.push(index.id) add_command(index.name, (index.name + "change_party").to_sym) end end end end end end def find_actor_data(actor) # находим индексы чего-либо (actor) @actor_data = [] actor.each do |index| next if next_add_command?(index) @actor_data.push(index.id) end end def next_add_command?(index) return true if index == nil return true if index.name == "" return true if index.name =~ /(?:[\Q \- !@#\$%^&*)_= \[ \] (}{ \/ \\ .|?+>< \E]+)(?:[\wа-яА-Я]*)(?:[\Q \- !@#\$%^&*)_= \[ \] (}{ \/ \\ .|?+<> \E]+)/ && USE_REGULAR_ITEM_FILTR return false end def refresh @visible_items = [] if @layer < 2 super draw_text(0, 0, 350, 32, "Выберите из списка", 1) if @layer == 0 case @command when 0 # если выбраны деньги draw_text(0, 0, 350, 32, "Введите сумму", 1) if @layer == 1 draw_text(0, 30, 350, 32, "У партии: " + $game_party.gold.to_s + " " + Vocab::currency_unit, 1) when 1 # жизни draw_text(0, 0, 350, 32, "Кому изменить жизни ?", 1) if @layer == 1 draw_text(0, 0, 350, 32, "Введите жизни", 1) if @layer == 2 draw_text(0, 30, 350, 32, "У " + $game_party.members[@cursor_layer_1 - 1].name + " " + $game_party.members[@cursor_layer_1 - 1].hp.to_s + " жизней", 1) if @layer == 2 && @cursor_layer_1 > 0 when 2 # уровни draw_text(0, 0, 350, 32, "Кому изменить уровень ?", 1) if @layer == 1 draw_text(0, 0, 350, 32, "Введите уровень", 1) if @layer == 2 draw_text(0, 30, 350, 32, "У " + $game_party.members[@cursor_layer_1 - 1].name + " " + $game_party.members[@cursor_layer_1 - 1].level.to_s + " уровень", 1) if @layer == 2 && @cursor_layer_1 > 0 when 3 # магия draw_text(0, 0, 350, 32, "Кому изменить магию ?", 1) if @layer == 1 draw_text(0, 0, 350, 32, "Введите магию", 1) if @layer == 2 draw_text(0, 30, 350, 32, "У " + $game_party.members[@cursor_layer_1 - 1].name + " " + $game_party.members[@cursor_layer_1 - 1].mp.to_s + " магии", 1) if @layer == 2 && @cursor_layer_1 > 0 when 4 draw_text(0, 0, 350, 32, "Введите координаты", 1) if @layer == 1 when 5 draw_text(0, 0, 350, 32, "Кому изменить стат ?", 1) if @layer == 1 draw_text(0, 0, 350, 32, "Выберите из списка", 1) if @layer == 2 draw_text(0, 0, 350, 32, "Введите стат", 1) if @layer == 3 # у этого такой стат на столько if @layer == 3 && @cursor_layer_1 > 0 && @cursor_layer_2 > 0 actor = $game_party.members[@cursor_layer_1 - 1] draw_text(0, 30, 350, 32, "У " + actor.name + " " + actor.param(@cursor_layer_2 - 1).to_s + " " + $data_system.terms.params[@cursor_layer_2 - 1], 1) end when 6..8 draw_text(0, 0, 350, 32, "Выберите из списка", 1) if @layer == 1 draw_text(0, 0, 350, 32, "Введите количество", 1) if @layer == 2 if @layer == 2 && @cursor_layer_0 == 1 case @command when 6 array = $data_items when 7 array = $data_weapons when 8 array = $data_armors end item = array[@visible_items[@cursor_layer_1]] text = $game_party.item_number(item) draw_text(0, 30, 350, 32, "У партии " + text.to_s + " " + item.name, 1) if @layer == 2 && @cursor_layer_0 == 1 end when 9..11 draw_text(0, 0, 350, 32, "Выберите из списка", 1) if @layer < 3 && !(@layer == 1 && @command == 10) draw_text(0, 0, 350, 32, "Сохранить текущий уровень ?", 1) if @layer == 1 && @command == 10 end end def item_rect(index) # 72 + (добавил) rect = Rect.new rect.width = item_width rect.height = item_height rect.x = index % col_max * (item_width + spacing) rect.y = 72 + index / col_max * item_height rect end def page_row_max # - 72 (добавил) (height - padding - padding_bottom - 72) / item_height end def row_max # + 72 / item_height (добавил) [(item_max + col_max - 1 + 72 / item_height) / col_max, 1].max end def current_index # не правильно работает, если одинаковые символы for i in 0..@list.size-1 return i if @list[i][:symbol] == current_symbol end end def call_ok_handler @cursor_layer_0 = current_index if @layer == 0 @cursor_layer_1 = current_index if @layer == 1 @cursor_layer_2 = current_index if @layer == 2 super end def cursor_pagedown return super if @layer == 0 case @command when 0 @money += 10000 @money = $game_party.gold if @money > $game_party.gold && @cursor == 1 when 1 return super if @layer < 2 @hp += 1000 when 2 return super if @layer < 2 @lvl += 50 when 3 return super if @layer < 2 @mp += 1000 when 4 if current_index == 0 @teleport_x += 5 else @teleport_y += 5 end when 5 @stats += 50 when 6 @items += 50 when 7 @weapons += 50 when 8 @armors += 50 end refresh end def cursor_pageup return super if @layer == 0 case @command when 0 @money -= 10000 @money = 0 if @money < 0 when 1 return super if @layer < 2 @hp -= 1000 @hp = 0 if @hp < 0 when 2 return super if @layer < 2 @lvl -= 50 @lvl = 0 if @lvl < 0 @lvl = 1 if @lvl < 1 && @cursor_layer_0 == 2 when 3 return super if @layer < 2 @mp -= 1000 @mp = 0 if @mp < 0 when 4 if current_index == 0 @teleport_x -= 5 @teleport_x = 0 if @teleport_x < 0 else @teleport_y -= 5 @teleport_y = 0 if @teleport_y < 0 end when 5 @stats -= 50 @stats = 1 if @stats < 1 when 6 @items -= 50 @items = 0 if @items < 0 when 7 @weapons -= 50 @weapons = 0 if @weapons < 0 when 8 @armors -= 50 @armors = 0 if @armors < 0 end refresh end def cursor_up(wrap = false) return super if @layer < 2 # == 0 case @command when 0 @money += 100 @money = $game_party.gold if @money > $game_party.gold && @cursor == 1 when 1 #~ return super if @layer < 2 @hp += 20 when 2 #~ return super if @layer < 2 @lvl += 10 when 3 #~ return super if @layer < 2 @mp += 20 when 5 return super if @layer < 3 @stats += 10 when 6 #~ return super if @layer < 2 @items += 10 when 7 #~ return super if @layer < 2 @weapons += 10 when 8 #~ return super if @layer < 2 @armors += 10 else return super end refresh end def cursor_down(wrap = false) return super if @layer < 2 # == 0 case @command when 0 @money -= 100 @money = 0 if @money < 0 when 1 #~ return super if @layer < 2 @hp -= 20 @hp = 0 if @hp < 0 when 2 #~ return super if @layer < 2 @lvl -= 10 @lvl = 0 if @lvl < 0 @lvl = 1 if @lvl < 1 && @cursor_layer_0 == 2 when 3 #~ return super if @layer < 2 @mp -= 20 @mp = 0 if @mp < 0 when 4 return super when 5 return super if @layer < 3 @stats -= 10 @stats = 1 if @stats < 1 when 6 #~ return super if @layer < 2 @items -= 10 @items = 0 if @items < 0 when 7 #~ return super if @layer < 2 @weapons -= 10 @weapons = 0 if @weapons < 0 when 8 #~ return super if @layer < 2 @armors -= 10 @armors = 0 if @armors < 0 else return super end refresh end def cursor_right(wrap = false) return super if @layer < 2 # == 0 case @command when 0 @money += 1 @money = $game_party.gold if @money > $game_party.gold && @cursor == 1 when 1 #~ return super if @layer < 2 @hp += 1 when 2 #~ return super if @layer < 2 @lvl += 1 when 3 #~ return super if @layer < 2 @mp += 1 when 4 if current_index == 0 @teleport_x += 1 else @teleport_y += 1 end when 5 #~ return super if @layer < 2 @stats += 1 when 6 #~ return super if @layer < 2 @items += 1 when 7 #~ return super if @layer < 2 @weapons += 1 when 8 #~ return super if @layer < 2 @armors += 1 end refresh end def cursor_left(wrap = false) return super if @layer < 2 # == 0 case @command when 0 @money -= 1 @money = 0 if @money < 0 when 1 #~ return super if @layer < 2 @hp -= 1 @hp = 0 if @hp < 0 when 2 #~ return super if @layer < 2 @lvl -= 1 @lvl = 0 if @lvl < 0 @lvl = 1 if @lvl < 1 && @cursor_layer_0 == 2 when 3 #~ return super if @layer < 2 @mp -= 1 @mp = 0 if @mp < 0 when 4 if current_index == 0 @teleport_x -= 1 @teleport_x = 0 if @teleport_x < 0 else @teleport_y -= 1 @teleport_y = 0 if @teleport_y < 0 end when 5 #~ return super if @layer < 2 @stats -= 1 @stats = 1 if @stats < 1 when 6 #~ return super if @layer < 2 @items -= 1 @items = 0 if @items < 0 when 7 #~ return super if @layer < 2 @weapons -= 1 @weapons = 0 if @weapons < 0 when 8 #~ return super if @layer < 2 @armors -= 1 @armors = 0 if @armors < 0 end refresh end end # class Game_Test_Settings_Control_Window < Window_Command
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)
Социальные закладки