-
DK
-
-
Вне сайта
-
Светлый дракон
-
-
DKPlugins
- Сообщений: 946
- Спасибо получено: 1129
-
-
|
Обновил каркас до версии 1.05:
Код: =begin
###############################################################################
# #
# Глобальные настройки игры #
# #
###############################################################################
Автор: Денис Кузнецов (http://vk.com/id8137201)
Версия: 1.05
Релиз от: 15.01.15
=end
module Global_Settings_Setting
MENU_NAME = "Настройки" # Название в меню
USE_MAP_BUTTON = true # Использовать кнопку на карте
MAP_BUTTON = :R # Кнопка вызова на карте
USE_BATTLE_BUTTON = true # Использовать кнопку вызова в бою
BATTLE_BUTTON = :R # Кнопка вызова в бою
USE_ANIMATION = true # Использовать анимацию
# Не трогать ниже :)
$Global_Setting_Command_List = []
$Global_Setting_Cursor = 0
end # module Global_Settings_Setting
class Window_MenuCommand < Window_Command
alias denis_kyznetsov_glob_setting_wnd_menu_cmmd_add_original_commands add_original_commands
def add_original_commands
denis_kyznetsov_glob_setting_wnd_menu_cmmd_add_original_commands
add_command(Global_Settings_Setting::MENU_NAME, :global_settings)
end
end # class Window_MenuCommand < Window_Command
class Scene_Menu < Scene_MenuBase
alias denis_kyznetsov_glob_setting_scn_menu_create_command_window create_command_window
def create_command_window
denis_kyznetsov_glob_setting_scn_menu_create_command_window
@command_window.set_handler(:global_settings, method(:global_settings))
end
def global_settings
SceneManager.call(Global_Settings_Scene)
end
end # class Scene_Menu < Scene_MenuBase
class Scene_Map < Scene_Base
alias denis_kyznetsov_glob_setting_scn_map_update update
def update
denis_kyznetsov_glob_setting_scn_map_update
SceneManager.call(Global_Settings_Scene) if Input.trigger?(Global_Settings_Setting::MAP_BUTTON)
end
end # class Scene_Map < Scene_Base
class Scene_Battle < Scene_Base
alias denis_kyznetsov_glob_setting_scn_btl_update update
def update
SceneManager.call(Global_Settings_Scene) if Input.trigger?(Global_Settings_Setting::BATTLE_BUTTON)
denis_kyznetsov_glob_setting_scn_btl_update
end
end
class Global_Settings_Scene < Scene_Base
def start
super
@start_animation = Global_Settings_Setting::USE_ANIMATION
create_name_window
create_command_window
create_info_window
end
def create_name_window
@create_name_window = Global_Setting_Name_Window.new
if @start_animation
@create_name_window.opacity = 0
@create_name_window.contents_opacity = 0
end
end
def create_command_window
@create_command_window = Global_Setting_Command_Window.new($Global_Setting_Command_List)
if @start_animation
@create_command_window.opacity = 0
@create_command_window.contents_opacity = 0
@create_command_window.x = -300
@create_command_window.y = 300
end
$Global_Setting_Command_List.each do |index|
@create_command_window.set_handler(index[:command_symbol], method(index[:method]))
end
end
def create_info_window
@create_info_window = Global_Setting_Info_Window.new
if @start_animation
@create_info_window.opacity = 0
@create_info_window.contents_opacity = 0
@create_info_window.x = 450
@create_info_window.y = 300
end
end
def update
super
if @start_animation
@create_name_window.opacity += 5
@create_name_window.contents_opacity += 5
@create_command_window.opacity += 4
@create_command_window.contents_opacity += 4
@create_command_window.x += 17
@create_command_window.y -= 16
@create_info_window.opacity += 4
@create_info_window.contents_opacity += 4
@create_info_window.x -= 17
@create_info_window.y -= 16
if @create_command_window.y <= 54
@create_name_window.opacity = 255
@create_name_window.contents_opacity = 255
@create_command_window.opacity = 255
@create_command_window.contents_opacity = 255
@create_command_window.x = 0
@create_command_window.y = 54
@create_info_window.opacity = 255
@create_info_window.contents_opacity = 255
@create_info_window.x = Graphics.width / 3
@create_info_window.y = 54
@start_animation = false
end
end
if @finish_animation
@create_name_window.opacity -= 10
@create_name_window.contents_opacity -= 10
@create_command_window.opacity -= 10
@create_command_window.contents_opacity -= 10
@create_command_window.x -= 17
@create_command_window.y += 16
@create_info_window.opacity -= 10
@create_info_window.contents_opacity -= 10
@create_info_window.x += 17
@create_info_window.y += 16
if @create_command_window.x <= -Graphics.width
@finish_animation = false
end
end
if Input.trigger?(:B)
Sound.play_cancel
@finish_animation = Global_Settings_Setting::USE_ANIMATION
return_scene
end
end
def return_scene
while @finish_animation
update
end
super
end
end # class Global_Settings_Scene < Scene_Base
class Global_Setting_Name_Window < Window_Base
def initialize
super(0, 0, Graphics.width, 54)
draw_text(0, 0, Graphics.width - 16, 32, Global_Settings_Setting::MENU_NAME, 1)
end
end # class Global_Setting_Name_Window < Window_Base
class Global_Setting_Command_Window < Window_Command
def initialize(global_setting)
@global_setting_command = global_setting
super(0, 54)
select($Global_Setting_Cursor)
end
def window_width
Graphics.width / 3
end
def window_height
Graphics.height - 54
end
def cursor_up(wrap = true)
$Global_Setting_Cursor -= 1
if $Global_Setting_Cursor < 0
$Global_Setting_Cursor = @global_setting_command.size-1
end
select($Global_Setting_Cursor)
end
def cursor_down(wrap = true)
$Global_Setting_Cursor += 1
if $Global_Setting_Cursor > @global_setting_command.size-1
$Global_Setting_Cursor = 0
end
select($Global_Setting_Cursor)
end
def make_command_list
@global_setting_command.each do |index|
add_command(index[:command_name], index[:command_symbol])
end
end
end # class Global_Setting_Command_Window < Window_Command
class Global_Setting_Info_Window < Window_Base
def initialize
super(Graphics.width / 3, 54, Graphics.width * 2 / 3, Graphics.height - 54)
end
def update
super
contents.clear
global_setting = $Global_Setting_Command_List
cursor = $Global_Setting_Cursor
draw_text(0, 0, 400, 32, "Автор скрипта: " + global_setting[cursor][:author]).to_s
draw_text(0, 30, 400, 32, "Версия: " + global_setting[cursor][:version].to_s)
draw_text(0, 60, 400, 32, "Дата: " + global_setting[cursor][:date].to_s)
draw_text(0, 90, 350, 32, "Описание", 1)
draw_text(0, 120, 500, 32, global_setting[cursor][:about].to_s)
end
end
Что нового: можно отключить анимации открытия и закрытия окна.
Обновил пример до версии 1.12:
$Global_Setting_Command_List.push({ :command_name => "Игровые параметры", :command_symbol => :command_1, :method => :method_1,
:author => "Денис Кузнецов", :version => 1.12, :date => "15.01.15", :about => "Игровые настройки для VX ACE" })
module Game_Test_Setting_Module
ANIMATION_SPEED = 10 # Скорость анимации (больше 0)
# Ниже не трогать :)
COMMAND_LIST = [ # пока методы не нужны
[ :name => "Деньги", :method => :method_money],
[ :name => "Жизни", :method=> :method_hp ],
[ :name => "Уровень", :method => :method_lvl ],
[ :name => "Магия", :method => :method_mp],
[ :name => "Телепорт", :method => :method_teleport],
[ :name => "Статы", :method => :method_stats]
]
end # module Game_Test_Setting_Module
class Global_Settings_Scene < Scene_Base
def method_1
SceneManager.call(Game_Test_Setting)
end
end # class Global_Settings_Scene < Scene_Base
class Game_Test_Setting < Scene_Base
include Game_Test_Setting_Module
def start
super
#~ p $data_system
#~ p '-------'
#~ p $game_system
@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_Setting_Command_Window.new(0, 0)
COMMAND_LIST.each do |index|
@create_command_window.set_handler(index[0][:name].to_sym, method(:press_ok_command_window))
end
end
def create_info_window
@create_info_window = Game_Test_Setting_Info_Window.new(Graphics.width / 3, 0, Graphics.width * 2 / 3, Graphics.height)
end
def create_control_window
@create_control_window = Game_Test_Setting_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
@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))
end
def next_layer # следующий уровень окна
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
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 # обработка нажатия кнопки Esc
case @window_activate
when 0
if Input.trigger?(:B)
Sound.play_cancel
return_scene
end
when 1
case @create_control_window.layer
when 0
if Input.trigger?(:B)
Sound.play_cancel
@window_activate = 0
activate_window
@animation = true
end
when 1
if Input.trigger?(:B)
Sound.play_cancel
reactivate_control_window(0)
end
when 2
if Input.trigger?(:B)
Sound.play_cancel
reactivate_control_window(1)
end
when 3
if Input.trigger?(:B)
Sound.play_cancel
reactivate_control_window(2)
end
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_Setting < Scene_Base'
class Game_Test_Setting_Command_Window < Window_Command
include Game_Test_Setting_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[0][:name], index[0][:name].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_Setting_Command_Window < Window_Command
class Game_Test_Setting_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) Установить определенный уровень")
end
end
end # class Game_Test_Setting_Info_Window < Window_Base
class Game_Test_Setting_Control_Window < Window_Command
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 :cursor_layer_0
attr_accessor :cursor_layer_1
attr_accessor :cursor_layer_2
attr_accessor :command
def initialize(x, y)
@layer = 0 # уровень отображения кнопок
@money = 0 # деньги
@hp = 0 # жизни
@lvl = 1 # уровень
@mp = 0 # магия
@teleport_x = 0 # x для телепорта
@teleport_y = 0 # y для телепорта
@stats = 0 # статы
@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
add_command("Увеличить", :increase)
add_command("Уменьшить", :decrease)
add_command("Установить", :setup)
end
if @layer == 1 && @command != 0 && @command != 4 #&& @command < 4 # 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
end
end
def refresh
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
# у этого такое стат на столько
#~ 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 == 3 && @cursor_layer_1 > 0
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 += 15
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 += 15
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 -= 15
@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 -= 15
@stats = 0 if @stats < 0
end
refresh
end
def cursor_up(wrap = false)
return super if @layer == 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 += 10
when 2
return super if @layer < 2
@lvl += 5
when 3
return super if @layer < 2
@mp += 10
when 4
return super
when 5
return super if @layer < 3
@stats += 5
end
refresh
end
def cursor_down(wrap = false)
return super if @layer == 0
case @command
when 0
@money -= 100
@money = 0 if @money < 0
when 1
return super if @layer < 2
@hp -= 10
@hp = 0 if @hp < 0
when 2
return super if @layer < 2
@lvl -= 5
@lvl = 0 if @lvl < 0
@lvl = 1 if @lvl < 1 && @cursor_layer_0 == 2
when 3
return super if @layer < 2
@mp -= 10
@mp = 0 if @mp < 0
when 4
return super
when 5
return super if @layer < 3
@stats -= 5
@stats = 0 if @stats < 0
end
refresh
end
def cursor_right(wrap = false)
return super if @layer == 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
@stats += 1
end
refresh
end
def cursor_left(wrap = false)
return super if @layer == 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
@stats -= 1
@stats = 0 if @stats < 0
end
refresh
end
end
Что нового: добавил возможность телепортироваться на любую карту, протестировал на нескольких своих картах - вроде работает правильно, но прошу отписаться о работе данного пункта, добавил каркас изменения статов. С ними пока сложности возникли.
Архив для скачки: Яндекс.диск 1.05
|