Sign in to follow this  
Followers 0
DarkLight

Barras de enemigos

11 posts in this topic

hello, otra vez haciendo (o editando) scripts, este script esta en gran parte creado por SephirothSpawn, pero yo le cambie los colroes, tamaño y lo que hace precisamente xD, en vez de mostrar el % de hp muestra el HP, y de paso la posibilidad de sp lo puedo dar en version Visible HP y SP, version no visible, version solo hp y visible y version solo hp y no visible.

a elegir xD:

IMG
[SPOILER]user posted image[/SPOILER]

HP y texto visible
[SPOILER]
CODE
class Window_Base < Window  
 #--------------------------------------------------------------------------
 # * Draw Slant Bar(by SephirothSpawn)
 #--------------------------------------------------------------------------
 #****************************************************************************#
 # Implementado y mejorado (Implemented) by                                   #
 #                                                   DarkLight                #
 #****************************************************************************#
 def draw_slant_bar(x, y, min, max, width = 152, height = 6,
     bar_color = Color.new(100, 255, 0, 255), end_color = Color.new(200, 255, 0, 255))
   # Draw Border
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   # Draw Background
   for i in 1..(height - 1)
     r = 100 * (height - i) / height + 0 * i / height
     g = 100 * (height - i) / height + 0 * i / height
     b = 100 * (height - i) / height + 0 * i / height
     a = 255 * (height - i) / height + 255 * i / height
     self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
   end
   # Draws Bar
   for i in 1..( (min / max.to_f) * width - 1)
     for j in 1..(height - 1)
       r = bar_color.red * (width - i) / width + end_color.red * i / width
       g = bar_color.green * (width - i) / width + end_color.green * i / width
       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
       self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
     end
   end
 end
end


class Window_EnemyHP < Window_Base
 
 def initialize
   super(0, 0, 640, 480)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   refresh
 end
 
 def refresh
   self.contents.clear
   for i in 0...$game_troop.enemies.size
     @enemy = $game_troop.enemies[i]
     @percent = (@enemy.hp)
     unless @enemy.hp == 0
     draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))
     self.contents.font.color = text_color(2)
     self.contents.font.size = 16
     self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 22, 100, 32, "#{@percent}" + " HP")
   end
 end
end
end

class Scene_Battle
 
 alias raz_update update
 alias raz_update_phase5 update_phase5
 alias raz_update_phase4_step1 update_phase4_step1
 alias raz_update_phase4_step5 update_phase4_step5
 alias raz_enemy_hp_main main
 
  def main
   @troop_id = $game_temp.battle_troop_id
   $game_troop.setup(@troop_id)
   @enemy_window = Window_EnemyHP.new
   @enemy_window.z = 95
   raz_enemy_hp_main
   @enemy_window.dispose
 end
 
 def update
   @enemy_window.update
   raz_update
 end

 def update_phase5
   # If wait count is larger than 0
   if @phase5_wait_count > 0
     # Decrease wait count
     @phase5_wait_count -= 1
     # If wait count reaches 0
     if @phase5_wait_count == 0
       @enemy_window.visible = false
       # Show result window
       @result_window.visible = true
       # Clear main phase flag
       $game_temp.battle_main_phase = false
       # Refresh status window
       @status_window.refresh
       @enemy_window.refresh
     end
     return
   end
  raz_update_phase5
end

def update_phase4_step1
 raz_update_phase4_step1
 @enemy_window.refresh
end

 def update_phase4_step5
   # Hide help window
   @help_window.visible = false
   # Refresh status window
   @status_window.refresh
   @enemy_window.refresh
   raz_update_phase4_step5
 end
end
[/SPOILER]

