#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=#
# ▼ Sistema de Atributos #
# Autor: Dragolipe2 #
# Data de Criação: 29/05/2022 #
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=#
class Scene_Atributos < Scene_MenuBase
def start
super
@ator = $game_party.menu_actor.id
#Criação Background
@background = Sprite.new
@background.bitmap = Cache.load_bitmap("Graphics/Pictures/", "Atributos_Scene#{@ator}")
@background.z = 0
#Criação Janela de Descrição
@descricao = 1 #Inicia no Poder
@info_status = Sprite.new
@info_status.bitmap = Cache.load_bitmap("Graphics/Pictures/","Atributos Descrição#{@descricao}")
@info_status.z = 100
#Criação da Janela de Status
@info_base = Info_Base.new(192, 128, 256, 160)
@info_base.opacity = 0
@info_base.z = 50
@info_base.contents.font.name = "Prototype"
@info_base.contents.font.size = 17
@info_base.contents.font.out_color = Color.new(0, 0, 0, 255)
#Desenho Pontos Atributos
@info_base.draw_text(172, 3, 100, 12, $game_system.pt_atributo[@ator])
#Desenho dos Atributos
@info_base.contents.font.name = "Eurotype"
@info_base.draw_text(9, 100, 80, 12, $game_system.pt_poder[@ator])
@info_base.draw_text(9 + 64, 100, 80, 12, $game_system.pt_defesa[@ator])
@info_base.draw_text(9 + 128, 100, 80, 12, $game_system.pt_destreza[@ator])
@info_base.draw_text(9 + 192, 100, 80, 12, $game_system.pt_sabedoria[@ator])
#Criação da Janela de Status
@info_texto = Info_Texto.new(0, 0, 640, 480)
@info_texto.opacity = 0
@info_texto.contents.font.name = "Eurotype"
@info_texto.contents.font.size = 14
@info_texto.contents.font.out_color = Color.new(0, 0, 0, 255)
#Desenho dos Status
@info_texto.draw_text(56, 397, 80, 12, $game_actors[@ator].atk)
@info_texto.draw_text(57, 414, 80, 12, $game_actors[@ator].mat)
#Criação Janela Selecionavel
@window_escolha = Window_Escolha.new
@window_escolha.opacity = 0
@window_escolha.z = 200
@window_escolha.set_handler(:poder, method(:atk))
@window_escolha.set_handler(:defesa, method(:guard))
@window_escolha.set_handler(:destreza, method(:dex))
@window_escolha.set_handler(:cura, method(:heal))
end #def Start
class Info_Base < Window_Base #Janela Status
def initialize(x, y, width, height)
super
end #initialize
end #class Info_Base
class Info_Texto < Window_Base #Janela Status
def initialize(x, y, width, height)
super
end #initialize
end #class Info_Texto
class Window_Escolha < Window_HorzCommand #Janela Escolha Horizon
def initialize
super(201, 185)
end #initialize
def window_width() return 275 end # 230
def window_height() return 50 end # 48
def col_max
return 4
end #def
def item_rect(index)
rect = super
rect.width = 22
rect.height = 22
rect
end
def make_command_list
add_command("", :poder)
add_command("", :defesa)
add_command("", :destreza)
add_command("", :cura)
end #def
end #class Window_Escolha
def atk
if $game_system.pt_atributo[@ator] >0 #1 Cond
$game_system.pt_atributo[@ator] -= 1
$game_system.pt_poder[@ator] += 1
$game_actors[@ator].add_param(2, 1) #Força
$game_actors[@ator].add_param(4, 1) #Magia
pontos_gerais
status_update
@window_escolha.activate
else
Sound.play_buzzer
@window_escolha.activate
end #1 Cond
end #def atk
def guard
if $game_system.pt_atributo[@ator] >0 #1 Cond
$game_system.pt_atributo[@ator] -= 1
$game_system.pt_defesa[@ator] += 1
$game_actors[@ator].add_param(0, 3) #HP Máximo
$game_actors[@ator].add_param(3, 1) #Defesa
$game_actors[@ator].add_param(5, 1) #Espírito
pontos_gerais
status_update
@window_escolha.activate
else
Sound.play_buzzer
@window_escolha.activate
end #1 Cond
end #def def
def dex
if $game_system.pt_atributo[@ator] >0 #1 Cond
$game_system.pt_atributo[@ator] -= 1
$game_system.pt_destreza[@ator] += 1
$game_actors[@ator].add_param(6, 1) #Agilidade
pontos_gerais
status_update
@window_escolha.activate
else
Sound.play_buzzer
@window_escolha.activate
end #1 Cond
end #def dex
def heal
if $game_system.pt_atributo[@ator] >0 #1 Cond
$game_system.pt_atributo[@ator] -= 1
$game_system.pt_sabedoria[@ator] += 1
$game_actors[@ator].add_param(7, 1) #Cura
pontos_gerais
status_update
@window_escolha.activate
else
Sound.play_buzzer
@window_escolha.activate
end #1 Cond
end #def heal
def update
super
if Input.trigger?(:RIGHT)
case @descricao
when 1
@descricao = 2
descricao_update
status_update
when 2
@descricao = 3
descricao_update
status_update
when 3
@descricao = 4
descricao_update
status_update
when 4
@descricao = 1
descricao_update
status_update
end #case descricao
end #(:RIGHT)
if Input.trigger?(:LEFT)
case @descricao
when 4
@descricao = 3
descricao_update
status_update
when 3
@descricao = 2
descricao_update
status_update
when 2
@descricao = 1
descricao_update
status_update
when 1
@descricao = 4
descricao_update
status_update
end #case decricao
end #(:LEFT)
if Input.trigger?(:B)
SceneManager.return
end #Cond (:B)
if Input.trigger?(:L)
case @ator
when 1 #@ator == 1
if $game_party.members.size >= 2 #game_party.size
if $game_party.members.include?($game_actors[3]) #def ator 2 ?
$game_party.menu_actor_prev
Sound.play_cursor
@ator = 3
else #ator 2 n esta
$game_party.menu_actor_prev
Sound.play_cursor
@ator = 2
end #def ator 2 ?
else #game_size menor 2
Sound.play_buzzer
@ator = 1
end #game_party.size
when 2 #@ator == 2
$game_party.menu_actor_prev
Sound.play_cursor
@ator = 1
when 3 #@ator == 3
if $game_party.members.include?($game_actors[2]) #def ator 3 ?
$game_party.menu_actor_prev
Sound.play_cursor
@ator = 2
else
$game_party.menu_actor_prev
Sound.play_cursor
@ator = 1
end #def ator 3 ?
end #case
pontos_gerais
status_update
background_update
end #Cond (:L)
if Input.trigger?(:R)
case @ator
when 1 #@ator == 1
if $game_party.members.size >= 2 #game_party.size
if $game_party.members.include?($game_actors[2]) #def ator 2 ?
$game_party.menu_actor_next
Sound.play_cursor
@ator = 2
else #ator 2 n esta
$game_party.menu_actor_next
Sound.play_cursor
@ator = 3
end #def ator 2 ?
else #game_size menor 2
Sound.play_buzzer
@ator = 1
end #game_party.size
when 2 #@ator == 2
if $game_party.members.include?($game_actors[3]) #def ator 3 ?
$game_party.menu_actor_next
Sound.play_cursor
@ator = 3
else
$game_party.menu_actor_next
Sound.play_cursor
@ator = 1
end #def ator 3 ?
when 3 #@ator == 3
$game_party.menu_actor_next
Sound.play_cursor
@ator = 1
end #case
pontos_gerais
status_update
background_update
end #Cond (:R)
end #update
def descricao_update
@info_status.bitmap = Cache.load_bitmap("Graphics/Pictures/","Atributos Descrição#{@descricao}")
end
def background_update
@background.bitmap = Cache.load_bitmap("Graphics/Pictures/", "Atributos_Scene#{@ator}")
end
def pontos_gerais
@info_base.contents.clear
@info_base.contents.font.name = "Prototype"
@info_base.contents.font.size = 17
@info_base.contents.font.out_color = Color.new(0, 0, 0, 255)
#Desenho Pontos Atributos
@info_base.draw_text(172, 3, 100, 12, $game_system.pt_atributo[@ator])
#Desenho dos Atributos
@info_base.contents.font.name = "Eurotype"
@info_base.draw_text(9, 100, 80, 12, $game_system.pt_poder[@ator])
@info_base.draw_text(9 + 64, 100, 80, 12, $game_system.pt_defesa[@ator])
@info_base.draw_text(9 + 128, 100, 80, 12, $game_system.pt_destreza[@ator])
@info_base.draw_text(9 + 192, 100, 80, 12, $game_system.pt_sabedoria[@ator])
end
def status_update
case @descricao
when 1
@info_texto.draw_text(56, 397, 100, 12, $game_actors[@ator].atk)
@info_texto.draw_text(57, 414, 100, 12, $game_actors[@ator].mat)
when 2
@info_texto.contents.clear
@info_texto.draw_text(39, 397, 100, 12, $game_actors[@ator].mhp)
@info_texto.draw_text(65, 414, 100, 12, $game_actors[@ator].def)
@info_texto.draw_text(67, 432, 100, 12, $game_actors[@ator].mdf)
when 3
@info_texto.contents.clear
@info_texto.draw_text(75, 397, 100, 12, $game_actors[@ator].agi)
cri = $game_actors[@ator].cri.round(1) * 100
eva = $game_actors[@ator].eva.round(1) * 100
@info_texto.draw_text(69, 414, 100, 12, "#{cri} %")
@info_texto.draw_text(90, 432, 100, 12, "#{eva} %")
when 4
@info_texto.contents.clear
@info_texto.draw_text(50, 397, 100, 12, $game_actors[@ator].luk)
mev = $game_actors[@ator].mev.round(1) * 100
cnt = $game_actors[@ator].cnt.round(1) * 100
@info_texto.draw_text(112, 414, 100, 12, "#{mev} %")
@info_texto.draw_text(106, 432, 100, 12, "#{cnt} %")
end #case
end #def status
end #class Atributos
#==============================================================================
# ■ Dragolipe_Pontos Atributos/Level Up
#==============================================================================
class Game_System
attr_accessor :pt_atributo
attr_accessor :pt_poder
attr_accessor :pt_defesa
attr_accessor :pt_destreza
attr_accessor :pt_sabedoria
attr_accessor :pt_cristais
attr_accessor :pt_cristais_max
alias :my_test_initialize :initialize
def initialize
my_test_initialize
@pt_atributo = [nil,0,0,5] #pontos atributos
@pt_poder = [nil,10,10,10] #pontos poder
@pt_defesa = [nil,10,10,10] #pontos defesa
@pt_destreza = [nil,10,10,10] #pontos destreza
@pt_sabedoria = [nil,10,10,10] #pontos sabedoria
@pt_cristais = [nil,10,10,10] #pontos cristais atuais
@pt_cristais_max = [nil,10,10,10] #pontos cristais máximos
end #initialize
end #class Game_System
class Game_Actor < Game_Battler
alias :drago_level_up :level_up
def level_up
drago_level_up
$game_system.pt_atributo[self.id]+=5
end
end