Invité Invité
| Sujet: [VX] Barre de vie, magie et d'exp sur la map Jeu 4 Aoû 2011 - 20:44 | |
| Description: Permet de voir les informations de son personnage sur la map Script à placer au-dessus de main Auteur: Ivy-chan Screen: Script: - Code:
-
#===============================================================================
# AI-chan HUD Customizada...
# Por Angel Ivy-chan,
# Para RPG Maker Brasil e Evolution.
#===============================================================================
class Ai_chan_HUD2 < Window_Base
def initialize
super(0,0,544,416)
@hp1 = Color.new(0,160,87)
@hp2 = Color.new(159,241,193)
@mp1 = Color.new(0,74,127)
@mp2 = Color.new(139,174,216)
@exp1 = Color.new(120,100,50)
@exp2 = Color.new(220,215,170)
@back1 = Color.new(0,0,0)
@back2 = Color.new(255,255,255)
self.contents = Bitmap.new(500,380)
self.contents.font.size = 20
self.opacity = 0
self.z = 300
update
end
def update
self.contents.clear
@hp2 = Color.new(159,241,193)
if $game_party.members[0].hp <= $game_party.members[0].maxhp / 4
@hp2 = Color.new(241,159,93)
@hp1 = Color.new(160,0,87)
else
@hp1 = Color.new(0,160,87)
@hp2 = Color.new(159,241,193)
end
if $game_party.members[0].mp <= $game_party.members[0].maxmp / 4
@mp1 = Color.new(74,0,127)
@mp2 = Color.new(174,139,216)
else
@mp1 = Color.new(0,74,127)
@mp2 = Color.new(139,174,216)
end
actor = $game_party.members[0]
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
#-------------------------------------------------------------------------------
# Elipse Esquisita:
#-------------------------------------------------------------------------------
#self.contents.fill_rect(0,0,210,80,@back1)
self.contents.fill_rect(0,26,210,20,@back1)
self.contents.fill_rect(1,24,208,24,@back1)
self.contents.fill_rect(3,22,204,28,@back1)
self.contents.fill_rect(6,20,198,32,@back1)
self.contents.fill_rect(10,18,190,36,@back1)
self.contents.fill_rect(15,16,180,40,@back1)
self.contents.fill_rect(21,14,168,44,@back1)
self.contents.fill_rect(28,12,154,48,@back1)
self.contents.fill_rect(36,10,138,52,@back1)
self.contents.fill_rect(43,8,120,56,@back1)
self.contents.fill_rect(53,6,100,60,@back1)
self.contents.fill_rect(64,4,78,64,@back1)
#-------------------------------------------------------------------------------
# Alguns dados importantes:
#-------------------------------------------------------------------------------
draw_character(actor.character_name, actor.character_index, 25, 55)
@sarix = 35
self.contents.font.size = 16
self.contents.draw_text(@sarix + 20, 0, 120, 24, "#{$game_party.members[0].name}:")
#-------------------------------------------------------------------------------
# Barra de HP:
#-------------------------------------------------------------------------------
hp = $game_party.members[0].hp
maxhp = $game_party.members[0].maxhp
wb = 146 * hp / maxhp
self.contents.fill_rect(@sarix + 10, 25, 150, 8, @back1)
self.contents.font.size = 12
self.contents.font.bold = true
self.contents.fill_rect(@sarix + 11, 26, 148, 6, @back2)
self.contents.fill_rect(@sarix + 12, 27, 146, 4, @back1)
self.contents.gradient_fill_rect(@sarix + 12, 27, wb, 4, @hp1, @hp2)
self.contents.draw_text(@sarix + 10, 15, 24, 24, "HP")
self.contents.draw_text(@sarix + 100, 20, 120, 24, "#{$game_party.members[0].hp}/#{$game_party.members[0].maxhp}")
#-------------------------------------------------------------------------------
# Barra de MP:
#-------------------------------------------------------------------------------
mp = $game_party.members[0].mp
maxmp = $game_party.members[0].maxmp
wb = 146 * mp / maxmp
self.contents.fill_rect(@sarix + 10, 40, 150, 8, @back1)
self.contents.fill_rect(@sarix + 11, 41, 148, 6, @back2)
self.contents.fill_rect(@sarix + 12, 42, 146, 4, @back1)
self.contents.gradient_fill_rect(@sarix + 12, 42, wb, 4, @mp1, @mp2)
self.contents.draw_text(@sarix + 10, 30, 24, 24, "MP")
self.contents.draw_text(@sarix + 100, 35, 120, 24, "#{$game_party.members[0].mp}/#{$game_party.members[0].maxmp}")
#-------------------------------------------------------------------------------
# Barra de EXP:
#-------------------------------------------------------------------------------
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
@sariexp = actor.now_exp * 100 / actor.next_exp
else
rate = 1
@sariexp = "Max"
end
self.contents.fill_rect(@sarix + 10, 55, 150, 8, @back1)
self.contents.fill_rect(@sarix + 11, 56, 148, 6, @back2)
self.contents.fill_rect(@sarix + 12, 57, 146, 4, @back1)
self.contents.gradient_fill_rect(@sarix + 12, 57, 146 * rate, 4, @exp1, @exp2)
self.contents.draw_text(@sarix + 10, 45, 24, 24, "EXP:")
self.contents.draw_text(@sarix + 100, 50, 120, 24, "#{@sariexp}%")
#-------------------------------------------------------------------------------
# Outros:
#-------------------------------------------------------------------------------
self.contents.fill_rect(8,50,36,12,@back1)
draw_misari_actor_level(actor, 10, 45)
end
end
class Window_Base
def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, WLH, actor.level, 2)
end
end
class Window_Base
def draw_misari_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 6, y, 24, WLH, actor.level, 2)
end
end
class Spriteset_Map
alias hud_initialize initialize
alias hud_update update
alias hud_dispose dispose
def initialize
@hud = Ai_chan_HUD2.new
hud_initialize
end
def update
@hud.update
if $game_switches[2] == true
@hud.visible = true
else
@hud.visible = false
end
hud_update
end
def dispose
@hud.dispose
hud_dispose
end
end
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
#-------------------------------------------------------------------------------
# Propriedade de RPG Maker Brasil, e RPG Maker Evolution.
# Não quero ver em nenhum outro lugar... Qualquer coisa: "sariangelivy@gmail.com"
# RPG Maker Brasil: http://www.rpgmakerbrasil.com/forum/f43/ai-chan-custom-hud-7367.html#post76279
# RPG Maker Evolution: http://rpgmakerevolution1.ipbfree.com/index.php?showtopic=122
#------------------------------ |
|