HP y texto no visible
[SPOILER]
CODE
class Window_Base < Window  
 #--------------------------------------------------------------------------
 # * Draw Slant Bar(by SephirothSpawn)
 #--------------------------------------------------------------------------
 #****************************************************************************#
 # Implementado y mejorado (Implemented) by                                   #
 #                                                   DarkLight                #
 #****************************************************************************#
 def draw_slant_bar(x, y, min, max, width = 152, height = 6,
     bar_color = Color.new(100, 255, 0, 255), end_color = Color.new(200, 255, 0, 255))
   # Draw Border
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   # Draw Background
   for i in 1..(height - 1)
     r = 100 * (height - i) / height + 0 * i / height
     g = 100 * (height - i) / height + 0 * i / height
     b = 100 * (height - i) / height + 0 * i / height
     a = 255 * (height - i) / height + 255 * i / height
     self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
   end
   # Draws Bar
   for i in 1..( (min / max.to_f) * width - 1)
     for j in 1..(height - 1)
       r = bar_color.red * (width - i) / width + end_color.red * i / width
       g = bar_color.green * (width - i) / width + end_color.green * i / width
       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
       self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
     end
   end
 end
end


class Window_EnemyHP < Window_Base
 
 def initialize
   super(0, 0, 640, 480)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   refresh
 end
 
 def refresh
   self.contents.clear
   for i in 0...$game_troop.enemies.size
     @enemy = $game_troop.enemies[i]
     @percent = (@enemy.hp)
     unless @enemy.hp == 0
     draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))
     self.contents.font.color = text_color(2)
     self.contents.font.size = 16
#      self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 22, 100, 32, "#{@percent}" + " HP")
   end
 end
end
end

class Scene_Battle
 
 alias raz_update update
 alias raz_update_phase5 update_phase5
 alias raz_update_phase4_step1 update_phase4_step1
 alias raz_update_phase4_step5 update_phase4_step5
 alias raz_enemy_hp_main main
 
  def main
   @troop_id = $game_temp.battle_troop_id
   $game_troop.setup(@troop_id)
   @enemy_window = Window_EnemyHP.new
   @enemy_window.z = 95
   raz_enemy_hp_main
   @enemy_window.dispose
 end
 
 def update
   @enemy_window.update
   raz_update
 end

 def update_phase5
   # If wait count is larger than 0
   if @phase5_wait_count > 0
     # Decrease wait count
     @phase5_wait_count -= 1
     # If wait count reaches 0
     if @phase5_wait_count == 0
       @enemy_window.visible = false
       # Show result window
       @result_window.visible = true
       # Clear main phase flag
       $game_temp.battle_main_phase = false
       # Refresh status window
       @status_window.refresh
       @enemy_window.refresh
     end
     return
   end
  raz_update_phase5
end

def update_phase4_step1
 raz_update_phase4_step1
 @enemy_window.refresh
end

 def update_phase4_step5
   # Hide help window
   @help_window.visible = false
   # Refresh status window
   @status_window.refresh
   @enemy_window.refresh
   raz_update_phase4_step5
 end
end
[/SPOILER]

Con SP y texto visible

[SPOILER]
CODE
class Window_Base < Window  
 #--------------------------------------------------------------------------
 # * Draw Slant Bar(by SephirothSpawn)
 #--------------------------------------------------------------------------
 #****************************************************************************#
 # Implementado y mejorado (Implemented) by                                   #
 #                                                   DarkLight                #
 #****************************************************************************#
 def draw_slant_bar_sp(x, y, min, max, width = 152, height = 6,
     bar_color = Color.new(100, 0, 255, 255), end_color = Color.new(0, 100, 255, 255))
   # Draw Border
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   # Draw Background
   for i in 1..(height - 1)
     r = 100 * (height - i) / height + 0 * i / height
     g = 100 * (height - i) / height + 0 * i / height
     b = 100 * (height - i) / height + 0 * i / height
     a = 255 * (height - i) / height + 255 * i / height
     self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
   end
   # Draws Bar
   for i in 1..( (min / max.to_f) * width - 1)
     for j in 1..(height - 1)
       r = bar_color.red * (width - i) / width + end_color.red * i / width
       g = bar_color.green * (width - i) / width + end_color.green * i / width
       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
       self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
     end
   end
 end

 def draw_slant_bar(x, y, min, max, width = 152, height = 6,
     bar_color = Color.new(100, 255, 0, 255), end_color = Color.new(200, 255, 0, 255))
   # Draw Border
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   # Draw Background
   for i in 1..(height - 1)
     r = 100 * (height - i) / height + 0 * i / height
     g = 100 * (height - i) / height + 0 * i / height
     b = 100 * (height - i) / height + 0 * i / height
     a = 255 * (height - i) / height + 255 * i / height
     self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
   end
   # Draws Bar
   for i in 1..( (min / max.to_f) * width - 1)
     for j in 1..(height - 1)
       r = bar_color.red * (width - i) / width + end_color.red * i / width
       g = bar_color.green * (width - i) / width + end_color.green * i / width
       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
       self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
     end
   end
 end
