Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o tema • Voltar para a ficha do tema
Barras HP, SP y exp no menu!
+3
Felix Blayder
Valentine
DarkCloud
7 participantes
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Scripts
Página 1 de 1
Barras HP, SP y exp no menu!
Bom, este foi o primer script que logrei crear, espero que nao este tan mal ^^
Comenten y falem o que esta bem y o que esta mal ^^
- Código:
#==============================================================================#
#==============================#Por:DarkCloud#=================================#
#==============================================================================#
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level 1] > 0 ? @exp_list[@level 1] - @exp_list[@level] : 0
end
end
class Window_Base < Window
alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
if actor.maxhp != 0
hp = (width plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end
gauge_rect(x plus_x width * rate_x / 100, y plus_y,
width, plus_width width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_hp_original(actor, x, y, width)
end
alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
if actor.maxsp != 0
sp = (width plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width plus_width) * rate_width / 100
end
gauge_rect(x plus_x width * rate_x / 100, y plus_y,
width, plus_width width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_sp_original(actor, x, y, width)
end
alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
if actor.next_exp != 0
exp = (width plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width plus_width) * rate_width / 100
end
gauge_rect(x plus_x width * rate_x / 100, y plus_y,
width, plus_width width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_exp_original(actor, x, y)
end
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x = (rect_width - width) / 2
when 2
x = rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x 1, y 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
self.contents.gradation_rect(x 2, y 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x = width - gauge
end
self.contents.gradation_rect(x 2, y 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end
class Bitmap
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x width
red = color1.red (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y height
red = color1.red
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x width
for j in y...y height
red = color1.red (color2.red - color1.red) *
((i - x) / (width - 1.0) (j - y) / (height - 1.0)) / 2
green = color1.green (color2.green - color1.green) *
((i - x) / (width - 1.0) (j - y) / (height - 1.0)) / 2
blue = color1.blue (color2.blue - color1.blue) *
((i - x) / (width - 1.0) (j - y) / (height - 1.0)) / 2
alpha = color1.alpha (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x width
for j in y...y height
red = color1.red (color2.red - color1.red) *
((x width - i) / (width - 1.0) (j - y) / (height - 1.0)) / 2
green = color1.green (color2.green - color1.green) *
((x width - i) / (width - 1.0) (j - y) / (height - 1.0)) / 2
blue = color1.blue (color2.blue - color1.blue) *
((x width - i) / (width - 1.0) (j - y) / (height - 1.0)) / 2
alpha = color1.alpha (color2.alpha - color1.alpha) *
((x width - i) / (width - 1.0) (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end
Comenten y falem o que esta bem y o que esta mal ^^
Re: Barras HP, SP y exp no menu!
cara.. coloque alguma screen ae do script pra gente poder avaliar melhor teu script
vlw por compartilhar
vlw por compartilhar
_________________
Se inscreva em meu Canal no YouTube:
https://www.youtube.com/localnerd
Faça uma doação para ajudar nos custos:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3N8T2RJ977RCQ
Faça uma doação para ajudar nos custos:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3N8T2RJ977RCQ
Felix Blayder- Membro de Honra
- Mensagens : 1406
Créditos : 220
Ficha do personagem
Nível: 1
Experiência:
(0/0)
Vida:
(30/30)
Re: Barras HP, SP y exp no menu!
Era bom vc posta umas imagens .
_________________
Dean, Programador Geral :)
Contato: Skype:matucarvalho e Facebook
The Enze - Vulzt
Shield Block
Contato: Skype:matucarvalho e Facebook
The Enze - Vulzt
Shield Block
Anti-Cheat para jogos de FPS, agora vou adaptar para jogos de RPG principalmente para o RMXP.
www.shieldblock.net
fb.com/shieldblockoficial
Re: Barras HP, SP y exp no menu!
parcero tava dando uma olhada no script... foi vc mesmo qm fez?
porq eu estava olhando e nele tem:
"Por:DarkCloud"
logo no começo.... c este "DarkCloud", fo vc me desculpe, c ñ for.. edite o topico e coloke os devidos créditos do autor...
porq eu estava olhando e nele tem:
"Por:DarkCloud"
logo no começo.... c este "DarkCloud", fo vc me desculpe, c ñ for.. edite o topico e coloke os devidos créditos do autor...
_________________
Se inscreva em meu Canal no YouTube:
https://www.youtube.com/localnerd
Faça uma doação para ajudar nos custos:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3N8T2RJ977RCQ
Faça uma doação para ajudar nos custos:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3N8T2RJ977RCQ
Felix Blayder- Membro de Honra
- Mensagens : 1406
Créditos : 220
Ficha do personagem
Nível: 1
Experiência:
(0/0)
Vida:
(30/30)
Re: Barras HP, SP y exp no menu!
Screen?
parece bom o script
parece bom o script
_________________
Para Aqueles que gostam de Min e de meu Trabalho;
Upem Meu Pet nao custa nda!!
- Pet:
Nanzin- Membro de Honra
- Mensagens : 1550
Créditos : 252
Re: Barras HP, SP y exp no menu!
Por favor não reviva topics, da proxima vez sera denunciado...Whiskey escreveu:otimo Script +1Crédito
LeonM²- Lenda
- Mensagens : 1802
Créditos : 153
Tópicos semelhantes
» [Resolvido] Barras de Rank
» Teste - RpgMV sem barras pretas
» [Prof~] Mostrando HP de outros Players em Barras
» [Resolvido][Duvida] qual é o código que diminui as barras de Hp e MP da gui
» [EVO] Menu
» Teste - RpgMV sem barras pretas
» [Prof~] Mostrando HP de outros Players em Barras
» [Resolvido][Duvida] qual é o código que diminui as barras de Hp e MP da gui
» [EVO] Menu
Aldeia RPG :: RPG Maker :: Rpg Maker XP :: Scripts
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos