Chat game factory

Últimos temas
» Go home axel, you're drunk
por Japo/Zero Miér Sep 04, 2013 6:42 pm

» Regreso de KNIGHT :3
por Japo/Zero Mar Jul 30, 2013 9:52 pm

» [ACE] Unir mapas / Mapa continuo
por Ronal_02 Sáb Jun 08, 2013 3:22 pm

» el señor de los sueños (en desarrollo)
por davidaikago Sáb Mar 16, 2013 1:28 pm

» Top 10: peliculas mas esperadas en este 2013
por lorena-torres0887 Dom Mar 10, 2013 6:35 pm

» El Fin De La Eternidad -DLC Reminiscencia-Resubido por la nuevas politica de mediafire
por the-end-of-eternity Jue Feb 28, 2013 2:19 pm

» Neoland Capitulo C Ver Online sin descarga+Dibujo
por the-end-of-eternity Vie Feb 08, 2013 8:46 am

» bruno marx y las puertas sagradas [historia]
por davidaikago Jue Dic 27, 2012 6:53 am

» [ACE] Dudas
por Mike Jue Dic 13, 2012 4:51 pm

» top chica de acción en un juego
por davidaikago Jue Dic 13, 2012 3:35 pm

» ayuda del foro para mi juego
por monito486 Mar Dic 11, 2012 11:37 am

» [Juego Terminado] - The School's Survivors
por BrijidoTzL Sáb Dic 08, 2012 5:46 pm

» [RPG Maker VX] ¿Cómo modifico la imagen de fondo del menú?
por davidaikago Sáb Dic 08, 2012 12:58 pm

» Sistema de logros y combate [Para RPG Maker VX]
por EXENDERVES Vie Dic 07, 2012 9:10 pm

» Regreso definitivo
por Axel Jue Dic 06, 2012 10:41 pm


Imageshack

Afiliados

Ayuda con un script

Ver el tema anterior Ver el tema siguiente Ir abajo

Ayuda con un script

Mensaje por serch el Jue Jul 21, 2011 6:49 pm

Hola, tengo un serio problema con la posiciones de algunas cosas de mi hud u.u
este es el script
Código:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Custom HUD for Melody
# Author: Yami
# Site: Loctien.net
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#~~~ Initialize ~~~#

module YAMI
  module HUD_MELODY
    #~~ Base HUD ~~#
    HUD_SIZE_X = 422
    HUD_SIZE_Y = 32
    HEIGHT_PER_HUD = 32
   
    #~~ HP/MP/Rage ~~#
    HP_GAUGE_X = 121
    HP_GAUGE_Y = 38 #True HP_GAUGE_Y = HP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    MP_GAUGE_X = 191
    MP_GAUGE_Y = 38 #True MP_GAUGE_Y = MP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    RAGE_GAUGE_X = 25
    RAGE_GAUGE_Y = 45 #True RAGE_GAUGE_Y = RAGE_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    HP_GAUGE_WIDTH = 55
    MP_GAUGE_WIDTH = 55
    RAGE_GAUGE_WIDTH = 72

   
    #~~ HP/MP/RAGE Number ~~#
    USE_IMAGE = true
    USE_IMAGE_RAGE = false
    #IF USE_IMAGE = false
    HP_COLOR = 2
    MP_COLOR = 1
    RAGE_SHOW = "\\C[10]Rage: \\C[0]%d"
   
    #~~ States ~~#
    SHOW_STATES = 5
    SCROLL_STATES = true
    STATES_X = 259
    SCROLL_STATES_DELAY = 26 #This is Frames_Count, which 60 frames ~ 1 second
  end
end

#~~~ End Initialize ~~~#

