Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Compare States in Equip Window

So what I have done, borrowing a few lines of code from Pholymortis, is made it so that when you hover over an item to equip, the attack/state attack/defense attributes are shown.

So what I want to be able to do is get the attack/state attack/defense of the current selected equipment, compare it to what you have highlighted, and then show you which attributes you would be gaining/losing.

This is my current equip script.

Code:
#==============================================================================
# ** Enhanced Equip Window
#------------------------------------------------------------------------------
#   By Trance
#   Version 1.1
#   January 2nd, 2007 [happy new year!]
#------------------------------------------------------------------------------
#   This script will allow you to easily customize your equip screen.
#   I simply changed the equip screen around, so it should be
#   fully compatable with more or less everything (but not custom
#   menu systems, of course! =P). I have tried to make this as
#   simple and well organized as possible, so even a complete newb
#   (like myself) can understand it. Note, that the default settings
#   make the equip screen look like it was unchanged--however with
#   all stats displayed.
#==============================================================================
#  History
#------------------------------------------------------------------------------
#    1.0
#        - Released.
#    1.1
#        - Fixed a minor bug where the arrow would show up, even if
#        the stat was turned off.
#==============================================================================
#  Customization
#------------------------------------------------------------------------------
#   Okay, this is what you have to change around to create your
#   very own, personalized equipment window!
      $desired_font = "Tahoma"
      $desired_font_size = 16
#   Odvious, hmm? These are the font, and font size.
      $desired_arrow_style = "=>"
#   This is the arrow that will be showing up during equipment
#   changes. You can change it to whatever you want, though
#   other smart choices may be "?", ">>>", or "=>".
      $color_coded_bonuses = true 
#   If this option is set to true, when you are equiping a new item,
#   the arrow pointing to your stat increase will change color 
#   depending on if the stat is going up, down, or staying the same.
#   Note, also that the stat increase also changes color.
      $stat_goes_up_color = Color.new(0, 200, 0)
      $stat_goes_down_color = Color.new(200, 0, 0)
      $stat_stays_the_same_color = Color.new(150, 150, 150)
#   Rather self explanitory. If 'color_coded_bonuses' is off, these
#   color changes do not apply.
      $display_str = [true, 1] # Strength
      $display_dex = [true, 2] # Dexterity
      $display_agi = [true, 3] # Agility
      $display_int = [true, 4] # Intelligence
      $display_atk = [true, 5] # Attack Power
      $display_pdef = [true, 6] # Physical Defense
      $display_mdef = [true, 7] # Magical Defense
#   The settings here that are true will be displayed on the equip
#   screen. The second number is the order in which they will
#   appear. Make sure it is set to '0' if false. Don't make it higher
#   than '7', unless you want a 'crash my game script'. But you odviously
#   wouldn't do this scince there is only seven options.
      $list_start_y_pos = 8 #25
      $seperation_distance = 15 #16