end


class Window_EnemyHP < Window_Base
 
 def initialize
   super(0, 0, 640, 480)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   refresh
 end
 
 def refresh
   self.contents.clear
   for i in 0...$game_troop.enemies.size
     @enemy = $game_troop.enemies[i]
     @percent = (@enemy.hp)
     @percent2 = (@enemy.sp)
     unless @enemy.sp == 0
       self.contents.font.size = 16
     self.contents.font.color = text_color(2)
     draw_slant_bar_sp(@enemy.screen_x - 75, @enemy.screen_y + 10, @enemy.sp, @enemy.maxsp, width = 100, height = 5, bar_color = Color.new(100, 0, 255, 155), end_color = Color.new(0, 100, 255, 155))
     self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 2, 100, 32, "#{@percent2}" + " SP")
     self.contents.font.color = text_color(2)
     draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))
     
     
     self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 22, 100, 32, "#{@percent}" + " HP")
   end
 end
end
end

class Scene_Battle
 
 alias raz_update update
 alias raz_update_phase5 update_phase5
 alias raz_update_phase4_step1 update_phase4_step1
 alias raz_update_phase4_step5 update_phase4_step5
 alias raz_enemy_hp_main main
 
  def main
   @troop_id = $game_temp.battle_troop_id
   $game_troop.setup(@troop_id)
   @enemy_window = Window_EnemyHP.new
   @enemy_window.z = 95
   raz_enemy_hp_main
   @enemy_window.dispose
 end
 
 def update
   @enemy_window.update
   raz_update
 end

 def update_phase5
   # If wait count is larger than 0
   if @phase5_wait_count > 0
     # Decrease wait count
     @phase5_wait_count -= 1
     # If wait count reaches 0
     if @phase5_wait_count == 0
       @enemy_window.visible = false
       # Show result window
       @result_window.visible = true
       # Clear main phase flag
       $game_temp.battle_main_phase = false
       # Refresh status window
       @status_window.refresh
       @enemy_window.refresh
     end
     return
   end
  raz_update_phase5
end

def update_phase4_step1
 raz_update_phase4_step1
 @enemy_window.refresh
end

 def update_phase4_step5
   # Hide help window
   @help_window.visible = false
   # Refresh status window
   @status_window.refresh
   @enemy_window.refresh
   raz_update_phase4_step5
 end
end
[/SPOILER]

CON SP y texto no visible

