Introdução
Iae galerinha, venho aqui postar um script simples que fiz, ele é muito simples, apenas faz aparecer uma progress bar para cada status (agi, spi, str, def, hp e mp). Espero que gostem.
Para usar basta substituir sua Window Character por esta.
Screen
Script
Iae galerinha, venho aqui postar um script simples que fiz, ele é muito simples, apenas faz aparecer uma progress bar para cada status (agi, spi, str, def, hp e mp). Espero que gostem.
Para usar basta substituir sua Window Character por esta.
Screen
- Spoiler:
Script
- Código:
#==============================================================================
# Window Character
# By: Paulo Soreto
#==============================================================================
class Window_Character < Window_Base
def initialize
super(10, (Graphics.height-296)/2, 224, 312)
@title.draw_text(@title.rect, Vocab.status, 1)
$windows << self
@button = []
for i in 0...6
@button[i] = Button.new(self, contents.width-10, (WLH*5)+(WLH*i)+2, "+")
end
@button[0].onclick_left { add_status(0) } # Adiciona HP
@button[1].onclick_left { add_status(1) } # Adiciona MP
@button[2].onclick_left { add_status(2) } # Adiciona Atk
@button[3].onclick_left { add_status(3) } # Adiciona Def
@button[4].onclick_left { add_status(4) } # Adiciona Spi
@button[5].onclick_left { add_status(5) } # Adiciona Agi
refresh
end
def update
super
refresh if something_changed?
on_close if Input.trigger?(Input::B)
end
def refresh
@old_lvl = $actor.level
@old_exp = $actor.exp
@old_hp = $actor.hp
@old_mp = $actor.mp
@old_maxhp = $actor.maxhp
@old_maxmp = $actor.maxmp
@old_atk = $actor.atk
@old_def = $actor.def
@old_spi = $actor.spi
@old_agi = $actor.agi
@old_gold = $game_party.gold
@old_points = $actor.points
self.contents.clear
self.contents.font.color = system_color
draw_face($actor.face_name, $actor.face_index, 0, 8)
self.contents.draw_text(100, WLH*2+8, contents.width, WLH, "#{Vocab.level}:")
self.contents.draw_text(100, WLH*3+8, contents.width, WLH, "#{Vocab::Points}:")
self.contents.draw_text(0, WLH*4+8, contents.width, WLH, "#{Vocab.hp}:")
self.contents.draw_text(0, WLH*5+8, contents.width, WLH, "#{Vocab.mp}:")
self.contents.draw_text(0, WLH*6+8, contents.width, WLH, "#{Vocab.atk}:")
self.contents.draw_text(0, WLH*7+8, contents.width, WLH, "#{Vocab.def}:")
self.contents.draw_text(0, WLH*8+8, contents.width, WLH, "#{Vocab.spi}:")
self.contents.draw_text(0, WLH*9+8, contents.width, WLH, "#{Vocab.agi}:")
self.contents.draw_text(0, WLH*10+8, contents.width, WLH, "Gold:")
self.contents.font.color = normal_color
#Barra de hp
hp_bar = ProgressBar.new(self, 46, WLH*5+3, $actor.hp, 130)
hp_bar.index = $actor.hp
hp_bar.max = $actor.maxhp
hp_bar.text = "#{$actor.hp}/#{$actor.maxhp}"
update
#Barra de mp
mp_bar = ProgressBar.new(self, 46, WLH*6+3, $actor.mp, 130)
mp_bar.index = $actor.mp
mp_bar.max = $actor.maxmp
mp_bar.text = "#{$actor.mp}/#{$actor.maxmp}"
#Barra de atk
atk_bar = ProgressBar.new(self, 46, WLH*7+3, $actor.attack, 130)
atk_bar.index = $actor.attack
atk_bar.max = 999
atk_bar.text = "#{$actor.attack}"
#Barra de def
def_bar = ProgressBar.new(self, 46, WLH*8+3, $actor.defense, 130)
def_bar.index = $actor.defense
def_bar.max = 999
def_bar.text = "#{$actor.defense}"
#Barra de spirit
def_bar = ProgressBar.new(self, 46, WLH*9+3, $actor.spirit, 130)
def_bar.index = $actor.spirit
def_bar.max = 999
def_bar.text = "#{$actor.spirit}"
#Barra de agility
agi_bar = ProgressBar.new(self, 46, WLH*10+3, $actor.agility, 130)
agi_bar.index = $actor.agility
agi_bar.max = 999
agi_bar.text = "#{$actor.agility}"
self.contents.draw_text(100, 8, contents.width, WLH, $actor.class.name)
self.contents.draw_text(148, WLH*2+8, contents.width, WLH, $actor.level)
self.contents.draw_text(46, WLH*10+8, contents.width, WLH, "#{$game_party.gold}")
self.contents.draw_text(148, WLH*3+8, contents.width, WLH, $actor.points)
self.contents.font.shadow = Font.default_shadow
self.contents.draw_text(0, 8, contents.width, WLH, $actor.name)
end
def something_changed?
return true if @old_lvl != $actor.level
return true if @old_exp != $actor.exp
return true if @old_hp != $actor.hp
return true if @old_mp != $actor.mp
return true if @old_maxhp != $actor.maxhp
return true if @old_maxmp != $actor.maxmp
return true if @old_atk != $actor.atk
return true if @old_def != $actor.def
return true if @old_spi != $actor.spi
return true if @old_agi != $actor.agi
return true if @old_points != $actor.points
return true if @old_gold != $game_party.gold
return false
end
def add_status(type)
if $actor.points <= 0
Sound.play_buzzer
return
end
Sound.play_decision
case type
when 0; $actor.max_hp += 10
when 1; $actor.max_mp += 10
when 2; $actor.attack += 1
when 3; $actor.defense += 1
when 4; $actor.spirit += 1
when 5; $actor.agility += 1
end
$actor.points -= 1
refresh
end
end