¡Bienvenid@ a Mundo Maker!

¿Quieres aprender todo sobre el RPG Maker?



Regístrate y forma parte de Mundo Maker.
Conectarse

Recuperar mi contraseña

Temas importantes
----------------------------------------
Páginas con recursos RPG Maker
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
Afiliados
Estadísticas
Tenemos 3396 miembros registrados.
El último usuario registrado es Discorded.

Nuestros miembros han publicado un total de 79807 mensajes en 11256 argumentos.
Navega con Google Chrome
[DESCARGA]

[RPG XP] Menu Battlers

 :: RPG Maker :: Scripts

Ver el tema anterior Ver el tema siguiente Ir abajo

[RPG XP] Menu Battlers

Mensaje por Khaizen el 2010-03-19, 16:20

Bueno, este script rediseña el menu mostrando los battlers de los personajes. Si combináis un buen skin con unos buenos battlers, quedará genial.

Autor: TN-69 (Slipknot y Sayonarap ayudaron con algunos comandos. Se han utilizado el Addon de barras by Clive based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.)
Plataforma: RPG Maker XP

SCRIPT

Código:

#=============================================================================
# Script creado por TN-69, versión 2.0 (16/12/2007)
# Slipknot & Sayonarap ayudaron con algunos comandos
# Si hay problemas con las Fonts, eliminar la ultima parte del script
# Si sigue dando problemas de Font, añadir en tu clase Fonts o en Main esta linea: $fontface = "Arial"
# Utilizado el Addon de barras by Clive based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.
#---------------------------------------------------------------------
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Object Initialization
#        x        : window x-coordinate
#        y        : window y-coordinate
#        width  : window width
#        height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
 super()
 @windowskin_name = $game_system.windowskin_name
 self.windowskin = RPG::Cache.windowskin(@windowskin_name)
 self.x = x
 self.y = y
 self.width = width
 self.height = height
 self.z = 100
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
 if self.contents != nil
  self.contents.dispose
 end
 super
end
#--------------------------------------------------------------------------
# * Get Text Color
#        n : text color number (0-7)
#--------------------------------------------------------------------------
def c(n)
 case n
 when 0
  return Color.new(255, 255, 255, 255)
 when 1
  return Color.new(128, 128, 255, 255)
 when 2
  return Color.new(255, 128, 128, 255)
 when 3
  return Color.new(128, 255, 128, 255)
 when 4
  return Color.new(128, 255, 255, 255)
 when 5
  return Color.new(255, 128, 255, 255)
 when 6
  return Color.new(255, 255, 128, 255)
 when 7
  return Color.new(192, 192, 192, 255)
 else
  normal_color
 end
end
#--------------------------------------------------------------------------
# * Get Normal Text Color
#--------------------------------------------------------------------------
def normal_color
 return Color.new(255, 255, 255, 255)
end
#--------------------------------------------------------------------------
# * Get Disabled Text Color
#--------------------------------------------------------------------------
def disabled_color
 return Color.new(255, 255, 255, 128)
end
#--------------------------------------------------------------------------
# * Get System Text Color
#--------------------------------------------------------------------------
def system_color
 return Color.new(192, 224, 255, 255)
end
#--------------------------------------------------------------------------
# * Get Crisis Text Color
#--------------------------------------------------------------------------
def crisis_color
 return Color.new(255, 255, 64, 255)
end
#--------------------------------------------------------------------------
# * Get Knockout Text Color
#--------------------------------------------------------------------------
def knockout_color
 return Color.new(255, 64, 0)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
 super
 if $game_system.windowskin_name != @windowskin_name
  @windowskin_name = $game_system.windowskin_name
  self.windowskin = RPG::Cache.windowskin(@windowskin_name)
 end
end
#--------------------------------------------------------------------------
# * Draw Graphic
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_graphic(actor, x, y)
 bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
 cw = bitmap.width / 4
 ch = bitmap.height / 4
 src_rect = Rect.new(0, 0, cw, ch)
 self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#--------------------------------------------------------------------------
# * Draw Battler
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_battler(actor, x, y)
 bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
 cw = bitmap.width / 1
 ch = bitmap.height / 1
 src_rect = Rect.new(0, 0, cw, ch)
 self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#--------------------------------------------------------------------------