[SPOILER]
CODE
class Window_Base < Window  
 #--------------------------------------------------------------------------
 # * Draw Slant Bar(by SephirothSpawn)
 #--------------------------------------------------------------------------
 #****************************************************************************#
 # Implementado y mejorado (Implemented) by                                   #
 #                                                   DarkLight                #
 #****************************************************************************#
 def draw_slant_bar_sp(x, y, min, max, width = 152, height = 6,
     bar_color = Color.new(100, 0, 255, 255), end_color = Color.new(0, 100, 255, 255))
   # Draw Border
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   # Draw Background
   for i in 1..(height - 1)
     r = 100 * (height - i) / height + 0 * i / height
     g = 100 * (height - i) / height + 0 * i / height
     b = 100 * (height - i) / height + 0 * i / height
     a = 255 * (height - i) / height + 255 * i / height
     self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
   end
   # Draws Bar
   for i in 1..( (min / max.to_f) * width - 1)
     for j in 1..(height - 1)
       r = bar_color.red * (width - i) / width + end_color.red * i / width
       g = bar_color.green * (width - i) / width + end_color.green * i / width
       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
       self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
     end
   end
 end

 def draw_slant_bar(x, y, min, max, width = 152, height = 6,
     bar_color = Color.new(100, 255, 0, 255), end_color = Color.new(200, 255, 0, 255))
   # Draw Border
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   # Draw Background
   for i in 1..(height - 1)
     r = 100 * (height - i) / height + 0 * i / height
     g = 100 * (height - i) / height + 0 * i / height
     b = 100 * (height - i) / height + 0 * i / height
     a = 255 * (height - i) / height + 255 * i / height
     self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
   end
   # Draws Bar
   for i in 1..( (min / max.to_f) * width - 1)
     for j in 1..(height - 1)
       r = bar_color.red * (width - i) / width + end_color.red * i / width
       g = bar_color.green * (width - i) / width + end_color.green * i / width
       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
       self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
     end
   end
 end
end


class Window_EnemyHP < Window_Base
 
 def initialize
   super(0, 0, 640, 480)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   refresh
 end
 
 def refresh
   self.contents.clear
   for i in 0...$game_troop.enemies.size
     @enemy = $game_troop.enemies[i]
     @percent = (@enemy.hp)
     @percent2 = (@enemy.sp)
     unless @enemy.sp == 0
       self.contents.font.size = 16
     self.contents.font.color = text_color(2)
     draw_slant_bar_sp(@enemy.screen_x - 75, @enemy.screen_y + 10, @enemy.sp, @enemy.maxsp, width = 100, height = 5, bar_color = Color.new(100, 0, 255, 155), end_color = Color.new(0, 100, 255, 155))
#      self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 2, 100, 32, "#{@percent2}" + " SP")
     self.contents.font.color = text_color(2)
     draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))
     
     
#      self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 22, 100, 32, "#{@percent}" + " HP")
   end
 end
end
end

class Scene_Battle
 
 alias raz_update update
 alias raz_update_phase5 update_phase5
 alias raz_update_phase4_step1 update_phase4_step1
 alias raz_update_phase4_step5 update_phase4_step5
 alias raz_enemy_hp_main main
 
  def main
   @troop_id = $game_temp.battle_troop_id
   $game_troop.setup(@troop_id)
   @enemy_window = Window_EnemyHP.new
   @enemy_window.z = 95
   raz_enemy_hp_main
   @enemy_window.dispose
 end
 
 def update
   @enemy_window.update
   raz_update
 end

 def update_phase5
   # If wait count is larger than 0
   if @phase5_wait_count > 0
     # Decrease wait count
     @phase5_wait_count -= 1
     # If wait count reaches 0
     if @phase5_wait_count == 0
       @enemy_window.visible = false
       # Show result window
       @result_window.visible = true
       # Clear main phase flag
       $game_temp.battle_main_phase = false
       # Refresh status window
       @status_window.refresh
       @enemy_window.refresh
     end
     return
   end
  raz_update_phase5
end

def update_phase4_step1
 raz_update_phase4_step1
 @enemy_window.refresh
end

 def update_phase4_step5
   # Hide help window
   @help_window.visible = false
   # Refresh status window
   @status_window.refresh
   @enemy_window.refresh
   raz_update_phase4_step5
 end
end
[/SPOILER]

Y aqui, gracias a sayonarap por modificarlo, es un conjuro de libra:

[SPOILER]
CODE
SCANNED_STATUS_ID = 48