class Scene_Battle < Scene_Base
  def start_target_actor_selection
    pause_atb(true) if semi_active_atb? or wait_atb?
    if @command_action
      @info_viewport.ox += @status_window.width
      @info_viewport.rect.x += @status_window.width
    end
    create_highlighted_targets($game_party)
    @target_help_window.active = true
    @target_actor_window = Window_BattleStatus.new(false)
    @target_actor_window.index = 0
    @target_actor_window.active = true
    @target_actor_window.y = @info_viewport.rect.y + 12
    @actor_command_window.active = false
    #---

    #---
    if atb_target_actor_case
      obj = @selected_battler.action.skill if @selected_battler.action.skill?
      obj = @selected_battler.action.item if @selected_battler.action.item?
      if atb?
        case @selected_battler.action.atb_queue_kind
        when 1
          obj = $data_skills[@selected_battler.action.atb_queue_basic]
        when 2
          obj = $data_items[@selected_battler.action.atb_queue_basic]
        end
      end
      @target_actor_window.target_highlight = true
      @target_actor_window.highlight_all = true if obj.for_all?
      @target_actor_window.highlight_all = true if obj.for_random?
      @target_actor_window.highlight_user = true if obj.for_user?
      @target_actor_window.frozen_cursor = true if obj.for_user?
      @target_actor_window.index = @selected_battler.index if obj.for_user?
      @target_actor_window.highlight_none = true if obj.for_none?
      @target_actor_window.highlight_dead = true if obj.for_dead_friend?
      @target_actor_window.refresh
    end
    #---
    @target_help_window.refresh(@target_actor_window.actor, @selected_battler)
    hide_object_windows
    update_battle_cursor
    create_aoe_indicator(@target_actor_window)
  end

  def end_target_actor_selection
    @target_help_window.active = false
    @last_target_enemy = nil
    @status_window.draw_item(@selected_battler.index)
    @target_actor_window.dispose
    @target_actor_window = nil
    #---
    #---
    show_object_windows
    if @actor_command_window.item == :attack or @command_action
      @info_viewport.ox -= @status_window.width
      @info_viewport.rect.x -= @status_window.width
      @actor_command_window.active = true
      @command_action = false
    end
    pause_atb(false) if semi_active_atb?
    dispose_aoe_indicator
  end
 
  def hide_object_windows
    @skill_window.visible = false if @skill_window != nil
    @item_window.visible = false if @item_window != nil
  end
 
  def show_object_windows
    @skill_window.visible = true if @skill_window != nil
    @item_window.visible = true if @item_window != nil
  end
 
  def close_input_windows
    @party_command_window.active = false
    @actor_command_window.active = false
    @confirm_command_window.active = false
    @party_command_window.openness = 0
    @actor_command_window.openness = 0
    @confirm_command_window.openness = 0
    loop do
      update_basic
      break if @info_viewport.ox == 128
      if @info_viewport.ox >= 128
        @info_viewport.ox -= [16, (128 - @info_viewport.ox).abs].min
      else
        @info_viewport.ox += [16, (128 - @info_viewport.ox).abs].min
      end
    end
    @status_window.index = @actor_index = -1
  end
 
  def create_info_viewport
    force_preemptive_or_surprise
    #---
    @info_viewport = Viewport.new(0, Graphics.height-160, Graphics.width, 160)
    @info_viewport.z = 100
    #---
    @status_window = Window_BattleStatus.new(true)
    @status_window.viewport = @info_viewport
    @status_window.x = 112
    @status_window.y += 12
    @status_hp_window = Window_BattleStatusHP.new
    @status_hp_window.viewport = @info_viewport
    @status_hp_window.x = 112
    @status_hp_window.y += 12   
    @status_mp_window = Window_BattleStatusMP.new
    @status_mp_window.viewport = @info_viewport
    @status_mp_window.x = 112
    @status_mp_window.y += 12   
    @status_rage_window = Window_BattleStatusRage.new
    @status_rage_window.viewport = @info_viewport
    @status_rage_window.x = 112
    @status_rage_window.y += 12   
    @status_states_window = Window_BattleStatusStates.new
    @status_states_window.viewport = @info_viewport
    @status_states_window.x = 112
    @status_states_window.y += 12   
    #---
    @party_command_window = Window_PartyCommand.new
    @actor_command_window = Window_ActorCommand.new
    @party_command_window.viewport = @info_viewport
    @actor_command_window.viewport = @info_viewport
    @actor_command_window.x = Graphics.width
    @confirm_command_window = Window_ConfirmCommand.new
    @confirm_command_window.viewport = @info_viewport
    @confirm_command_window.x = Graphics.width
    @actor_command_window.y += 32
    @confirm_command_window.y += 32
    @party_command_window.y += 32
    #---
    @info_viewport.ox = 128
    @actor_index = 0
    @status_shortcut_index = 0
    @status_window.index = 0
    @status_window.refresh
    actor = @status_window.actor
    @actor_command_window.setup(actor)
    if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:autocursor_sw]]
      @actor_command_window.index = actor.battle_command_index.to_i
    end
    #--- Calculate PTB Initiative
    if ptb? and (rand($game_party.total_agi) < rand($game_troop.total_agi) or
    $game_troop.surprise and !$scene.atb?)
      if !(($TEST or $BTEST) and Input.press?(Input::CTRL)) and
      !$game_troop.preemptive
        @ptb_initiative = true
        @info_viewport.ox = 64
        @actor_index = -1
        @status_window.index = -1
        @status_window.refresh
        @actor_command_window.openness = 0
        @party_command_window.openness = 0
      end
    end
    if ctb?
      make_action_orders_ctb
      if @action_battlers[0].actor?
        @actor_index = @action_battlers[0].index
        @status_window.index = @action_battlers[0].index
        actor = @status_window.actor
        @actor_command_window.setup(actor)
        if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:autocursor_sw]]
          index = actor.battle_command_index.to_i
          maximum = @actor_command_window.item_max - 1
          @actor_command_window.index = [index, maximum].min
        end
      else
        @ctb_initiative = true
        @info_viewport.ox = 64
        @actor_index = -1
        @status_window.index = -1
        @actor_command_window.openness = 0
        @party_command_window.openness = 0
      end
      @status_window.refresh
    end
    #---
    @info_viewport.visible = true
  end
 
  def dispose_info_viewport
    #---
    @status_window.dispose
    @status_hp_window.dispose
    @status_mp_window.dispose
    @status_rage_window.dispose
    @status_states_window.dispose
    #---
    @party_command_window.dispose
    @actor_command_window.dispose
    @confirm_command_window.dispose
    @info_viewport.dispose
    #---
    dispose_bem_windows
  end
end 


class Window_BattleStatusStates < Window_BattleStatus 
 
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    recreate if @current_party != $game_party.members
    for member in $game_party.members
      draw_item(member.index) if redraw?(member)
    end
  end
 
  #--------------------------------------------------------------------------
  # redraw?
  #--------------------------------------------------------------------------
  def redraw?(member)
    return true if ((Graphics.frame_count > 0) and (Graphics.frame_count % 180 == 0))
    return true if member.update_states
    return false
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    for i in 0...@item_max; draw_item(i); end
  end
 
end
class Window_BattleStatusHP < Window_BattleStatus 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_hp_2(actor, index)
  end 
end

class Window_BattleStatusMP < Window_BattleStatus
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_mp_2(actor, index)
  end
 
end

class Window_BattleStatusRage < Window_BattleStatus
 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_rage_2(actor, index)
  end
 
end # Window_BattleStatusRage