# * Draw Name
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
 self.contents.font.color = normal_color
 self.contents.draw_text(x, y, 120, 32, actor.name)
end
#--------------------------------------------------------------------------
# * Draw Class
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y)
 self.contents.font.color = normal_color
 self.contents.draw_text(x, y, 236, 32, actor.class_name)
end
#--------------------------------------------------------------------------
# * Draw Level
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
 self.contents.font.color = system_color
 self.contents.draw_text(x, y, 32, 32, "Lv")
 self.contents.font.color = c(0)
 self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
#--------------------------------------------------------------------------
# * Make State Text String for Drawing
#        actor    : actor
#        width    : draw spot width
#        need_normal : Whether or not [normal] is needed (true / false)
#--------------------------------------------------------------------------
def make_battler_state_text(battler, width, need_normal)
 # Get width of brackets
 brackets_width = self.contents.text_size("[]").width
 # Make text string for state names
 text = ""
 for i in battler.states
  if $data_states[i].rating >= 1
        if text == ""
          text = $data_states[i].name
        else
          new_text = text + "/" + $data_states[i].name
          text_width = self.contents.text_size(new_text).width
          if text_width > width - brackets_width
                break
          end
          text = new_text
        end
  end
 end
 # If text string for state names is empty, make it [normal]
 if text == ""
  if need_normal
        text = "[Normal]"
  end
 else
  # Attach brackets
  text = "[" + text + "]"
 end
 # Return completed text string
 return text
end
#--------------------------------------------------------------------------
# * Draw State
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#        width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
 text = make_battler_state_text(actor, width, true)
 self.contents.font.color = actor.hp == 0 ? knockout_color : c(0)
 self.contents.draw_text(x, y, width, 32, text)
end
#--------------------------------------------------------------------------
# * Draw EXP
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y)
 self.contents.font.color = system_color
 self.contents.draw_text(x, y, 24, 32, "Exp")
 self.contents.font.color = c(1)
 self.contents.draw_text(x - 40, y, 84, 32, actor.exp_s, 2)
 self.contents.draw_text(x + 42, y, 12, 32, "/", 1)
 self.contents.draw_text(x + 52, y, 84, 32, actor.next_exp_s)
end
#--------------------------------------------------------------------------
# * Draw HP
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#        width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
 # Draw "HP" text string
 self.contents.font.color = system_color
 self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
 # Calculate if there is draw space for MaxHP
 if width - 32 >= 108
  hp_x = x + width - 108
  flag = true
 elsif width - 32 >= 48
  hp_x = x + width - 48
  flag = false
 end
 # Draw HP
 self.contents.font.color = actor.hp == 0 ? c(2) :
  actor.hp <= actor.maxhp / 2 ? c(6) : c(0)
 self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
 # Draw MaxHP
 if flag
  self.contents.font.color = c(0)
  self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
 end
end
#--------------------------------------------------------------------------
# * Draw SP
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#        width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
 # Draw "SP" text string
 self.contents.font.color = system_color
 self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
 # Calculate if there is draw space for MaxHP
 if width - 32 >= 108
  sp_x = x + width - 108
  flag = true
 elsif width - 32 >= 48
  sp_x = x + width - 48
  flag = false
 end
 # Draw SP
 self.contents.font.color = actor.sp == 0 ? c(2) :
  actor.sp <= actor.maxsp / 2 ? c(6) : c(0)
 self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
 # Draw MaxSP
 if flag
  self.contents.font.color = c(0)
  self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
 end
end
#--------------------------------------------------------------------------
# * Draw Parameter
#        actor : actor
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#        type  : parameter type (0-6)
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
 case type
 when 0
  parameter_name = $data_system.words.atk
  parameter_value = actor.atk
 when 1
  parameter_name = $data_system.words.pdef
  parameter_value = actor.pdef
 when 2
  parameter_name = $data_system.words.mdef
  parameter_value = actor.mdef
 when 3
  parameter_name = $data_system.words.str
  parameter_value = actor.str
 when 4
  parameter_name = $data_system.words.dex
  parameter_value = actor.dex
 when 5
  parameter_name = $data_system.words.agi
  parameter_value = actor.agi
 when 6
  parameter_name = $data_system.words.int
  parameter_value = actor.int
 end
 self.contents.font.color = system_color
 self.contents.draw_text(x, y, 120, 32, parameter_name)
 self.contents.font.color = normal_color
 self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