class Window_Base < Window  
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
#**************************************************************************
#
# Implementado y mejorado (Implemented) by                                   #
#                                                   DarkLight                #
#**************************************************************************
#
def draw_slant_bar_sp(x, y, min, max, width = 152, height = 6,
   bar_color = Color.new(100, 0, 255, 255), end_color = Color.new(0, 100, 255, 255))
 # Draw Border
 for i in 0..height
   self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
 end
 # Draw Background
 for i in 1..(height - 1)
   r = 100 * (height - i) / height + 0 * i / height
   g = 100 * (height - i) / height + 0 * i / height
   b = 100 * (height - i) / height + 0 * i / height
   a = 255 * (height - i) / height + 255 * i / height
   self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
 end
 # Draws Bar
 for i in 1..( (min / max.to_f) * width - 1)
   for j in 1..(height - 1)
     r = bar_color.red * (width - i) / width + end_color.red * i / width
     g = bar_color.green * (width - i) / width + end_color.green * i / width
     b = bar_color.blue * (width - i) / width + end_color.blue * i / width
     a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
     self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
   end
 end
end

def draw_slant_bar(x, y, min, max, width = 152, height = 6,
   bar_color = Color.new(100, 255, 0, 255), end_color = Color.new(200, 255, 0, 255))
 # Draw Border
 for i in 0..height
   self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
 end
 # Draw Background
 for i in 1..(height - 1)
   r = 100 * (height - i) / height + 0 * i / height
   g = 100 * (height - i) / height + 0 * i / height
   b = 100 * (height - i) / height + 0 * i / height
   a = 255 * (height - i) / height + 255 * i / height
   self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
 end
 # Draws Bar
 for i in 1..( (min / max.to_f) * width - 1)
   for j in 1..(height - 1)
     r = bar_color.red * (width - i) / width + end_color.red * i / width
     g = bar_color.green * (width - i) / width + end_color.green * i / width
     b = bar_color.blue * (width - i) / width + end_color.blue * i / width
     a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
     self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
   end
 end
end
end


class Window_EnemyHP < Window_Base

def initialize
 super(0, 0, 640, 480)
 self.contents = Bitmap.new(width - 32, height - 32)
 self.opacity = 0
 refresh
end

def refresh
 self.contents.clear
 for i in 0...$game_troop.enemies.size
   @enemy = $game_troop.enemies[i]
   if @enemy.states.include?(SCANNED_STATUS_ID)
     @percent = (@enemy.hp)
     @percent2 = (@enemy.sp)
     unless @enemy.sp == 0
       self.contents.font.size = 16
     self.contents.font.color = text_color(2)
     draw_slant_bar_sp(@enemy.screen_x - 75, @enemy.screen_y + 10, @enemy.sp, @enemy.maxsp, width = 100, height = 5, bar_color = Color.new(100, 0, 255, 155), end_color = Color.new(0, 100, 255, 155))
     self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 2, 100, 32, "#{@percent2}" + " SP")
     self.contents.font.color = text_color(2)
     draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))
     self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 22, 100, 32, "#{@percent}" + " HP")
   end
 end
end
end
end

class Scene_Battle

alias raz_update update
alias raz_update_phase5 update_phase5
alias raz_update_phase4_step1 update_phase4_step1
alias raz_update_phase4_step5 update_phase4_step5
alias raz_enemy_hp_main main

def main
 @troop_id = $game_temp.battle_troop_id
 $game_troop.setup(@troop_id)
 @enemy_window = Window_EnemyHP.new
 @enemy_window.z = 95
 raz_enemy_hp_main
 @enemy_window.dispose
end

def update
 @enemy_window.update
 raz_update
end

def update_phase5
 # If wait count is larger than 0
 if @phase5_wait_count > 0
   # Decrease wait count
   @phase5_wait_count -= 1
   # If wait count reaches 0
   if @phase5_wait_count == 0
     @enemy_window.visible = false
     # Show result window
     #@result_window.visible = true
     # Clear main phase flag
     $game_temp.battle_main_phase = false
     # Refresh status window
     @status_window.refresh
     @enemy_window.refresh
   end
   return
 end
raz_update_phase5
end