class Window_BattleStatus < Window_Selectable
  def initialize(minimum = false)
    super(0, 0, 544, 192)
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    @column_max = 1
    @minimum = minimum
    @current_party = $game_party.members
    recreate unless @miniature
    self.active = false
    self.opacity = 0
  end
 
  def refresh
    return if @miniature
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    @column_max = 1
    for i in 0...@item_max; draw_item(i); end
  end
   
  def update_cursor
    self.cursor_rect.empty
  end 
 
  def update
    super unless prevent_left_right?
    if (Graphics.frame_count > 0) and (Graphics.frame_count % (YAMI::HUD_MELODY::SCROLL_STATES_DELAY) == 0) then
      for i in $game_party.members
        actor = i
        @state_id_show[actor.id] += 1
      end
    end
    redraw if @last_index != self.index
    redraw if @battle_refresh_call
    return unless @minimum
    recreate if @current_party != $game_party.members
    return unless $scene.is_a?(Scene_Battle)
    for member in $game_party.members; redraw if member.update_states; end
    redraw if @last_active_battler != $scene.active_battler
  end
   
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_face_new(actor, index)
    draw_member_action_2(actor, rect.clone)
    return if @minimum
    draw_member_states(actor, rect.clone)
    draw_member_hp_2(actor, index)
    draw_member_mp_2(actor, index)
    draw_member_rage_2(actor, index)
  end
 
  def draw_item2(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_face(actor, rect.clone)
    draw_member_action(actor, rect.clone)
    return if @minimum
    draw_member_name(actor, rect.clone)
    draw_member_states(actor, rect.clone)
    draw_member_hp(actor, rect.clone)
    draw_member_mp(actor, rect.clone)
    draw_member_rage(actor, rect.clone)
  end
 
  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = YAMI::HUD_MELODY::HUD_SIZE_X
    rect.height = YAMI::HUD_MELODY::HUD_SIZE_Y
    rect.x = 0
    rect.y = index * rect.height
    return rect
  end
 
  def draw_member_face_new(actor, index)
    dx = 0
    dy = YAMI::HUD_MELODY::HEIGHT_PER_HUD * index
    lower_opacity = YEM::BATTLE_ENGINE::PARTY_WINDOW[:face_opacity]
    opacity = opacity?(actor) ? 255 : lower_opacity
    bitmap = Cache.picture(actor.name+"_HUD")   
    rect = Rect.new(0, 0, 0, 0)
    rect.width = YAMI::HUD_MELODY::HUD_SIZE_X
    rect.height = YAMI::HUD_MELODY::HUD_SIZE_Y
    rect.x = 0
    rect.y = 0
    self.contents.blt(dx, dy, bitmap, rect, opacity)
  end
 
  def draw_member_states(actor, rect)
    if YAMI::HUD_MELODY::SCROLL_STATES then
      bitmap = bitmap_state(actor)
      if ((@state_id_show[actor.id]) >= actor.states.size) then
        @state_id_show[actor.id] = 0
      end
      rect_new = Rect.new(@state_id_show[actor.id] * 24, 0, 24, 24)
      self.contents.blt(rect.x + YAMI::HUD_MELODY::STATES_X, rect.y+8, bitmap, rect_new) 
      actor.update_states = false
    else
      count = 0
      for state in actor.states
        next if state.hide_state
        draw_icon(state.icon_index, rect.x + YAMI::HUD_MELODY::STATES_X + 28 * count, rect.y+8)
        count += 1
        break if count >= YAMI::HUD_MELODY::SHOW_STATES
      end
      actor.update_states = false
    end
  end
 
  def bitmap_state(actor)
    icon = Cache.system("Iconset")
    w = actor.states.size * 24
    w = 24 if w < 1
    bitmap = Bitmap.new(w, 24)
    count = 0
    for state in actor.states
      next if state.hide_state
      icon_index = state.icon_index
      x = 24 * count
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      bitmap.blt(x, 0, icon, rect)
      count += 1
    end
    return bitmap
  end
 
  def draw_member_action_2(actor, rect)
    return unless YEM::BATTLE_ENGINE::PARTY_WINDOW[:action_icons]
    icon = YEM::BATTLE_ENGINE::ICON_MESSAGE[:wait_icon]
    case actor.action.kind
    when 0 # Basic
      case actor.action.basic
      when 0 # Attack
        icon = actor.attack_icon
      when 1 # Guard
        icon = actor.guard_icon
      when 2 # Escape
        icon = YEM::BATTLE_ENGINE::ICON_MESSAGE[:flee_icon]
      end
    when 1 # Skill
      icon = actor.action.skill.icon_index
    when 2 # Item
      icon = actor.action.item.icon_index
    end
    enabled = actor.action.valid?
    enabled = false if actor.action.kind == 0 and actor.action.basic == 3
    if $scene.is_a?(Scene_Battle) and $scene.ctb? and actor.action.guard?
      icon = actor.guard_icon
      enabled = true
    end
    draw_icon(icon, rect.x + 142, rect.y + 4, enabled)
  end
 
  #--------------------------------------------------------------------------
  # recreate
  #--------------------------------------------------------------------------
  def recreate
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    @item_max = 1 if @minitature
    @updating = -1
    @current_party = $game_party.members
    @current_hp = {}; @current_hp_gauge = {}; @maxhp = {}
    @current_mp = {}; @current_mp_gauge = {}; @maxmp = {}
    @current_rage = {}; @current_rage_gauge = {}; @max_rage = {}
    @hp_gauge = {}; @mp_gauge = {}; @rage_gauge = {}
    temp_rect = item_rect(0)
    @hp_gauge_width = YAMI::HUD_MELODY::HP_GAUGE_WIDTH
    @mp_gauge_width = YAMI::HUD_MELODY::MP_GAUGE_WIDTH
    @rg_gauge_width = YAMI::HUD_MELODY::RAGE_GAUGE_WIDTH
    @state_id_show = {}
    for i in 0...@current_party.size
      actor = $game_party.members[i]
      @state_id_show[actor.id] = 0
      #--
      @current_hp[i] = actor.hp
      maxhp = [[actor.maxhp, actor.base_maxhp, 1].max, actor.maxhp_limit].min
      @current_hp_gauge[i] = (actor.hp * @hp_gauge_width / maxhp)
      @maxhp[i] = maxhp
      @hp_gauge[i] = Cache.system("HP")
      rect = Rect.new(0, 0, @current_hp_gauge[i], @hp_gauge[i].height)
      self.contents.blt(0, 0, @hp_gauge[i], rect)     
      #--
      maxmp = [[actor.maxmp, actor.base_maxmp, 1].max, actor.maxmp_limit].min
      @current_mp[i] = actor.mp
      @current_mp_gauge[i] = (actor.mp * @mp_gauge_width / [actor.maxmp,1].max)
      @maxmp[i] = maxmp
      @mp_gauge[i] = Cache.system("MP")
      rect = Rect.new(0, 0, @current_mp_gauge[i], @mp_gauge[i].height)
      self.contents.blt(0, 0, @mp_gauge[i], rect)
      #---
      actor.rage = 0 if actor.rage == nil
      @current_rage[i] = actor.rage
      @current_rage_gauge[i] = actor.rage * @rg_gauge_width / actor.max_rage
      @max_rage[i] = actor.max_rage
      @rage_gauge[i] = Cache.system("Rage2")
      rect = Rect.new(0, 0, @current_rage_gauge[i], @rage_gauge[i].height)
      self.contents.blt(0, 0, @rage_gauge[i], rect)     
    end
    refresh
  end
 
  def draw_member_rage_2(actor, index)
    return unless actor.use_rage?
    @updating = -1
    i = actor.index
    max_rage = @max_rage[i]
    dy = YAMI::HUD_MELODY::RAGE_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    dx = YAMI::HUD_MELODY::RAGE_GAUGE_X
    rg_gw = @rg_gauge_width
    #---
    target_gauge = (actor.rage * @rg_gauge_width / max_rage)
    target_gauge += 2 if actor.rage > 0
    if @current_rage_gauge[i] > target_gauge
      @updating = i
      value = [1,(@current_rage_gauge[i]-target_gauge).abs].min
      @current_rage_gauge[i] -= value
      @current_rage_gauge[i] = [@current_rage_gauge[i], 0].max
      rect = Rect.new(0, 0, @current_rage_gauge[i], @rage_gauge[i].height)
      self.contents.blt(dx, dy, @rage_gauge[i], rect) 
    elsif @current_rage_gauge[i] < target_gauge
      @updating = i
      value = [1,(@current_rage_gauge[i]-target_gauge).abs].min
      @current_rage_gauge[i] += value
      @current_rage_gauge[i] = [@current_rage_gauge[i], rg_gw].min
      rect = Rect.new(0, 0, @current_rage_gauge[i], @rage_gauge[i].height)
      self.contents.blt(dx, dy, @rage_gauge[i], rect)
    else
      gw = @current_rage_gauge[i]
      gw = [gw, 3].max if actor.rage > 0
      rect = Rect.new(0, 0, gw, @rage_gauge[i].height)
      self.contents.blt(dx, dy, @rage_gauge[i], rect)
    end
    #---
    if @current_rage[i] != actor.rage
      @updating = i
      @current_rage[i] += (@current_rage[i] > actor.rage) ? -1 : 1
      @current_rage[i] = actor.rage if @current_rage_gauge[i] == target_gauge
    end
    #---
    text = @current_rage[i]
    if YAMI::HUD_MELODY::USE_IMAGE_RAGE then
      write_number(text,dx+4,dy-20,2)
    else
      self.contents.font.size = 12
      self.contents.draw_format_text(dx, dy-20, 75, WLH, sprintf(YAMI::HUD_MELODY::RAGE_SHOW,text), 0)
    end
    #---
  end
 
  def draw_member_mp_2(actor, index)
    @updating = -1
    i = actor.index
    maxmp = @maxmp[i]
    dy = YAMI::HUD_MELODY::MP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    dx = YAMI::HUD_MELODY::MP_GAUGE_X
    mp_gw = @mp_gauge_width
    #---
    target_gauge = (actor.mp * @mp_gauge_width / maxmp)
    if @current_mp_gauge[i] > target_gauge and !@miniature
      @updating = i
      @current_mp_gauge[i] -= [1, (@current_mp_gauge[i]-target_gauge).abs].min
      @current_mp_gauge[i] = [@current_mp_gauge[i], 0].max
      rect = Rect.new(0, 0, @current_mp_gauge[i], @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect) 
    elsif @current_mp_gauge[i] < target_gauge and !@miniature
      @updating = i
      @current_mp_gauge[i] += [1, (@current_mp_gauge[i]-target_gauge).abs].min
      @current_mp_gauge[i] = [@current_mp_gauge[i], @mp_gauge_width].min
      rect = Rect.new(0, 0, @current_mp_gauge[i], @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect) 
    else
      gw = mp_gw * actor.mp / maxmp
      gw = [gw, 3].max if actor.mp > 0
      rect = Rect.new(0, 0, gw, @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect) 
    end
    #---
    if actor.base_maxmp > actor.maxmp
      gbw = mp_gw
      gbw *= (actor.base_maxmp - actor.maxmp) / [actor.base_maxmp, 1].max + 1
      rect = Rect.new(0, 0, mp_gw-gbw, @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect)
    end
    #---
    if @current_mp[i] != actor.mp
      @updating = i
      den = [mp_gw/3 + rand(mp_gw/2), 1].max
      value = [[maxmp/den, (@current_mp[i]-actor.mp).abs].min, 1].max
      @current_mp[i] += (@current_mp[i] > actor.mp) ? -value : value
      @current_mp[i] = actor.mp if @current_mp_gauge[i] == target_gauge
    end
    #---
    text = @current_mp[i]
    if YAMI::HUD_MELODY::USE_IMAGE then
      write_number(text,dx+6,dy-20,1)
    else     
      self.contents.font.color = text_color(YAMI::HUD_MELODY::MP_COLOR)
      self.contents.font.size = 16
      self.contents.draw_text(dx+22, dy-20, 75, WLH, text, 0)
    end
    #---
  end
 
  def draw_member_hp_2(actor, index)
    @updating = -1
    i = actor.index
    maxhp = @maxhp[i]
    dy = YAMI::HUD_MELODY::HP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    dx = YAMI::HUD_MELODY::HP_GAUGE_X
    #---
    target_gauge = (actor.hp * @hp_gauge_width / maxhp)
    if @current_hp_gauge[i] > target_gauge
      @updating = i
      @current_hp_gauge[i] -= [1, (@current_hp_gauge[i]-target_gauge).abs].min
      @current_hp_gauge[i] = [@current_hp_gauge[i], 0].max
      rect = Rect.new(0, 0, @current_hp_gauge[i], @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)     
    elsif @current_hp_gauge[i] < target_gauge
      @updating = i
      @current_hp_gauge[i] += [1, (@current_hp_gauge[i]-target_gauge).abs].min
      @current_hp_gauge[i] = [@current_hp_gauge[i], @hp_gauge_width].min
      rect = Rect.new(0, 0, @current_hp_gauge[i], @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)
    else
      gw = @hp_gauge_width * actor.hp / maxhp
      gw = [gw, 3].max if actor.hp > 0
      rect = Rect.new(0, 0, gw, @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)
    end
    #---
    if maxhp > actor.maxhp
      gbw = @hp_gauge_width * (actor.base_maxhp - actor.maxhp) / maxhp + 1
      rect = Rect.new(0, 0, @hp_gauge_width-gbw, @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)
    end
    #---
    if @current_hp[i] != actor.hp
      @updating = i
      den = [@hp_gauge_width/3 + rand(@hp_gauge_width/2), 1].max
      value = [[maxhp/den, (@current_hp[i]-actor.hp).abs].min, 1].max
      @current_hp[i] += (@current_hp[i] > actor.hp) ? -value : value
      @current_hp[i] = actor.hp if @current_hp_gauge[i] == target_gauge
    end
    #---
    text = @current_hp[i]
    if YAMI::HUD_MELODY::USE_IMAGE then
      write_number(text,dx+4,dy-20,0)
    else
      self.contents.font.color = text_color(YAMI::HUD_MELODY::HP_COLOR)
      self.contents.font.size = 16
      self.contents.draw_text(dx+22, dy-20, 75, WLH, text, 0)
    end   
    #---
  end
 
  def write_number(num,x,y,line = 0)
    index = String(num).length   
    work = num
    if work == 0 then
      d_int = 0
      bitmap = Cache.system("String02")
      rect = Rect.new(d_int * (bitmap.width / 10), line * (bitmap.height / 4), (bitmap.width / 10), (bitmap.height / 4))
      self.contents.blt(x + 15, y + 6, bitmap, rect) 
      return
    end
    while work != 0 do
      d_int = work % 10
      work = (work - d_int) / 10
      bitmap = Cache.system("String02")
      rect = Rect.new(d_int * (bitmap.width / 10), line * (bitmap.height / 4), (bitmap.width / 10), (bitmap.height / 4))
      self.contents.blt(x + index * (bitmap.width / 10 - 4), y + 6, bitmap, rect) 
      index -= 1
    end
  end
end

class Window_BattleStatus_Mini < Window_BattleStatus
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_item2($scene.selected_battler.index)
  end 
end # Window_BattleStatus_Mini
El tamaño lo tengo, lo que nesecito es posicionar las cosas, estados, el comando de espera, las barras de VT y SP
esta es la hud:

acerque un poco las cosas xD
y se ve haci


Enserio nesecito que alguno de ustedes me moviera los comandos y.y
le estaria eternamente agradecido
espero a que alguien responda este post y.y



Recomendaciones

Visita mi Blog y DeviantArt haciendo click en los banners

serch
Boss
Boss

Talento : Maper
Mensajes : 1998
Engranes : 4908
Reputación : 215
Fecha de inscripción : 27/05/2011
Edad : 24

Ver perfil de usuario

Volver arriba Ir abajo

Re: Ayuda con un script

Mensaje por orochii el Vie Jul 22, 2011 11:05 pm

Te mando TODO el script de vuelta, porque para arreglar la posición de los states (en el Y) no me bastó con la configuración xD... en fin.
Código:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Custom HUD for Melody
# Author: Yami
# Site: Loctien.net
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#~~~ Initialize ~~~#

module YAMI
  module HUD_MELODY
    #~~ Base HUD ~~#
    HUD_SIZE_X = 99
    HUD_SIZE_Y = 32
    HEIGHT_PER_HUD = 32
   
    #~~ HP/MP/Rage ~~#
    HP_GAUGE_X = 160
    HP_GAUGE_Y = 19 #True HP_GAUGE_Y = HP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    MP_GAUGE_X = 228
    MP_GAUGE_Y = 19 #True MP_GAUGE_Y = MP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    RAGE_GAUGE_X = 160
    RAGE_GAUGE_Y = 25 #True RAGE_GAUGE_Y = RAGE_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    HP_GAUGE_WIDTH = 55
    MP_GAUGE_WIDTH = 55
    RAGE_GAUGE_WIDTH = 72
   
    #~~ Action Icon ~~#
    ACTION_ICON_X = 112
    ACTION_ICON_Y = 4
   
    #~~ HP/MP/RAGE Number ~~#
    USE_IMAGE = true
    USE_IMAGE_RAGE = false
    #IF USE_IMAGE = false
    HP_COLOR = 2
    MP_COLOR = 1
    RAGE_SHOW = "\\C[10]Rage: \\C[0]%d"
   
    #~~ States ~~#
    SHOW_STATES = 5
    SCROLL_STATES = true
    STATES_X = 288
    SCROLL_STATES_DELAY = 26 #This is Frames_Count, which 60 frames ~ 1 second
  end
end

#~~~ End Initialize ~~~#

class Scene_Battle < Scene_Base
  def start_target_actor_selection
    pause_atb(true) if semi_active_atb? or wait_atb?
    if @command_action
      @info_viewport.ox += @status_window.width
      @info_viewport.rect.x += @status_window.width
    end
    create_highlighted_targets($game_party)
    @target_help_window.active = true
    @target_actor_window = Window_BattleStatus.new(false)
    @target_actor_window.index = 0
    @target_actor_window.active = true
    @target_actor_window.y = @info_viewport.rect.y + 12
    @actor_command_window.active = false
    #---

    #---
 
      @target_actor_window.target_highlight = true
      @target_actor_window.highlight_all = true if obj.for_all?
      @target_actor_window.highlight_all = true if obj.for_random?
      @target_actor_window.highlight_user = true if obj.for_user?
      @target_actor_window.frozen_cursor = true if obj.for_user?
      @target_actor_window.index = @selected_battler.index if obj.for_user?
      @target_actor_window.highlight_none = true if obj.for_none?
      @target_actor_window.highlight_dead = true if obj.for_dead_friend?
      @target_actor_window.refresh
    end
    #---
    @target_help_window.refresh(@target_actor_window.actor, @selected_battler)
    hide_object_windows
    update_battle_cursor
    create_aoe_indicator(@target_actor_window)
  end

  def end_target_actor_selection
    @target_help_window.active = false
    @last_target_enemy = nil
    @status_window.draw_item(@selected_battler.index)
    @target_actor_window.dispose
    @target_actor_window = nil
    #---
    #---
    show_object_windows
    if @actor_command_window.item == :attack or @command_action
      @info_viewport.ox -= @status_window.width
      @info_viewport.rect.x -= @status_window.width
      @actor_command_window.active = true
      @command_action = false
    end
    pause_atb(false) if semi_active_atb?
    dispose_aoe_indicator
  end
 
  def hide_object_windows
    @skill_window.visible = false if @skill_window != nil
    @item_window.visible = false if @item_window != nil
  end
 
  def show_object_windows
    @skill_window.visible = true if @skill_window != nil
    @item_window.visible = true if @item_window != nil
  end
 
  def close_input_windows
    @party_command_window.active = false
    @actor_command_window.active = false
    @confirm_command_window.active = false
    @party_command_window.openness = 0
    @actor_command_window.openness = 0
    @confirm_command_window.openness = 0
    loop do
      update_basic
      break if @info_viewport.ox == 128
      if @info_viewport.ox >= 128
        @info_viewport.ox -= [16, (128 - @info_viewport.ox).abs].min
      else
        @info_viewport.ox += [16, (128 - @info_viewport.ox).abs].min
      end
    end
    @status_window.index = @actor_index = -1
  end
 
  def create_info_viewport
    force_preemptive_or_surprise
    #---
    @info_viewport = Viewport.new(0, Graphics.height-160, Graphics.width, 160)
    @info_viewport.z = 100
    #---
    @status_window = Window_BattleStatus.new(true)
    @status_window.viewport = @info_viewport
    @status_window.x = 112
    @status_window.y += 12
    @status_hp_window = Window_BattleStatusHP.new
    @status_hp_window.viewport = @info_viewport
    @status_hp_window.x = 112
    @status_hp_window.y += 12   
    @status_mp_window = Window_BattleStatusMP.new
    @status_mp_window.viewport = @info_viewport
    @status_mp_window.x = 112
    @status_mp_window.y += 12   
    @status_rage_window = Window_BattleStatusRage.new
    @status_rage_window.viewport = @info_viewport
    @status_rage_window.x = 112
    @status_rage_window.y += 12   
    @status_states_window = Window_BattleStatusStates.new
    @status_states_window.viewport = @info_viewport
    @status_states_window.x = 112
    @status_states_window.y += 12   
    #---
    @party_command_window = Window_PartyCommand.new
    @actor_command_window = Window_ActorCommand.new
    @party_command_window.viewport = @info_viewport
    @actor_command_window.viewport = @info_viewport
    @actor_command_window.x = Graphics.width
    @confirm_command_window = Window_ConfirmCommand.new
    @confirm_command_window.viewport = @info_viewport
    @confirm_command_window.x = Graphics.width
    @actor_command_window.y += 32
    @confirm_command_window.y += 32
    @party_command_window.y += 32
    #---
    @info_viewport.ox = 128
    @actor_index = 0
    @status_shortcut_index = 0
    @status_window.index = 0
    @status_window.refresh
    actor = @status_window.actor
    @actor_command_window.setup(actor)
    if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:autocursor_sw]]
      @actor_command_window.index = actor.battle_command_index.to_i
    end
    #--- Calculate PTB Initiative
    if ptb? and (rand($game_party.total_agi) < rand($game_troop.total_agi) or
    $game_troop.surprise and !$scene.atb?)
      if !(($TEST or $BTEST) and Input.press?(Input::CTRL)) and
      !$game_troop.preemptive
        @ptb_initiative = true
        @info_viewport.ox = 64
        @actor_index = -1
        @status_window.index = -1
        @status_window.refresh
        @actor_command_window.openness = 0
        @party_command_window.openness = 0
      end
    end
    if ctb?
      make_action_orders_ctb
      if @action_battlers[0].actor?
        @actor_index = @action_battlers[0].index
        @status_window.index = @action_battlers[0].index
        actor = @status_window.actor
        @actor_command_window.setup(actor)
        if $game_switches[YEM::BATTLE_ENGINE::OPTIONS[:autocursor_sw]]
          index = actor.battle_command_index.to_i
          maximum = @actor_command_window.item_max - 1
          @actor_command_window.index = [index, maximum].min
        end
      else
        @ctb_initiative = true
        @info_viewport.ox = 64
        @actor_index = -1
        @status_window.index = -1
        @actor_command_window.openness = 0
        @party_command_window.openness = 0
      end
      @status_window.refresh
    end
    #---
    @info_viewport.visible = true
  end
 
  def dispose_info_viewport
    #---
    @status_window.dispose
    @status_hp_window.dispose
    @status_mp_window.dispose
    @status_rage_window.dispose
    @status_states_window.dispose
    #---
    @party_command_window.dispose
    @actor_command_window.dispose
    @confirm_command_window.dispose
    @info_viewport.dispose
    #---
    dispose_bem_windows
  end
