=begin
[VX Ace]Ultimate Skill Tree Maker
Версия: 1.1
Автор: Kian Ni
Что нового:
1.1 Добавлена функция увеличение характеристик героя, через изучение навыков.
Установка:
1. Вставить скрипт в раздел Пользовательские
2. Скопировать папку Icons, из папки Graphics в демо, в папку Graphics/ своего
проекта
3. Настроить скрипт по инструкции
Вызов скрипта: SceneManager.call(Scene_SkillTree)
=end
module TREE
MENU = true #Добавить в меню
NAME = "Академия" #Название пункта
end
class Scene_Base
def load_tree_constants
$sp_give = 3 # Сколько дается очков навыков за уровень.
$actors_num = 3 # Количество героев, для которых будет созданно дерево навыков.
$classes_num = 2# Количество классов, для которых будет созданно дерево навыков.
# Герои и классы, для которых будут созданны древа, должны
# быть расположенны в БД с 1 номера и идти один за другим без
# пробелов.
end
def load_tree_variables
case $game_actors[$game_party.members[$actor_index].id].class_id
=begin
Настоятельно советую начертить древо навыка на бумаге, а потом по рисунку
уже заносить значение в матрицы!
Создание дерева для N класса:
when N - id Класса в БД
$back_name = "name" - Имя фонового изображения класса в Graphics/Icons.
$tree_x = N - Координата Х древа класса.
$tree_y = N - Координата У древа класса.
$tree_cells = N - Общее количество ячеек в матрице.
$tree_column = N - Число столбцов в матрице.
$tree_line = N - Число строк в матрице.
$x_id = N - Стартовое значение Х курсора на древе класса.
$y_id = N - Стартовое значение У курсора на древе класса.
Создание матрицы фоновой картинки ветвления навыков:
$tree_back = {
L1 => [b1, b2, .., bn],
.
.
Ln => [b1, b2, .., bn]
}
Где L1 - номер первой строки матрицы, Ln - номер последней строки матрицы.
Количество строк должно быть равно $tree_line.
Количество значений: b1, b2, .., bn - должно быть равно $tree_column.
Значения для $tree_column b1, b2, .., bn берутся из картинки ключа:
skill_tile_key в папке Graphics/Icons.
Фоновая картинка генерируется на основе значений матрицы из skill_tile,
данный файл можно редактировать, он может быть 4х в ширину и сколько
угодно в длину. Размер одной ячейки 26 на 26 пикселей.
Создание матрицы навыков:
$tree_skill = {
L1 => [s1, s2, .., sn],
.
.
Ln => [s1, s2, .., sn]
}
Где L1 - номер первой строки матрицы, Ln - номер последней строки матрицы.
Количество строк должно быть равно $tree_line.
Количество значений: s1, s2, .., sn - должно быть равно $tree_column.
s1, s2, .., sn - где s это id навыка из БД. Нулевое значение оставляет
ячеку пустой.
Создание условий изучения навыка:
$skill_req = {
ID1 => [max level, skill points cost, level require, skill require, param_id, param_add],
.
.
IDn => [max level, skill points cost, level require, skill require, param_id, param_add]
}
Где:
ID - это id навыка из матрицы навыков.
max level - максимальный уровень навыка, минимальное значение 1,
повышение уровня навыка происходит за счет замещения текущего навыка,
навыком на 1 порядок выше, то есть 2й уровень навыка 27, это навык 28
и так далее,будьте внимательны.
skill points cost - стоимость для изучения навыка в SP, нулевое значение
отключает данную опцию.
level require - необходимый уровень героя для изучения навыка, нулевое
значение отключает данную опцию.
skill require - необходимый навык из дерева для изучения навыка, нулевое
значение отключает данную опцию.
param_id, param_add - вариативная опция, которая позволяет при "изучении"
навыка повышать характеристики героя, чтобы не использовать, просто не
прописуйте значения или укажите nil.
Первое значение это ID параметра:
0 - HP
1 - MP
2 - ATK
3 - DEF
4 - MAT
5 - MDF
6 - AGI
7 - LUK
Второе значение, это на сколько увеличить/отнять(если отрицательное значение)
указанный параметр.
=end
################################################################################
when 1
$back_name = "warrior"
$tree_x = 49
$tree_y = 179
$tree_cells = 45
$tree_column = 9
$tree_line = 5
$x_id = 1
$y_id = 1
$tree_back = {
1 => [1, 5, 9 ,1, 9, 1, 3, 2, 1],
2 => [0, 4, 1 ,0, 0, 0, 1, 11, 0],
3 => [0, 1, 5 ,1, 9, 9, 9, 11, 0],
4 => [0, 8, 6 ,5, 9, 1, 0, 6, 1],
5 => [0, 1, 0, 1, 0, 0, 0, 0, 0]
}
$tree_skill = {
1 => [5, 0, 0, 12, 0, 15, 0, 0, 26],
2 => [0, 0, 32 ,0, 0, 0, 6, 0, 0],
3 => [0, 13, 0, 14, 0, 0, 0, 0, 0],
4 => [0, 0, 0, 0, 0, 17, 0, 0, 29],
5 => [0, 9, 0, 41, 0, 0, 0, 0, 0]
}
$skill_req = {
5 => [10, 1, 0, 0, 0, 15],
12 => [3, 2, 4, 0],
15 => [3, 3, 6, 12],
26 => [3, 4, 9, 6],
32 => [3, 2, 3, 5],
6 => [3, 4, 7, 12],
13 => [3, 1, 2, 5],
14 => [3, 2, 4, 13],
17 => [3, 3, 6, 13],
29 => [3, 5, 9, 14],
9 => [3, 1, 2, 13],
41 => [3, 3, 4, 13]
}
when 2
$back_name = "mage"
$tree_x = 85
$tree_y = 150
$tree_cells = 49
$tree_column = 7
$tree_line = 7
$x_id = 4
$y_id = 7
$tree_back = {
1 => [1, 0, 0, 1, 0, 0, 1],
2 => [8, 0, 0, 8, 0, 0, 8],
3 => [1, 0, 0, 1, 0, 0, 1],
4 => [8, 0, 0, 8, 0, 0, 8],
5 => [1, 0, 0, 1, 0, 0, 1],
6 => [6, 9, 9, 12, 9, 9, 7],
7 => [0, 0, 0, 1, 0, 0, 0]
}
$tree_skill = {
1 => [12, 0, 0, 21, 0, 0, 41],
2 => [0, 0, 0, 0, 0, 0, 0],
3 => [24, 0, 0, 17, 0, 0, 35],
4 => [0, 0, 0, 0, 0, 0, 0],
5 => [45, 0, 0, 29, 0, 0, 22],
6 => [0, 0, 0, 0, 0, 0, 0],
7 => [0, 0, 0, 11, 0, 0, 0]
}
$skill_req = {
11 => [1, 1, 0, 0],
45 => [1, 2, 4, 11],
24 => [1, 3, 7, 45],
12 => [1, 4, 10, 24],
29 => [1, 2, 4, 11],
17 => [1, 3, 7, 29],
21 => [1, 4, 10, 17],
22 => [1, 2, 4, 11],
35 => [1, 3, 7, 22],
41 => [1, 4, 10, 35]
}
###########КОНЕЦ РЕДАКТИРУЕМОЙ ЧАСТИ############################################
################################################################################
end
end
end
class Scene_SkillTree < Scene_MenuBase
def start
super
load_tree_constants
load_tree_variables
i = 0
loop do
break if i == $game_party.members.size
if $game_party.members[i].level > $level_up[$game_party.members[i].id][$game_actors[$game_party.members[i].id].class_id]
$skill_points[$game_party.members[i].id][$game_actors[$game_party.members[i].id].class_id] += $sp_give * ($game_party.members[i].level - $level_up[$game_party.members[i].id][$game_actors[$game_party.members[i].id].class_id])
$level_up[$game_party.members[i].id][$game_actors[$game_party.members[i].id].class_id] += $game_actors[$game_party.members[i].id].level - $level_up[$game_party.members[i].id][$game_actors[$game_party.members[i].id].class_id]
end
i += 1
end
$actor_id = $game_party.members[$actor_index].id
$class_id = $game_actors[$game_party.members[$actor_index].id].class_id
create_windows
create_background_tree
create_icons
create_skill_cursore
end
def update
super
movement
@window_info.refresh
@window_actor.refresh
end
def create_windows
@window_info = Window_SkillInfo.new
@window_tree = Window_SkillTree.new
@window_actor = Window_ActorInfo.new
end
def create_background
@background_sprite = Sprite.new(@viewport1)
@background_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
background = Bitmap.new("Graphics/Icons/#{$back_name}")
screen = Rect.new(0, 0, Graphics.width, Graphics.height)
@background_sprite.bitmap.stretch_blt(screen, background, background.rect)
end
def create_background_tree
@background = []
@loop_back = 0
@x_back = 0
@y_back = 1
@step_x = 0
@step_y = 0
loop do
break if @loop_back == $tree_cells
if @x_back == $tree_column
@y_back += 1
@x_back = 0
@step_x = 0
@step_y += 26
end
i = $tree_back[@y_back][@x_back]
@background[@loop_back] = Sprite.new
@background[@loop_back].bitmap = Bitmap.new("Graphics/Icons/skill_tile")
rect = Rect.new(i % 4 * 26, i / 4 * 26, 26, 26)
@background[@loop_back].bitmap.blt(0, 0, @background[@loop_back].bitmap, rect)
@background[@loop_back].src_rect.set(rect.x, rect.y, 26, 26)
@background[@loop_back].x = $tree_x + @step_x
@background[@loop_back].y = $tree_y + @step_y
@background[@loop_back].z = 105
@loop_back += 1
@x_back += 1
@step_x += 26
end
end
def create_icons
@skill = []
@loop = 0
@x = 0
@y = 1
@step_x = 0
@step_y = 0
loop do
break if @loop == $tree_cells
if @x == $tree_column
@y += 1
@x = 0
@step_x = 0
@step_y += 26
end
if $tree_skill[@y][@x] > 0
i = $data_skills[$tree_skill[@y][@x]].icon_index
@skill[$tree_skill[@y][@x]] = Sprite.new
@skill[$tree_skill[@y][@x]].bitmap = Cache.system("iconset")
rect = Rect.new(i % 16 * 24, i / 16 * 24, 24, 24)
@skill[$tree_skill[@y][@x]].bitmap.blt(0, 0, @skill[$tree_skill[@y][@x]].bitmap, rect)
@skill[$tree_skill[@y][@x]].src_rect.set(rect.x, rect.y, 24, 24)
@skill[$tree_skill[@y][@x]].x = $tree_x + 1 + @step_x
@skill[$tree_skill[@y][@x]].y = $tree_y + 1 + @step_y
@skill[$tree_skill[@y][@x]].z = 105
if $learn[$actor_id][$class_id][$tree_skill[@y][@x]] > 0
@skill[$tree_skill[@y][@x]].tone.set(0, 0, 0, 0)
else
@skill[$tree_skill[@y][@x]].tone.set(0, 0, 0, 255)
end
end
@loop += 1
@x += 1
@step_x += 26
end
end
def create_skill_cursore
@cursore = Sprite.new
@cursore.bitmap = Bitmap.new("Graphics/Icons/cursore")
@cursore.x = $tree_x - 1 - 26 + ($x_id * 26)
@cursore.y = $tree_y - 1 - 26 + ($y_id * 26)
@cursore.z = 115
end
def movement
up if Input.repeat?(:UP)
down if Input.repeat?(:DOWN)
left if Input.repeat?(:LEFT)
right if Input.repeat?(:RIGHT)
ok if Input.trigger?(:C)
cancel if Input.trigger?(:B)
actor_right if Input.trigger?(:R)
actor_left if Input.trigger?(:L)
end
def actor_right
if $actor_index < $game_party.members.size - 1
dispose_tree
$actor_index += 1
$actor_id = $game_party.members[$actor_index].id
$class_id = $game_actors[$game_party.members[$actor_index].id].class_id
load_tree_variables
create_background
create_background_tree
create_icons
create_skill_cursore
Audio.se_play("Audio/SE/Cursor1",50)
else
dispose_tree
$actor_index = 0
$actor_id = $game_party.members[$actor_index].id
$class_id = $game_actors[$game_party.members[$actor_index].id].class_id
load_tree_variables
create_background
create_background_tree
create_icons
create_skill_cursore
Audio.se_play("Audio/SE/Cursor1",50)
end
end
def actor_left
if $actor_index > 0
dispose_tree
$actor_index -= 1
$actor_id = $game_party.members[$actor_index].id
$class_id = $game_actors[$game_party.members[$actor_index].id].class_id
load_tree_variables
create_background
create_background_tree
create_icons
create_skill_cursore
Audio.se_play("Audio/SE/Cursor1",50)
else
dispose_tree
$actor_index = $game_party.members.size - 1
$actor_id = $game_party.members[$actor_index].id
$class_id = $game_actors[$game_party.members[$actor_index].id].class_id
load_tree_variables
create_background
create_background_tree
create_icons
create_skill_cursore
Audio.se_play("Audio/SE/Cursor1",50)
end
end
def up
if $y_id != 1
$y_id -= 1
@cursore.y -= 26
Audio.se_play("Audio/SE/Cursor1",50)
else
$y_id = $tree_line
@cursore.y += ($tree_line - 1) * 26
Audio.se_play("Audio/SE/Cursor1",50)
end
end
def down
if $y_id != $tree_line
$y_id += 1
@cursore.y += 26
Audio.se_play("Audio/SE/Cursor1",50)
else
$y_id = 1
@cursore.y -= ($tree_line - 1) * 26
Audio.se_play("Audio/SE/Cursor1",50)
end
end
def left
if $x_id != 1
$x_id -= 1
@cursore.x -= 26
Audio.se_play("Audio/SE/Cursor1",50)
else
$x_id = $tree_column
@cursore.x += ($tree_column - 1) * 26
Audio.se_play("Audio/SE/Cursor1",50)
end
end
def right
if $x_id != $tree_column
$x_id += 1
@cursore.x += 26
Audio.se_play("Audio/SE/Cursor1",50)
else
$x_id = 1
@cursore.x -= ($tree_column - 1) * 26
Audio.se_play("Audio/SE/Cursor1",50)
end
end
def ok
if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0 and $tree_skill[$y_id][$x_id-1] > 0
learn
elsif $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] > 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] < $skill_req[$tree_skill[$y_id][$x_id-1]][0] and $tree_skill[$y_id][$x_id-1] > 0
upgrade
else
Sound.play_buzzer
end
end
def first_learn
if $skill_req[$tree_skill[$y_id][$x_id-1]][3] == 0
return 1
else
return $learn[$actor_id][$class_id][$skill_req[$tree_skill[$y_id][$x_id-1]][3]]
end
end
def learn
if $skill_points[$actor_id][$class_id] >= $skill_req[$tree_skill[$y_id][$x_id-1]][1] and $game_actors[$game_party.members[$actor_index].id].level >= $skill_req[$tree_skill[$y_id][$x_id-1]][2] and first_learn > 0
if $skill_req[$tree_skill[$y_id][$x_id-1]][4] != nil
$skill_points[$actor_id][$class_id] -= $skill_req[$tree_skill[$y_id][$x_id-1]][1]
@skill[$tree_skill[$y_id][$x_id-1]].tone.set(0, 0, 0, 0)
$game_actors[$game_party.members[$actor_index].id].add_param( $skill_req[$tree_skill[$y_id][$x_id-1]][4], $skill_req[$tree_skill[$y_id][$x_id-1]][5])
$learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] += 1
Audio.se_play("Audio/SE/Blind",50)
else
$skill_points[$actor_id][$class_id] -= $skill_req[$tree_skill[$y_id][$x_id-1]][1]
@skill[$tree_skill[$y_id][$x_id-1]].tone.set(0, 0, 0, 0)
$game_actors[$game_party.members[$actor_index].id].learn_skill($tree_skill[$y_id][$x_id-1])
$learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] += 1
Audio.se_play("Audio/SE/Blind",50)
end
else
Sound.play_buzzer
end
end
def upgrade
if $skill_points[$actor_id][$class_id] >= $skill_req[$tree_skill[$y_id][$x_id-1]][1]
if $skill_req[$tree_skill[$y_id][$x_id-1]][4] != nil
$skill_points[$actor_id][$class_id] -= $skill_req[$tree_skill[$y_id][$x_id-1]][1]
$game_actors[$game_party.members[$actor_index].id].add_param( $skill_req[$tree_skill[$y_id][$x_id-1]][4], $skill_req[$tree_skill[$y_id][$x_id-1]][5])
$learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] += 1
Audio.se_play("Audio/SE/Blind",50)
else
$skill_points[$actor_id][$class_id] -= $skill_req[$tree_skill[$y_id][$x_id-1]][1]
$game_actors[$game_party.members[$actor_index].id].forget_skill($tree_skill[$y_id][$x_id-1] + $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] - 1 )
$game_actors[$game_party.members[$actor_index].id].learn_skill($tree_skill[$y_id][$x_id-1] + $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]])
$learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] += 1
Audio.se_play("Audio/SE/Blind",50)
end
else
Sound.play_buzzer
end
end
def dispose_tree
@background_sprite.bitmap.dispose
@background_sprite.dispose
x = 0
y = 1
loop = 0
loop do
break if loop == $tree_cells
if x == $tree_column
x = 0
y += 1
end
if $tree_back[y][x] > 0
@background[loop].bitmap.dispose
@background[loop].dispose
end
x += 1
loop +=1
end
x = 0
y = 1
loop = 0
loop do
break if loop == $tree_cells
if x == $tree_column
x = 0
y += 1
end
if $tree_skill[y][x] > 0
@skill[$tree_skill[y][x]].bitmap.dispose
@skill[$tree_skill[y][x]].dispose
end
x += 1
loop +=1
end
@cursore.bitmap.dispose
@cursore.dispose
end
def cancel
Sound.play_cancel
dispose_tree
SceneManager.return
end
end
class Window_SkillInfo < Window_Base
def initialize
super(0, 0, window_width, line_height * 5)
refresh
end
def window_width
return Graphics.width
end
def open
super
refresh
end
def refresh
contents.clear
if $tree_skill[$y_id][$x_id - 1] > 0
if $skill_req[$tree_skill[$y_id][$x_id-1]][4] != nil
draw_icon($data_skills[$tree_skill[$y_id][$x_id-1]].icon_index, 0, 0)
draw_text(24,0,contents.width,line_height,$data_skills[$tree_skill[$y_id][$x_id-1]].name)
draw_text(self.width - 180, 0, contents.width,line_height,"Стоимость SP:#{$skill_req[$tree_skill[$y_id][$x_id-1]][1]}") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] < $skill_req[$tree_skill[$y_id][$x_id-1]][0]
draw_text(self.width - 280, 0, contents.width,line_height,"Не изучен") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
draw_text(self.width - 280, 0, contents.width,line_height,"УР:#{$learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]]}") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] > 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] < $skill_req[$tree_skill[$y_id][$x_id-1]][0]
draw_text(self.width - 280, 0, contents.width,line_height,"MAX") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == $skill_req[$tree_skill[$y_id][$x_id-1]][0]
draw_text(0,0,contents.width,line_height*3,"Необходим навык:#{$data_skills[$skill_req[$tree_skill[$y_id][$x_id-1]][3]].name}") if $skill_req[$tree_skill[$y_id][$x_id-1]][3] != 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
draw_text(self.width - 150,0,contents.width,line_height*3,"Нужен ур.:#{$skill_req[$tree_skill[$y_id][$x_id-1]][2]}") if $skill_req[$tree_skill[$y_id][$x_id-1]][2] != 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
text = $data_skills[$tree_skill[$y_id][$x_id-1]].description
draw_text_ex(0, line_height * 2, text)
else
draw_icon($data_skills[$tree_skill[$y_id][$x_id-1]].icon_index, 0, 0)
draw_text(24,0,contents.width,line_height,$data_skills[$tree_skill[$y_id][$x_id-1]].name) if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
draw_text(24,0,contents.width,line_height,$data_skills[$tree_skill[$y_id][$x_id-1] + $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] - 1].name) if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] > 0
draw_text(self.width - 180, 0, contents.width,line_height,"Стоимость SP:#{$skill_req[$tree_skill[$y_id][$x_id-1]][1]}") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] < $skill_req[$tree_skill[$y_id][$x_id-1]][0]
draw_text(self.width - 280, 0, contents.width,line_height,"Не изучен") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
draw_text(self.width - 280, 0, contents.width,line_height,"УР:#{$learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]]}") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] > 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] < $skill_req[$tree_skill[$y_id][$x_id-1]][0]
draw_text(self.width - 280, 0, contents.width,line_height,"MAX") if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == $skill_req[$tree_skill[$y_id][$x_id-1]][0]
draw_text(0,0,contents.width,line_height*3,"Необходим навык:#{$data_skills[$skill_req[$tree_skill[$y_id][$x_id-1]][3]].name}") if $skill_req[$tree_skill[$y_id][$x_id-1]][3] != 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
draw_text(self.width - 150,0,contents.width,line_height*3,"Нужен ур.:#{$skill_req[$tree_skill[$y_id][$x_id-1]][2]}") if $skill_req[$tree_skill[$y_id][$x_id-1]][2] != 0 and $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
text = $data_skills[$tree_skill[$y_id][$x_id-1]].description if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] == 0
text = $data_skills[$tree_skill[$y_id][$x_id-1] + $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] - 1].description if $learn[$actor_id][$class_id][$tree_skill[$y_id][$x_id-1]] > 0
draw_text_ex(0, line_height * 2, text)
end
end
end
end
class Window_SkillTree < Window_Base
def initialize
super(0, line_height * 5, window_width, window_height)
refresh
end
def window_width
return Graphics.width
end
def window_height
return Graphics.height - line_height * 7
end
def open
super
refresh
end
def refresh
contents.clear
end
end
class Window_ActorInfo < Window_Base
def initialize
super(0, y_y, window_width, line_height*2)
refresh
end
def window_width
return Graphics.width
end
def y_y
return Graphics.height - 48
end
def open
super
refresh
end
def refresh
contents.clear
change_color(system_color)
text = $game_actors[$game_party.members[$actor_index].id].name
draw_text(0,0,contents.width,line_height, text)
change_color(normal_color)
text = $game_actors[$game_party.members[$actor_index].id].class.name
draw_text(100,0,contents.width,line_height, text)
text = $game_actors[$game_party.members[$actor_index].id].level
draw_text(200,0,contents.width,line_height,"Ур. #{text}")
change_color(system_color)
draw_text(self.width - 100,0,contents.width,line_height,"SP:#{$skill_points[$actor_id][$class_id]}")
change_color(normal_color)
end
end
class Scene_Title < Scene_Base
alias hight_command_new_game command_new_game
def command_new_game
hight_command_new_game
$actor_index = 0
load_tree_constants
load_tree_variables
$learn = Array($actors_num + 1) {0}
i = 0
while i < $actors_num + 1
$learn[i] = Array.new($classes_num + 1) {0}
i += 1
end
@j = 0
@u = Array.new(1000) {0}
loop do
break if @j == $actors_num + 1
while @u[@j] < $classes_num + 1
$learn[@j][@u[@j]] = Array.new($data_skills.size) {0}
@u[@j] += 1
end
@j += 1
end
$level_up = Array.new($actors_num + 1) {0}
i = 0
while i < $actors_num + 1
$level_up[i] = Array.new($classes_num + 1) {0}
i += 1
end
$skill_points = Array.new($actors_num + 1) {0}
i = 0
while i < $actors_num + 1
$skill_points[i] = Array.new($classes_num + 1) {0}
i += 1
end
end
end
module DataManager
class << self
alias hight_make_save_contents make_save_contents
def make_save_contents
contents = hight_make_save_contents
contents[:actor_index] = $actor_index
contents[:level_up] = $level_up
contents[:skill_points] = $skill_points
contents[:learn] = $learn
contents
end
alias hight_extract_save_contents extract_save_contents
def extract_save_contents(contents)
hight_extract_save_contents(contents)
$actor_index = contents[:actor_index]
$level_up = contents[:level_up]
$skill_points = contents[:skill_points]
$learn = contents[:learn]
end
end
end
if TREE::MENU
class Window_MenuCommand < Window_Command
alias hight_add_main_commands add_main_commands
def add_main_commands
hight_add_main_commands
add_command(TREE::NAME, :skill_tree, main_commands_enabled)
end
end
class Scene_Menu < Scene_MenuBase
alias hight_create_command_window create_command_window
def create_command_window
hight_create_command_window
@command_window.set_handler(:skill_tree, method(:tree_command))
end
def tree_command
SceneManager.call(Scene_SkillTree)
end
end
end