def update_phase4_step1
raz_update_phase4_step1
@enemy_window.refresh
end

def update_phase4_step5
 # Hide help window
 @help_window.visible = false
 # Refresh status window
 @status_window.refresh
 @enemy_window.refresh
 raz_update_phase4_step5
end
end
[/SPOILER]

en donde pone:

SCANNED_STATUS_ID = 48

es el numero de estado alterado, cambienlo por el que vayanb a usar, y a la habiliad libra que vayan a usar, le colocan ese estado. Edited by DrAgoN
0

Share this post


Link to post
Share on other sites
mmm esta bueno pero no se podria hacer una habilidad que haga que active el script? asi queda mas major laugh.gif
0

Share this post


Link to post
Share on other sites
pues si que se podria, de hecho no seria muy dificil xD, seria hacer que la habilidad llamara a un evento comun que llama al script para que se activara durante 20 o 40 frames, o el tiempo necesario, nose.
P.D:
Que numero mas raro de mensajes xDDDDD 333! xDDDDD Edited by DrAgoN
0

Share this post


Link to post
Share on other sites
Creo que las barras quedan mejor encima de los enemigos que debajo. No se, como sugerencia, digo. icon13.gif
0

Share this post


Link to post
Share on other sites
pues eso no es problema, se cambia aqui:

CODE
draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))


donde pone @enemy.screen_y - 10 lo cambiais a -80 o asi, eso si, creo que habria una forma de editarlo dependiendo del tamaño en px de la imagen del monstruo, seguramente hare un cms o algo, o alguna cosa mas sencilla.
0

Share this post


Link to post
Share on other sites
Yo voy a ponerlo en mi proyecto con este pequeño cambio: sólo se mostrará si el enemigo está en un determinado estado alterado. De este modo podréis hacer enemigos inmunes a ese estado alterado y que no se pueda ver su vida (por ejemplo jefes finales)

No sé cómo lo véis. Si os interesa, cuando lo tenga hecho lo posteo happy.gif




saludos del paranoyas
0

Share this post


Link to post
Share on other sites
es una genial idea la de sayonarap, sería genial que lo posteases cuando lo hicieses, así daría la sensación de ser un conjuro como Libra
0

Share this post


Link to post
Share on other sites
Veamos, está hecho. Creo que os funcionará bien, porque lo probé en mi proyecto y va de lujo.
Aquí la pequeña modificación:

[SPOILER]
CODE
SCANNED_STATUS_ID = 48

class Window_Base < Window  
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
#**************************************************************************
#
# Implementado y mejorado (Implemented) by                                   #
#                                                   DarkLight                #
#**************************************************************************
#
def draw_slant_bar_sp(x, y, min, max, width = 152, height = 6,
    bar_color = Color.new(100, 0, 255, 255), end_color = Color.new(0, 100, 255, 255))
  # Draw Border
  for i in 0..height
    self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
  end
  # Draw Background
  for i in 1..(height - 1)
    r = 100 * (height - i) / height + 0 * i / height
    g = 100 * (height - i) / height + 0 * i / height
    b = 100 * (height - i) / height + 0 * i / height
    a = 255 * (height - i) / height + 255 * i / height
    self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
  end
  # Draws Bar
  for i in 1..( (min / max.to_f) * width - 1)
    for j in 1..(height - 1)
      r = bar_color.red * (width - i) / width + end_color.red * i / width
      g = bar_color.green * (width - i) / width + end_color.green * i / width
      b = bar_color.blue * (width - i) / width + end_color.blue * i / width
      a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
      self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
    end
  end
end