end 


class Window_BattleStatusStates < Window_BattleStatus 
 
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    recreate if @current_party != $game_party.members
    for member in $game_party.members
      draw_item(member.index) if redraw?(member)
    end
  end
 
  #--------------------------------------------------------------------------
  # redraw?
  #--------------------------------------------------------------------------
  def redraw?(member)
    return true if ((Graphics.frame_count > 0) and (Graphics.frame_count % 180 == 0))
    return true if member.update_states
    return false
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    for i in 0...@item_max; draw_item(i); end
  end
 
end
class Window_BattleStatusHP < Window_BattleStatus 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_hp_2(actor, index)
  end 
end

class Window_BattleStatusMP < Window_BattleStatus
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_mp_2(actor, index)
  end
 
end

class Window_BattleStatusRage < Window_BattleStatus
 
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_rage_2(actor, index)
  end
 
end # Window_BattleStatusRage

class Window_BattleStatus < Window_Selectable
  def initialize(minimum = false)
    super(0, 0, 544, 192)
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    @column_max = 1
    @minimum = minimum
    @current_party = $game_party.members
    recreate unless @miniature
    self.active = false
    self.opacity = 0
  end
 
  def refresh
    return if @miniature
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    @column_max = 1
    for i in 0...@item_max; draw_item(i); end
  end
   
  def update_cursor
    self.cursor_rect.empty
  end 
 
  def update
    super unless prevent_left_right?
    if (Graphics.frame_count > 0) and (Graphics.frame_count % (YAMI::HUD_MELODY::SCROLL_STATES_DELAY) == 0) then
      for i in $game_party.members
        actor = i
        @state_id_show[actor.id] += 1
      end
    end
    redraw if @last_index != self.index
    redraw if @battle_refresh_call
    return unless @minimum
    recreate if @current_party != $game_party.members
    return unless $scene.is_a?(Scene_Battle)
    for member in $game_party.members; redraw if member.update_states; end
    redraw if @last_active_battler != $scene.active_battler
  end
   
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_face_new(actor, index)
    draw_member_action_2(actor, rect.clone)
    return if @minimum
    draw_member_states(actor, rect.clone)
    draw_member_hp_2(actor, index)
    draw_member_mp_2(actor, index)
    draw_member_rage_2(actor, index)
  end
 
  def draw_item2(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    actor = $game_party.members[index]
    return if actor == nil
    draw_member_face(actor, rect.clone)
    draw_member_action(actor, rect.clone)
    return if @minimum
    draw_member_name(actor, rect.clone)
    draw_member_states(actor, rect.clone)
    draw_member_hp(actor, rect.clone)
    draw_member_mp(actor, rect.clone)
    draw_member_rage(actor, rect.clone)
  end
 
  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = YAMI::HUD_MELODY::HUD_SIZE_X
    rect.height = YAMI::HUD_MELODY::HUD_SIZE_Y
    rect.x = 0
    rect.y = index * rect.height
    return rect
  end
 
  def draw_member_face_new(actor, index)
    dx = 0
    dy = YAMI::HUD_MELODY::HEIGHT_PER_HUD * index
    lower_opacity = YEM::BATTLE_ENGINE::PARTY_WINDOW[:face_opacity]
    opacity = opacity?(actor) ? 255 : lower_opacity
    bitmap = Cache.system("LeahHUD")#actor.name+"_HUD")   
    rect = Rect.new(0, 0, 0, 0)
    rect.width = YAMI::HUD_MELODY::HUD_SIZE_X
    rect.height = YAMI::HUD_MELODY::HUD_SIZE_Y
    rect.x = 0
    rect.y = 0
    self.contents.blt(dx, dy, bitmap, rect, opacity)
  end
 
  def draw_member_states(actor, rect)
    if YAMI::HUD_MELODY::SCROLL_STATES then
      bitmap = bitmap_state(actor)
      if ((@state_id_show[actor.id]) >= actor.states.size) then
        @state_id_show[actor.id] = 0
      end
      rect_new = Rect.new(@state_id_show[actor.id] * 24, 0, 24, 24)
      self.contents.blt(rect.x + YAMI::HUD_MELODY::STATES_X, rect.y+4, bitmap, rect_new) 
      actor.update_states = false
    else
      count = 0
      for state in actor.states
        next if state.hide_state
        draw_icon(state.icon_index, rect.x + YAMI::HUD_MELODY::STATES_X + 28 * count, rect.y+4)
        count += 1
        break if count >= YAMI::HUD_MELODY::SHOW_STATES
      end
      actor.update_states = false
    end
  end
 
  def bitmap_state(actor)
    icon = Cache.system("Iconset")
    w = actor.states.size * 24
    w = 24 if w < 1
    bitmap = Bitmap.new(w, 24)
    count = 0
    for state in actor.states
      next if state.hide_state
      icon_index = state.icon_index
      x = 24 * count
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      bitmap.blt(x, 0, icon, rect)
      count += 1
    end
    return bitmap
  end
 
  def draw_member_action_2(actor, rect)
    return unless YEM::BATTLE_ENGINE::PARTY_WINDOW[:action_icons]
    icon = YEM::BATTLE_ENGINE::ICON_MESSAGE[:wait_icon]
    case actor.action.kind
    when 0 # Basic
      case actor.action.basic
      when 0 # Attack
        icon = actor.attack_icon
      when 1 # Guard
        icon = actor.guard_icon
      when 2 # Escape
        icon = YEM::BATTLE_ENGINE::ICON_MESSAGE[:flee_icon]
      end
    when 1 # Skill
      icon = actor.action.skill.icon_index
    when 2 # Item
      icon = actor.action.item.icon_index
    end
    enabled = actor.action.valid?
    enabled = false if actor.action.kind == 0 and actor.action.basic == 3
    if $scene.is_a?(Scene_Battle) and $scene.ctb? and actor.action.guard?
      icon = actor.guard_icon
      enabled = true
    end #ACTION_ICON_X asdtsutarja
    draw_icon(icon, rect.x + YAMI::HUD_MELODY::ACTION_ICON_X, rect.y + YAMI::HUD_MELODY::ACTION_ICON_Y, enabled)
  end
 
  #--------------------------------------------------------------------------
  # recreate
  #--------------------------------------------------------------------------
  def recreate
    max_members = YEM::BATTLE_ENGINE::MAXIMUM_PARTY_MEMBERS
    @item_max = [$game_party.members.size, max_members].max
    @item_max = 1 if @minitature
    @updating = -1
    @current_party = $game_party.members
    @current_hp = {}; @current_hp_gauge = {}; @maxhp = {}
    @current_mp = {}; @current_mp_gauge = {}; @maxmp = {}
    @current_rage = {}; @current_rage_gauge = {}; @max_rage = {}
    @hp_gauge = {}; @mp_gauge = {}; @rage_gauge = {}
    temp_rect = item_rect(0)
    @hp_gauge_width = YAMI::HUD_MELODY::HP_GAUGE_WIDTH
    @mp_gauge_width = YAMI::HUD_MELODY::MP_GAUGE_WIDTH
    @rg_gauge_width = YAMI::HUD_MELODY::RAGE_GAUGE_WIDTH
    @state_id_show = {}
    for i in 0...@current_party.size
      actor = $game_party.members[i]
      @state_id_show[actor.id] = 0
      #--
      @current_hp[i] = actor.hp
      maxhp = [[actor.maxhp, actor.base_maxhp, 1].max, actor.maxhp_limit].min
      @current_hp_gauge[i] = (actor.hp * @hp_gauge_width / maxhp)
      @maxhp[i] = maxhp
      @hp_gauge[i] = Cache.system("HP")
      rect = Rect.new(0, 0, @current_hp_gauge[i], @hp_gauge[i].height)
      self.contents.blt(0, 0, @hp_gauge[i], rect)     
      #--
      maxmp = [[actor.maxmp, actor.base_maxmp, 1].max, actor.maxmp_limit].min
      @current_mp[i] = actor.mp
      @current_mp_gauge[i] = (actor.mp * @mp_gauge_width / [actor.maxmp,1].max)
      @maxmp[i] = maxmp
      @mp_gauge[i] = Cache.system("MP")
      rect = Rect.new(0, 0, @current_mp_gauge[i], @mp_gauge[i].height)
      self.contents.blt(0, 0, @mp_gauge[i], rect)
      #---
      actor.rage = 0 if actor.rage == nil
      @current_rage[i] = actor.rage
      @current_rage_gauge[i] = actor.rage * @rg_gauge_width / actor.max_rage
      @max_rage[i] = actor.max_rage
      @rage_gauge[i] = Cache.system("Rage2")
      rect = Rect.new(0, 0, @current_rage_gauge[i], @rage_gauge[i].height)
      self.contents.blt(0, 0, @rage_gauge[i], rect)     
    end
    refresh
  end
 
  def draw_member_rage_2(actor, index)
    return unless actor.use_rage?
    @updating = -1
    i = actor.index
    max_rage = @max_rage[i]
    dy = YAMI::HUD_MELODY::RAGE_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    dx = YAMI::HUD_MELODY::RAGE_GAUGE_X
    rg_gw = @rg_gauge_width
    #---
    target_gauge = (actor.rage * @rg_gauge_width / max_rage)
    target_gauge += 2 if actor.rage > 0
    if @current_rage_gauge[i] > target_gauge
      @updating = i
      value = [1,(@current_rage_gauge[i]-target_gauge).abs].min
      @current_rage_gauge[i] -= value
      @current_rage_gauge[i] = [@current_rage_gauge[i], 0].max
      rect = Rect.new(0, 0, @current_rage_gauge[i], @rage_gauge[i].height)
      self.contents.blt(dx, dy, @rage_gauge[i], rect) 
    elsif @current_rage_gauge[i] < target_gauge
      @updating = i
      value = [1,(@current_rage_gauge[i]-target_gauge).abs].min
      @current_rage_gauge[i] += value
      @current_rage_gauge[i] = [@current_rage_gauge[i], rg_gw].min
      rect = Rect.new(0, 0, @current_rage_gauge[i], @rage_gauge[i].height)
      self.contents.blt(dx, dy, @rage_gauge[i], rect)
    else
      gw = @current_rage_gauge[i]
      gw = [gw, 3].max if actor.rage > 0
      rect = Rect.new(0, 0, gw, @rage_gauge[i].height)
      self.contents.blt(dx, dy, @rage_gauge[i], rect)
    end
    #---
    if @current_rage[i] != actor.rage
      @updating = i
      @current_rage[i] += (@current_rage[i] > actor.rage) ? -1 : 1
      @current_rage[i] = actor.rage if @current_rage_gauge[i] == target_gauge
    end
    #---
    text = @current_rage[i]
    if YAMI::HUD_MELODY::USE_IMAGE_RAGE then
      write_number(text,dx+4,dy-20,2)
    else
      self.contents.font.size = 12
      #self.contents.draw_format_text(dx, dy-20, 75, WLH, sprintf(YAMI::HUD_MELODY::RAGE_SHOW,text), 0)
    end
    #---
  end
 
  def draw_member_mp_2(actor, index)
    @updating = -1
    i = actor.index
    maxmp = @maxmp[i]
    dy = YAMI::HUD_MELODY::MP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    dx = YAMI::HUD_MELODY::MP_GAUGE_X
    mp_gw = @mp_gauge_width
    #---
    target_gauge = (actor.mp * @mp_gauge_width / maxmp)
    if @current_mp_gauge[i] > target_gauge and !@miniature
      @updating = i
      @current_mp_gauge[i] -= [1, (@current_mp_gauge[i]-target_gauge).abs].min
      @current_mp_gauge[i] = [@current_mp_gauge[i], 0].max
      rect = Rect.new(0, 0, @current_mp_gauge[i], @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect) 
    elsif @current_mp_gauge[i] < target_gauge and !@miniature
      @updating = i
      @current_mp_gauge[i] += [1, (@current_mp_gauge[i]-target_gauge).abs].min
      @current_mp_gauge[i] = [@current_mp_gauge[i], @mp_gauge_width].min
      rect = Rect.new(0, 0, @current_mp_gauge[i], @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect) 
    else
      gw = mp_gw * actor.mp / maxmp
      gw = [gw, 3].max if actor.mp > 0
      rect = Rect.new(0, 0, gw, @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect) 
    end
    #---
    if actor.base_maxmp > actor.maxmp
      gbw = mp_gw
      gbw *= (actor.base_maxmp - actor.maxmp) / [actor.base_maxmp, 1].max + 1
      rect = Rect.new(0, 0, mp_gw-gbw, @mp_gauge[i].height)
      self.contents.blt(dx, dy, @mp_gauge[i], rect)
    end
    #---
    if @current_mp[i] != actor.mp
      @updating = i
      den = [mp_gw/3 + rand(mp_gw/2), 1].max
      value = [[maxmp/den, (@current_mp[i]-actor.mp).abs].min, 1].max
      @current_mp[i] += (@current_mp[i] > actor.mp) ? -value : value
      @current_mp[i] = actor.mp if @current_mp_gauge[i] == target_gauge
    end
    #---
    text = @current_mp[i]
    if YAMI::HUD_MELODY::USE_IMAGE then
      write_number(text,dx+6,dy-20,1)
    else     
      self.contents.font.color = text_color(YAMI::HUD_MELODY::MP_COLOR)
      self.contents.font.size = 16
      self.contents.draw_text(dx+22, dy-20, 75, WLH, text, 0)
    end
    #---
  end
 
  def draw_member_hp_2(actor, index)
    @updating = -1
    i = actor.index
    maxhp = @maxhp[i]
    dy = YAMI::HUD_MELODY::HP_GAUGE_Y + index * YAMI::HUD_MELODY::HEIGHT_PER_HUD
    dx = YAMI::HUD_MELODY::HP_GAUGE_X
    #---
    target_gauge = (actor.hp * @hp_gauge_width / maxhp)
    if @current_hp_gauge[i] > target_gauge
      @updating = i
      @current_hp_gauge[i] -= [1, (@current_hp_gauge[i]-target_gauge).abs].min
      @current_hp_gauge[i] = [@current_hp_gauge[i], 0].max
      rect = Rect.new(0, 0, @current_hp_gauge[i], @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)     
    elsif @current_hp_gauge[i] < target_gauge
      @updating = i
      @current_hp_gauge[i] += [1, (@current_hp_gauge[i]-target_gauge).abs].min
      @current_hp_gauge[i] = [@current_hp_gauge[i], @hp_gauge_width].min
      rect = Rect.new(0, 0, @current_hp_gauge[i], @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)
    else
      gw = @hp_gauge_width * actor.hp / maxhp
      gw = [gw, 3].max if actor.hp > 0
      rect = Rect.new(0, 0, gw, @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)
    end
    #---
    if maxhp > actor.maxhp
      gbw = @hp_gauge_width * (actor.base_maxhp - actor.maxhp) / maxhp + 1
      rect = Rect.new(0, 0, @hp_gauge_width-gbw, @hp_gauge[i].height)
      self.contents.blt(dx, dy, @hp_gauge[i], rect)
    end
    #---
    if @current_hp[i] != actor.hp
      @updating = i
      den = [@hp_gauge_width/3 + rand(@hp_gauge_width/2), 1].max
      value = [[maxhp/den, (@current_hp[i]-actor.hp).abs].min, 1].max
      @current_hp[i] += (@current_hp[i] > actor.hp) ? -value : value
      @current_hp[i] = actor.hp if @current_hp_gauge[i] == target_gauge
    end
    #---
    text = @current_hp[i]
    if YAMI::HUD_MELODY::USE_IMAGE then
      write_number(text,dx+4,dy-20,0)
    else
      self.contents.font.color = text_color(YAMI::HUD_MELODY::HP_COLOR)
      self.contents.font.size = 16
      self.contents.draw_text(dx+22, dy-20, 75, WLH, text, 0)
    end   
    #---
  end
 
  def write_number(num,x,y,line = 0)
    index = String(num).length   
    work = num
    if work == 0 then
      d_int = 0
      bitmap = Cache.system("String02")
      rect = Rect.new(d_int * (bitmap.width / 10), line * (bitmap.height / 4), (bitmap.width / 10), (bitmap.height / 4))
      self.contents.blt(x + 15, y + 6, bitmap, rect) 
      return
    end
    while work != 0 do
      d_int = work % 10
      work = (work - d_int) / 10
      bitmap = Cache.system("String02")
      rect = Rect.new(d_int * (bitmap.width / 10), line * (bitmap.height / 4), (bitmap.width / 10), (bitmap.height / 4))
      self.contents.blt(x + index * (bitmap.width / 10 - 4), y + 6, bitmap, rect)
      index -= 1
    end
  end
end

class Window_BattleStatus_Mini < Window_BattleStatus
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_item2($scene.selected_battler.index)
  end 
end # Window_BattleStatus_Mini

Y la "rage bar" la puse debajo del HP... a ver qué tal así xd.

Espero así te sirva, suerte,
Orochii Zouveleki

Edit: Editado, he puesto ahora entonces el ícono de estado en su lugar (donde creo podría ir xD).


Última edición por orochii el Dom Jul 24, 2011 5:37 pm, editado 2 veces
avatar
orochii
cientifico
cientifico

Talento : Grafista
Mensajes : 401
Engranes : 1498
Reputación : 24
Fecha de inscripción : 04/06/2011
Edad : 26
Localización : Puertas del infierno

Ver perfil de usuario

Volver arriba Ir abajo

Re: Ayuda con un script

Mensaje por serch el Sáb Jul 23, 2011 12:21 pm

oh orochi gracias pero ya lo habia movido, tenia todo movido
solo me falta en donde esta el reloj, la accion de espero qeu no se en donde puedo moverla
¿tu sabras?



Recomendaciones

Visita mi Blog y DeviantArt haciendo click en los banners

serch
Boss
Boss

Talento : Maper
Mensajes : 1998
Engranes : 4908
Reputación : 215
Fecha de inscripción : 27/05/2011
Edad : 24

Ver perfil de usuario

Volver arriba Ir abajo

Re: Ayuda con un script

Mensaje por orochii el Dom Jul 24, 2011 5:36 pm

Edité el mensaje de arriba (si no dice abajo "editado", espera un momento y recarga la página, que seguro es que estoy justo en ello xD). El relojito supongo que te refieres al ícono de acción que se cambia al del arma o skill que se use.
Si es eso, entonces está hecho ;D. Y puse unas líneas en la configuración para que puedas cambiarlo más fácilmente, en caso de que necesites cambiar la posición (yo la puse, pero quizá no te guste como está o no sé xD).

Bueno, eso, salut,
Orochii Zouveleki
avatar
orochii
cientifico
cientifico

Talento : Grafista
Mensajes : 401
Engranes : 1498
Reputación : 24
Fecha de inscripción : 04/06/2011
Edad : 26
Localización : Puertas del infierno

Ver perfil de usuario

Volver arriba Ir abajo

Re: Ayuda con un script

Mensaje por serch el Dom Jul 24, 2011 6:36 pm

gracias orochi
eres el *** amo
te lo agradesco
cierro tema



Recomendaciones

Visita mi Blog y DeviantArt haciendo click en los banners

serch
Boss
Boss

Talento : Maper
Mensajes : 1998
Engranes : 4908
Reputación : 215
Fecha de inscripción : 27/05/2011
Edad : 24

Ver perfil de usuario

Volver arriba Ir abajo

Re: Ayuda con un script

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba

- Temas similares

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