#--------------------------------------------------------------------------
# * Draw Item Name
#        item : item
#        x      : draw spot x-coordinate
#        y      : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_item_name(item, x, y)
 if item == nil
  return
 end
 bitmap = RPG::Cache.icon(item.icon_name)
 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
 self.contents.font.color = normal_color
 self.contents.draw_text(x + 28, y, 212, 32, item.name)
end
end

#--------------------------------------------------------------------------
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================

class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
 super(0, 0, 220, 64)
 self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = $fontface
 self.contents.font.size = 25
 refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 cx = contents.text_size($data_system.words.gold).width
 self.contents.font.color = normal_color
 self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
 self.contents.font.color = system_color
 self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
#  This window displays step count on the menu screen.
#==============================================================================

class Window_Steps < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
 super(0, 0, 200, 64)
 self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = $fontface
 self.contents.font.size = 25
 refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 self.contents.font.color = system_color
 self.contents.draw_text(4, 0, 120, 32, "Pasos")
 self.contents.font.color = normal_color
 self.contents.draw_text(4, 0, 120, 40, $game_party.steps.to_s, 2)
end
end
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
 super(0, 0, 220, 64)
 self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = $fontface
 self.contents.font.size = 25
 refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 self.contents.font.color = system_color
 self.contents.draw_text(4, 0, 120, 32, "Tiempo")
 @total_sec = Graphics.frame_count / Graphics.frame_rate
 hour = @total_sec / 60 / 60
 min = @total_sec / 60 % 60
 sec = @total_sec % 60
 text = sprintf("%02d:%02d:%02d", hour, min, sec)
 self.contents.font.color = normal_color
 self.contents.draw_text(55, 0, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
 super
 if Graphics.frame_count / Graphics.frame_rate != @total_sec
  refresh
 end
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
 super(0, 0, 640, 420)
 self.contents = Bitmap.new(width - 32, height - 32)
 refresh
 self.active = false
 self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 @column_max = 4
 @item_max = $game_party.actors.size
 for i in 0...$game_party.actors.size
  x = i * 158
  y = 116
  actor = $game_party.actors[i]
  draw_actor_battler(actor, x + 40, y + 100)
  draw_actor_name(actor, x, y + 100)
  draw_actor_class(actor, x , y + 120)
  draw_actor_level(actor, x, y + 175)
  draw_actor_state(actor, x, y + 270)
  draw_actor_exp(actor, x, y + 150)
  draw_actor_hp(actor, x, y + 202)
  draw_actor_sp(actor, x, y + 234)
 end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
 if @index < 0
  self.cursor_rect.empty
 else
  self.cursor_rect.set(@index * 150, 0, self.height - 260, 390)
 end
end
end
#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================
#-----------------------------------------------------------------
class Game_Map
def name
$map_infos[@map_id]
end
end

class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end

class Window_Location < Window_Base
def initialize
  super(0, 0, 220, 64)
  self.contents = Bitmap.new(width - 32, height - 32)
          self.contents.font.name = $fontface
  self.contents.font.size = 20
  refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 self.contents.font.color = system_color
 self.contents.draw_text(4, -6, 120, 32, "Lugar")
 self.contents.font.color = normal_color
 self.contents.draw_text(4, 9, 120, 30, $game_map.name, 2)
end
end
#==============================================================================
# ** CMS_Load
#==============================================================================

class CMS_Load < Scene_File
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  $game_temp = Game_Temp.new
  $game_temp.last_file_index = 0
  latest_time = Time.at(0)
  for i in 0..3
        filename = make_filename(i)
        if FileTest.exist?(filename)
          file = File.open(filename, "r")
          if file.mtime > latest_time
                latest_time = file.mtime
                $game_temp.last_file_index = i
          end
          file.close
        end
  end
  super("Selecciona la partida a cargar")
 end
 #--------------------------------------------------------------------------
 # * Decision Processing
 #--------------------------------------------------------------------------
 def on_decision(filename)
  unless FileTest.exist?(filename)
        $game_system.se_play($data_system.buzzer_se)
        return
  end
  $game_system.se_play($data_system.load_se)
  file = File.open(filename, "rb")
  read_save_data(file)
  file.close
  $game_system.bgm_play($game_system.playing_bgm)
  $game_system.bgs_play($game_system.playing_bgs)
  $game_map.update
  $scene = Scene_Map.new
 end
 #--------------------------------------------------------------------------
 # * Cancel Processing
 #--------------------------------------------------------------------------
 def on_cancel
  $game_system.se_play($data_system.cancel_se)
  $scene = Scene_Menu.new
 end
 #--------------------------------------------------------------------------
 # * Read Save Data
 #      file : file object for reading (opened)
 #--------------------------------------------------------------------------
 def read_save_data(file)
  characters = Marshal.load(file)
  Graphics.frame_count = Marshal.load(file)
  $game_system        = Marshal.load(file)
  $game_switches        = Marshal.load(file)
  $game_variables      = Marshal.load(file)
  $game_self_switches = Marshal.load(file)
  $game_screen        = Marshal.load(file)
  $game_actors        = Marshal.load(file)
  $game_party          = Marshal.load(file)
  $game_troop          = Marshal.load(file)
  $game_map              = Marshal.load(file)
  $game_player        = Marshal.load(file)
  if $game_system.magic_number != $data_system.magic_number
        $game_map.setup($game_map.map_id)
        $game_player.center($game_player.x, $game_player.y)
  end
  $game_party.refresh
 end
end
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------

class Scene_Menu
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
  @menu_index = menu_index
end
#--------------------------------------------------------------------------
def main
  # コマンドウィンドウを作成
  s1 = $data_system.words.item
  s2 = $data_system.words.skill
  s3 = $data_system.words.equip
  s4 = "Cargar"
  s5 = "Guardar"
  s6 = "Salir"
  @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  @command_window.index = @menu_index
  @command_window.opacity = 80
  @command_window.z = 200
  @command_window.x = 2
  @command_window.y = 2
  @command_window.height = 65
  @command_window.width = 160
  if $game_party.actors.size == 0
        @command_window.disable_item(0)
        @command_window.disable_item(1)
        @command_window.disable_item(2)
        @command_window.disable_item(3)
  end
  if $game_system.save_disabled
        @command_window.disable_item(4)
  end
  @location_window = Window_Location.new
  @location_window.z = 200
  @location_window.x = 420
  @location_window.y = 2
  @location_window.opacity = 140
  @playtime_window = Window_PlayTime.new
  @playtime_window.x = 420
  @playtime_window.y = 416
  @steps_window = Window_Steps.new
  @steps_window.x = 220
  @steps_window.y = 416
  @gold_window = Window_Gold.new
  @gold_window.x = 0
  @gold_window.y = 416
  @status_window = Window_MenuStatus.new
  @status_window.x = 0
  @status_window.y = 0
  @status_window.opacity = 130
  Graphics.transition
  loop do
        Graphics.update
        Input.update
        update
        if $scene != self
          break
        end
  end
  Graphics.freeze
  @command_window.dispose
  @playtime_window.dispose
  @steps_window.dispose
  @gold_window.dispose
  @status_window.dispose
  @location_window.dispose
end
#--------------------------------------------------------------------------
def update
  @command_window.update
  @playtime_window.update
  @steps_window.update
  @gold_window.update
  @status_window.update
  @location_window.update
  if @command_window.active
        update_command
        return
  end
  if @status_window.active
        update_status
        return
  end
end
#--------------------------------------------------------------------------
def update_command
  if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
        return
  end
  if Input.trigger?(Input::C)
        if $game_party.actors.size == 0 and @command_window.index < 4
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        case @command_window.index
        when 0 
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Item.new
        when 1 
          $game_system.se_play($data_system.decision_se)
          @command_window.active = false
          @status_window.active = true
          @status_window.index = 0
        when 2 
          $game_system.se_play($data_system.decision_se)
          @command_window.active = false
          @status_window.active = true
          @status_window.index = 0
        when 3
                  if $game_system.save_disabled
                $game_system.se_play($data_system.buzzer_se)
                return
          end
          $game_system.se_play($data_system.decision_se)
          $scene = CMS_Load.new
        when 4 
          if $game_system.save_disabled
                $game_system.se_play($data_system.buzzer_se)
                return
          end
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Save.new
        when 5
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_End.new
        end
        return
  end
end
#--------------------------------------------------------------------------
  def update_location
  if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
        return
  end
#--------------------------------------------------------------------------
def update_status
  if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        @command_window.active = true
        @status_window.active = false
        @status_window.index = -1
        return
  end
  if Input.trigger?(Input::C)
        case @command_window.index
        when 1 
          if $game_party.actors[@status_window.index].restriction >= 2
                $game_system.se_play($data_system.buzzer_se)
                return
          end
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Skill.new(@status_window.index)
        when 2 
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Equip.new(@status_window.index)
        when 3
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Status.new(@status_window.index)
        end
        return
  end
 end
end
end
#===========================================================================
# *** HP/MP/ATB/LimitBreak bar Slanted Style Compatible with RTAB ***
# *** Version 2.1
#---------------------------------------------------------------------------
# by Clive
# based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.
#---------------------------------------------------------------------------
# ----- GREAT THANKS to DerVVulfman for solving the lag problem
#------This is a plug and play script so it should work without any problem!
#=============================================================================
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
        return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
        return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================
class Window_Base < Window 
  #==========================================================================
  # * Draw Slant Bar(by SephirothSpawn)
  #==========================================================================
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
          bar_color = Color.new(150, 0, 0, 255),
          end_color = Color.new(255, 255, 60, 255))
        for i in 0..height
          self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
        end
        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
        for i in 1..( (min.to_f / 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
 
  #==========================================================================
  # * Draw HP
  #      actor : actor
  #      x      : draw spot x-coordinate
  #      y      : draw spot y-coordinate
  #      width : draw spot width
  #==========================================================================
  alias :draw_actor_hp_hpsp :draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144) 
        draw_slant_bar(x, y + 25, actor.hp, actor.maxhp, width, 6,
          bar_color = Color.new(150, 0,0, 255),
          end_color = Color.new(255, 255, 60, 255))
        draw_actor_hp_hpsp(actor, x, y, width)
  end
  #==========================================================================
  # * Draw SP
  #      actor : actor
  #      x      : draw spot x-coordinate
  #      y      : draw spot y-coordinate
  #      width : draw spot width
  #==========================================================================
  alias :draw_actor_sp_hpsp :draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
        draw_slant_bar(x, y + 25, actor.sp, actor.maxsp, width, 6,
          bar_color = Color.new(0, 0, 155, 255),
          end_color = Color.new(255, 255, 255, 255))
        draw_actor_sp_hpsp(actor, x, y, width)
  end
  #==========================================================================
  # * Draw EXP
  #      actor : actor
  #      x      : draw spot x-coordinate
  #      y      : draw spot y-coordinate
  #==========================================================================
  alias raz_bars_base_exp draw_actor_exp 
  def draw_actor_exp(actor, x, y)
        if actor.level == 99
          draw_slant_bar(x, y + 25, 1, 1, 130, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
        else
          draw_slant_bar(x, y + 25, actor.now_exp, actor.next_exp, 130, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(255, 255, 255, 255))
        end
        raz_bars_base_exp(actor, x, y)
  end
  #==========================================================================
  # * Draw Parameter
  #      actor : actor
  #      x      : draw spot x-coordinate
  #      y      : draw spot y-coordinate
  #      type  : parameter type (0-6)
  #==========================================================================
  alias raz_bars_base_parameter draw_actor_parameter 
  def draw_actor_parameter(actor, x, y, type)
        case type
        when 0
          para_color1 = Color.new(100,0,0)
          para_color2 = Color.new(255,0,0)
          para_begin = actor.atk
        when 1
          para_color1 = Color.new(100,100,0)
          para_color2 = Color.new(255,255,0)
          para_begin = actor.pdef
        when 2
          para_color1 = Color.new(100,0,100)
          para_color2 = Color.new(255,0,255)
          para_begin = actor.mdef
        when 3
          para_color1 = Color.new(50,0,100)
          para_color2 = Color.new(50,0,255)
          para_begin = actor.str
        when 4
          para_color1 = Color.new(0,100,0)
          para_color2 = Color.new(0,255,0)
          para_begin = actor.dex
        when 5
          para_color1 = Color.new(50,0,50)
          para_color2 = Color.new(255,0,255)
          para_begin = actor.agi
        when 6
          para_color1 = Color.new(0,100,100)
          para_color2 = Color.new(0,255,255)
          para_begin = actor.int
        end
        draw_slant_bar(x, y + 25, para_begin, 999, 155, 4, bar_color = para_color1,
          end_color = para_color2)
        raz_bars_base_parameter(actor, x, y, type)
  end
  #=========================================================================
  # * Draw Actor ATG
  #      actor : Actor
  #      x      : draw spot x-coordinate
  #      y      : draw spot y-coordinate
  #      width : draw spot width
  #=========================================================================
  def draw_actor_atg(actor, x, y, width = 144, height = 6)
        if @at_gauge == nil
          @plus_x = 0
          @rate_x = 0
          @plus_y = 16
          @plus_width = 0
          @rate_width = 100
          @width = @plus_width + width * @rate_width / 100
          @height = 6
          @align1 = 0
          @align2 = 1
          @align3 = 0
          grade1 = 1
          grade2 = 0
          color1 = Color.new(0, 0, 0)
          color2 = Color.new(255, 255, 192)
          color3 = Color.new(0, 0, 0, 192)
          color4 = Color.new(0, 0, 64, 192)
          color5 = Color.new(0, 64, 80)
          color6 = Color.new(255, 255, 255)#(0, 128, 160)
          color7 = Color.new(80, 0, 0)
          color8 = Color.new(255, 255,255) #(240,0,0)
          color9 = Color.new(80, 64, 32)
          color10 = Color.new(255, 255, 255) #(240, 192, 96)
          color11 = Color.new(80, 0, 64)
          color12 = Color.new(255,255, 255) #(240, 0, 192)
          gauge_rect_at(@width, @height, @align3, color1, color2, color3, color4,
                  color5, color6, color7, color8, color9, color10, color11, color12,
                  grade1, grade2)
        end
        if actor.rtp == 0
          at = (width + @plus_width) * actor.atp * @rate_width / 10000
        else
          at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
        end
        if at > width
          at = width
        end
        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
        for i in 0..height
          self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 2 , 3,
                Color.new(50, 50, 50, 255))
        end
        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 + 1.5 + i, y + 12 + height - i, width - 3, 3,
                Color.new(r, b, g, a))
        end
        if @align3 == 0
          rect_x = 0
        else
          x += @width - at - 1
          rect_x = @width - at - 1
        end
        if at == width
          for i in 0..height
                self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y -i +
                @plus_y, @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
          end
        else
          if actor.rtp == 0
                for i in 0..height
                  self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y- i +
                        @plus_y, @at_gauge,Rect.new(rect_x, @height, at, @height))
                end
          else
                if actor.spell == true
                  for i in 0..height
                        self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
                          @plus_y, @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
                  end
                else
                  for i in 0..height                     
                        self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
                          @plus_y, @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
                  end
                end
          end
        end
  end
  end
#------------------------------------------------------------------------------
# CMS Font
#------------------------------------------------------------------------------
class Font
  alias font_fix_initialize initialize
  def initialize
        font_fix_initialize
        $fontface = "Arial"
        self.name = "Arial" # Nombre de la fuente
        self.size = 25 # Tamaño
  end
end

INSTRUCCIONES

Simplemente pegarlo sobre MAIN. Para modificar la fuente, tanto el tipo como el tamaño, id al final del script. En caso de que dé algún error con las fuentes, leed el comienzo del script, ahí os dirá lo que tenéis que hacer.

SCREEN

Spoiler:



Saludos, Khaizen

Khaizen
Principiante
Principiante

0/3

Créditos 1460

Gracias : 4

Volver arriba Ir abajo

Re: [RPG XP] Menu Battlers

Mensaje por Arestame el 2010-03-19, 19:12

Aplauso Aplauso una vez más lo haces bien, tio tu eres un crack, porcierto tu no debes ser guionista serías buscador de scripts.

Arestame
Aventurero
Aventurero

0/3

Créditos 1517

Gracias : 36

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


 :: RPG Maker :: Scripts

Permisos de este foro:
No puedes responder a temas en este foro.