def draw_slant_bar(x, y, min, max, width = 152, height = 6,
    bar_color = Color.new(100, 255, 0, 255), end_color = Color.new(200, 255, 0, 255))
  # Draw Border
  for i in 0..height
    self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
  end
  # Draw Background
  for i in 1..(height - 1)
    r = 100 * (height - i) / height + 0 * i / height
    g = 100 * (height - i) / height + 0 * i / height
    b = 100 * (height - i) / height + 0 * i / height
    a = 255 * (height - i) / height + 255 * i / height
    self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
  end
  # Draws Bar
  for i in 1..( (min / max.to_f) * width - 1)
    for j in 1..(height - 1)
      r = bar_color.red * (width - i) / width + end_color.red * i / width
      g = bar_color.green * (width - i) / width + end_color.green * i / width
      b = bar_color.blue * (width - i) / width + end_color.blue * i / width
      a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
      self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
    end
  end
end
end


class Window_EnemyHP < Window_Base

def initialize
  super(0, 0, 640, 480)
  self.contents = Bitmap.new(width - 32, height - 32)
  self.opacity = 0
  refresh
end

def refresh
  self.contents.clear
  for i in 0...$game_troop.enemies.size
    @enemy = $game_troop.enemies[i]
    if @enemy.states.include?(SCANNED_STATUS_ID)
      @percent = (@enemy.hp)
      @percent2 = (@enemy.sp)
      unless @enemy.sp == 0
        self.contents.font.size = 16
      self.contents.font.color = text_color(2)
      draw_slant_bar_sp(@enemy.screen_x - 75, @enemy.screen_y + 10, @enemy.sp, @enemy.maxsp, width = 100, height = 5, bar_color = Color.new(100, 0, 255, 155), end_color = Color.new(0, 100, 255, 155))
      self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 2, 100, 32, "#{@percent2}" + " SP")
      self.contents.font.color = text_color(2)
      draw_slant_bar(@enemy.screen_x - 75, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 100, height = 5, bar_color = Color.new(100, 255, 0, 155), end_color = Color.new(200, 255, 60, 155))
      self.contents.draw_text(@enemy.screen_x - 59, @enemy.screen_y - 22, 100, 32, "#{@percent}" + " HP")
    end
  end
end
end
end

class Scene_Battle

alias raz_update update
alias raz_update_phase5 update_phase5
alias raz_update_phase4_step1 update_phase4_step1
alias raz_update_phase4_step5 update_phase4_step5
alias raz_enemy_hp_main main

 def main
  @troop_id = $game_temp.battle_troop_id
  $game_troop.setup(@troop_id)
  @enemy_window = Window_EnemyHP.new
  @enemy_window.z = 95
  raz_enemy_hp_main
  @enemy_window.dispose
end

def update
  @enemy_window.update
  raz_update
end

def update_phase5
  # If wait count is larger than 0
  if @phase5_wait_count > 0
    # Decrease wait count
    @phase5_wait_count -= 1
    # If wait count reaches 0
    if @phase5_wait_count == 0
      @enemy_window.visible = false
      # Show result window
      #@result_window.visible = true
      # Clear main phase flag
      $game_temp.battle_main_phase = false
      # Refresh status window
      @status_window.refresh
      @enemy_window.refresh
    end
    return
  end
 raz_update_phase5
end

def update_phase4_step1
raz_update_phase4_step1
@enemy_window.refresh
end

def update_phase4_step5
  # Hide help window
  @help_window.visible = false
  # Refresh status window
  @status_window.refresh
  @enemy_window.refresh
  raz_update_phase4_step5
end
end
[/SPOILER]

Bien, en la primera línea podréis apreciar esto:
CODE
SCANNED_STATUS_ID = 48


Cambiad el 48 por la ID del estado alterado que usaréis para esta habilidad. Luego hacéis una habilidad que provoque dicho estado alterado y ya lo tenéis. Probad por si os da algún error.



saludos del paranoyas
0

Share this post


Link to post
Share on other sites
wow, que buena idea sayonarap, tranks, asi seria un conjuro de libra, esto al final lo pondré en mi cbs tongue.gif, lo de libra xD.
0

Share this post


Link to post
Share on other sites
DrAgoN, si lo crees conveniente, añádelo a tu primer post como otra variante que poder elegir. ¿Te parece?



saludos del paranoyas
0

Share this post


Link to post
Share on other sites
corriendo!
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0