#   This is how far apart the stats that are visible will apear, and
#   how high/low the list will start.
#==============================================================================
class Window_EquipLeft < Window_Base
	attr_accessor :mode
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 64, 272, 192) #192
    self.contents = Bitmap.new(width - 32, height - 0)
    self.contents.font.name = $desired_font  # "Equip" left side (Status) window font
    self.contents.font.size = $desired_font_size
    @actor = actor
		@mode = 0
		@elem_text = ""
    @stat_text = ""
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, -12) #0
    draw_actor_level(@actor, 4, 4) #20
    if $display_str[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_str[1]), 3)
    end
    if $display_dex[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_dex[1]), 4)
    end
    if $display_agi[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_agi[1]), 5)
    end
    if $display_int[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_int[1]), 6)
    end
    if $display_atk[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_atk[1]), 0)
    end
    if $display_pdef[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 1)
    end
    if $display_mdef[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 2)
    end
		
    if @mode == 0
      self.contents.font.color = system_color
			self.contents.draw_text(8, 127, 200, 32, "Elemental Attack:")
			self.contents.draw_text(8, 157, 200, 32, "Status Attack:")
		end
		if @mode == 1	
      self.contents.font.color = system_color
			self.contents.draw_text(8, 127, 200, 32, "Elemental Defense:")
			self.contents.draw_text(8, 156, 200, 32, "Status Defense:")
		end
    self.contents.font.color = $stat_goes_up_color
    self.contents.draw_text(14, 140, 220, 32, @elem_text)
    self.contents.draw_text(14, 169, 220, 32, @stat_text)
  
    if @new_str != nil and $display_str[0] == true
      if $color_coded_bonuses == true
        if @new_str > @actor.str
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        elsif @new_str == @actor.str
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        elsif @new_str < @actor.str
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
    end
  end
    if @new_dex != nil and $display_dex[0] == true
      if $color_coded_bonuses == true
        if @new_dex > @actor.dex
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        elsif @new_dex == @actor.dex
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        elsif @new_dex < @actor.dex
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
    end
  end
    if @new_agi != nil and $display_agi[0] == true
      if $color_coded_bonuses == true
        if @new_agi > @actor.agi
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        elsif @new_agi == @actor.agi
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        elsif @new_agi < @actor.agi
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
    end
  end
    if @new_int != nil and $display_int[0] == true
      if $color_coded_bonuses == true
        if @new_int > @actor.int
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        elsif @new_int == @actor.int
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        elsif @new_int < @actor.int
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
    end
  end
    if @new_atk != nil and $display_atk[0] == true
      if $color_coded_bonuses == true
        if @new_atk > @actor.atk
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        elsif @new_atk == @actor.atk
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        elsif @new_atk < @actor.atk
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
    end
  end
    if @new_pdef != nil and $display_pdef[0] == true
      if $color_coded_bonuses == true
        if @new_pdef > @actor.pdef
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        elsif @new_pdef == @actor.pdef
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        elsif @new_pdef < @actor.pdef
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
    end
  end
    if @new_mdef != nil and $display_mdef[0] == true
      if $color_coded_bonuses == true
        if @new_mdef > @actor.mdef
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        elsif @new_mdef == @actor.mdef
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        elsif @new_mdef < @actor.mdef
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
    end
  end
  end
  #--------------------------------------------------------------------------
  # * Set parameters after changing equipment
  #     new_atk  : attack power after changing equipment
  #     new_pdef : physical defense after changing equipment
  #     new_mdef : magic defense after changing equipment
  #--------------------------------------------------------------------------
  def set_new_parameters(new_str, new_dex, new_agi, new_int, new_atk, new_pdef, new_mdef, elem_text, stat_text)
    if @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int or @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or elem_text != @elem_text or stat_text != @stat_text
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int
      @new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      @elem_text = elem_text
      @stat_text = stat_text
      refresh
    end
  end
end

#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index : actor index
  #     equip_index : equipment index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
    @equip_index = equip_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Get actor
    @actor = $game_party.actors[@actor_index]
    # Make windows
    @help_window = Window_Help.new
    @left_window = Window_EquipLeft.new(@actor)
    @right_window = Window_EquipRight.new(@actor)
    @item_window1 = Window_EquipItem.new(@actor, 0)
    @item_window2 = Window_EquipItem.new(@actor, 1)
    @item_window3 = Window_EquipItem.new(@actor, 2)
    @item_window4 = Window_EquipItem.new(@actor, 3)
    @item_window5 = Window_EquipItem.new(@actor, 4)
    # Associate help window
    @right_window.help_window = @help_window
    @item_window1.help_window = @help_window
    @item_window2.help_window = @help_window
    @item_window3.help_window = @help_window
    @item_window4.help_window = @help_window
    @item_window5.help_window = @help_window
    # Set cursor position
    @right_window.index = @equip_index
    refresh
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @left_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Set item window to visible
    @item_window1.visible = (@right_window.index == 0)
    @item_window2.visible = (@right_window.index == 1)
    @item_window3.visible = (@right_window.index == 2)
    @item_window4.visible = (@right_window.index == 3)
    @item_window5.visible = (@right_window.index == 4)
    # Get currently equipped item
    item1 = @right_window.item
    # Set current item window to @item_window
    case @right_window.index
    when 0
      @item_window = @item_window1
			newmode = 0
    when 1
      @item_window = @item_window2
			newmode = 1
    when 2
      @item_window = @item_window3
			newmode = 1
    when 3
      @item_window = @item_window4
			newmode = 1
    when 4
      @item_window = @item_window5
			newmode = 1
    when 5
      @item_window = @item_window5
			newmode = 1
    when 6
      @item_window = @item_window5
			newmode = 1
    when 7
      @item_window = @item_window5
			newmode = 1
    when 8
      @item_window = @item_window5
			newmode = 1
    end
		if newmode != @left_window.mode
      @left_window.mode = newmode
      @left_window.refresh
    end
    # If right window is active
    if @right_window.active
      # Erase parameters for after equipment change
#==============================================================================
#   CHANGED!
#==============================================================================
      @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, "", "")
#==============================================================================
    end
    # If item window is active
    if @item_window.active
      # Get currently selected item
      item2 = @item_window.item
      # Change equipment
      last_hp = @actor.hp
      last_sp = @actor.sp
      @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
      # Get parameters for after equipment change
#==============================================================================
#   CHANGED!
#==============================================================================
      new_str = @actor.str
      new_dex = @actor.dex
      new_agi = @actor.agi
      new_int = @actor.int
      new_atk = @actor.atk
      new_pdef = @actor.pdef
      new_mdef = @actor.mdef
      elem_text = make_elem_text(item2)
      stat_text = make_stat_text(item2)
#==============================================================================
      # Return equipment
      @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
      @actor.hp = last_hp
      @actor.sp = last_sp
      # Draw in left window
#==============================================================================
#   CHANGED!
#==============================================================================
      @left_window.set_new_parameters(new_str, new_dex, new_agi, new_int, new_atk, new_pdef, new_mdef, elem_text, stat_text)
#==============================================================================
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @left_window.update
    @right_window.update
    @item_window.update
    refresh
    # If right window is active: call update_right
    if @right_window.active
      update_right
      return
    end
    # If item window is active: call update_item
    if @item_window.active
      update_item
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------
  def update_right
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If equipment is fixed
      if @actor.equip_fix?(@right_window.index)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Activate item window
      @right_window.active = false
      @item_window.active = true
      @item_window.index = 0
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different equipment screen
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different equipment screen
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Activate right window
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play equip SE
      $game_system.se_play($data_system.equip_se)
      # Get currently selected data on the item window
      item = @item_window.item
      # Change equipment
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      # Activate right window
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      # Remake right window and item window contents
      @right_window.refresh
      @item_window.refresh
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Get Element of Item
  #--------------------------------------------------------------------------
  def make_elem_text(item)
    text = ""
    flag = false
    if item.is_a?(RPG::Weapon)
      for i in item.element_set
        if flag
          text += ", "
        end
        text += $data_system.elements[i]
        flag = true
      end
    end
    if item.is_a?(RPG::Armor)
      for i in item.guard_element_set
        if flag
          text += ", "
        end
        text += $data_system.elements[i]
        flag = true
      end
    end
    return text
  end
  #--------------------------------------------------------------------------
  # * Get Status of Item
  #--------------------------------------------------------------------------
  def make_stat_text(item)
    text = ""
    flag = false
    if item.is_a?(RPG::Weapon)
      for i in item.plus_state_set
        if flag
          text += ", "
        end
        text += $data_states[i].name
        flag = true
      end
    end
    if item.is_a?(RPG::Armor)
      for i in item.guard_state_set
        if flag
          text += ", "
        end
        text += $data_states[i].name
        flag = true
      end
    end
    return text
  end
  
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top