[XP] Visual Equipment for Blizz-ABS

Started by Blizzard, February 01, 2010, 09:39:36 am

Previous topic - Next topic

Blizzard

February 01, 2010, 09:39:36 am Last Edit: March 23, 2019, 11:36:48 am by Blizzard
Visual Equipment for Blizz-ABS
Authors: Blizzard
Version: 1.1b
Type: Blizz-ABS plugin
Key Term: Blizz-ABS Plugin



Introduction

This script will display equipment on the map. All sprites are placed in the Graphics/Characters folder. Also keep in mind that using this script can cause additional lag due to additional sprite display.

This script is to be distributed under the same terms and conditions like the script it was created for: Blizz-ABS.


Features


  • visual equipment for characters on the map in Blizz-ABS
  • many useful options
  • easy to configure
  • can be disabled globally or for specific characters



Screenshots

N/A for this sort of script.



Demo

N/A


Script

Just make a new script above main and paste this code into it.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Visual Equipment for Blizz-ABS by Blizzard
# Version: 1.1b
# Type: Blizz-ABS Add-on
# Date: 1.2.2010
# Date v1.0b: 29.4.2010
# Date v1.01b: 29.12.2010
# Date v1.1b: 13.6.2011
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and requires Blizz-ABS v2.84 or
#   higher to work properly. It will display equipment on the map. All sprites
#   are placed in the Graphics/Characters folder. Also keep in mind that using
#   this script can cause additional lag due to additional sprite display.
#   
#   
# Configuration:
#   
#   EXCLUDE_WEAPONS - weapons that should not be drawn
#   EXCLUDE_ARMORS  - armors that should not be drawn
#   DRAW_ORDER      - drawing order from first to last sprite (0 for weapon;
#                     1, 2, 3 and 4 for armor kinds) with the direction index
#   PREFIX_WEAPON   - prefix for each spriteset file for weapons (can include
#                     a full path)
#   PREFIX_ARMOR    - prefix for each spriteset file for armors (can include
#                     a full path)
#   ACTOR_UNIQUE    - allows separate equipment files for every single actor
#   
#   
# Notes:
#   
#   - The default file naming convention is:
#     
#       WPREFIX + WID          - weapon files
#       APREFIX + AID          - armor files
#       WPREFIX + WID + SUFFIX - weapon action files
#       APREFIX + AID + SUFFIX - armor action files
#     
#       WPREFIX - by default "Equipment/w", but it can be changed
#       APREFIX - by default "Equipment/a", but it can be changed
#       WID     - weapon ID
#       AID     - armor ID
#       SUFFIX  - action suffix (i.e. _atk1, _skl, etc.)
#     
#     examples:
#       
#       Equipment/w3.png      - weapon ID 3
#       Equipment/a41.png     - armor ID 41
#       Equipment/w1_atk1.png - weapon ID 1, attack type 1
#       Equipment/a76_skl.png - armor ID 1, skill use
#     
#     If you are using the ACTOR_UNIQUE option, then the naming convention are:
#     
#       WPREFIX + BID + SEPARATOR + WID          - weapon files
#       APREFIX + BID + SEPARATOR + AID          - armor files
#       WPREFIX + BID + SEPARATOR + WID + SUFFIX - weapon action files
#       APREFIX + BID + SEPARATOR + AID + SUFFIX - armor action files
#       
#       BID       - actor ID
#       SEPARATOR - the character _ (underscore)
#     
#     examples:
#       
#       Equipment/w4_2.png      - actor ID 4, weapon ID 2
#       Equipment/a1_22.png     - actor ID 1, armor ID 22
#       Equipment/w77_7_def.png - actor ID 77, weapon ID 7, defending
#       Equipment/a3_8_atk5.png - actor ID 3, armor ID 8, attack type 5
#     
#     The default prefixes can be changed in the configuration, but the other
#     parts are fixed.
#     
#   - If you are not using the ACTOR_UNIQUE option and Blizz-ABS's action
#     animation frames other than the default, you have to adjust the action
#     animation frames. In this case all actors will use the same equipment
#     files for display and the files' frame number has to match the animation
#     frames number for every actor which also means that all actors need to
#     have the same number of action sprites for the various actions. i.e. All
#     actors have to have the same number of frames for attack type 1, the same
#     number of frames for attack type 2, the same number of frames for skill
#     use, the same number of frames for defending, etc.
#     
#   - Keep in mind that the dimensions of the spriteset and the equipment
#     sprite should match. i.e. If the actor spriteset is 192x192 pixels, then
#     the equipment for that sprite has to be 192x192 pixels as well. If you
#     have actors that use different spritesets among each other
#     
#   - You can disable / enable Visual Equipment for specific characters by
#     using a Call Script event command with the following code:
#       
#       $game_actors[ID].visual_equipment = true/false
#       $game_party.actors[POS].visual_equipment = true/false
#     
#     ID  - the actor's ID in the database
#     POS - the actor's position in the party (STARTS FROM 0, not 1!)
#     
#   - You can disable / enable Visual Equipment globally by using a Call Script
#     event command with the following code:
#       
#       $game_system.visual_equipment = true/false
#     
#   
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.84
  raise 'ERROR: The "Visual Equipment" plugin requires Blizz-ABS 2.84 or higher.'
end

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG
 
  DRAW_ORDER = {}
  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # START Configuration
  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  EXCLUDE_WEAPONS = [3, 4, 5, 6, 7, 8]
  EXCLUDE_ARMORS = [2, 4, 5, 6, 7]
  DRAW_ORDER[2] = [2, 3, 4, 1, 0]
  DRAW_ORDER[4] = [2, 3, 4, 1, 0]
  DRAW_ORDER[6] = [2, 3, 4, 1, 0]
  DRAW_ORDER[8] = [2, 3, 4, 1, 0]
  PREFIX_WEAPON = 'Equipment/w'
  PREFIX_ARMOR = 'Equipment/a'
  ACTOR_UNIQUE = false
 
  def self.equipment_offset(character_name)
    case character_name
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # START Equipment Sprite Offset
    #   
    #   Here you can define the equipment Y offset in pixels. This can be used
    #   to adjust the equipment sprites' position for smaller or tall
    #   character spritesets. Configure which spritesets have an offset:
    #   
    #     when NAME then return OFFSET
    #   
    #   NAME   - spriteset name
    #   OFFSET - offset in pixels
    #   
    #   Make sure you don't mispell the filenames.
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    when '011-Lancer03' then return -1
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # END Equipment Sprite Offset
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    end
    return 0
  end

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # END Configuration
  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  $blizzabs_visual_equipment = 1.1
 
end

#==============================================================================
# Game_System
#==============================================================================

class Game_System
 
  attr_accessor :visual_equipment
 
  alias init_blizzabsve_later initialize
  def initialize
    init_blizzabsve_later
    @visual_equipment = true
  end
 
end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor

  attr_accessor :visual_equipment
 
  alias init_blizzabsve_later initialize
  def initialize(actor_id)
    init_blizzabsve_later(actor_id)
    @visual_equipment = true
  end
 
  def weapons
    return (self.weapon_ids - BlizzCFG::EXCLUDE_WEAPONS - [0]) if defined?(G7_MS_MOD)
    return ([@weapon_id] - BlizzCFG::EXCLUDE_WEAPONS - [0])
  end
 
  def armors
    return (self.armor_ids - BlizzCFG::EXCLUDE_ARMORS - [0]) if defined?(G7_MS_MOD)
    return ([@armor1_id, @armor2_id, @armor3_id, @armor4_id] -
        BlizzCFG::EXCLUDE_ARMORS - [0])
  end
 
end

#==============================================================================
# Sprite_CharacterEquipment
#==============================================================================

class Sprite_CharacterEquipment < RPG::Sprite
 
  def initialize(viewport, character)
    super(viewport)
    @character = character
    update
  end
 
  def update
    super
    weapons = @character.battler.weapons
    armors = @character.battler.armors
    if @weapons != weapons || @armors != armors ||
        @character_name != @character.character_name
      @weapons = weapons
      @armors = armors
      @character_name = @character.character_name
      self.create_bitmap
      @cw = self.bitmap.width / @character.pattern_size
      @ch = bitmap.height / 4
      self.ox = @cw / 2
      self.oy = @ch
      self.src_rect.x = @character.pattern * @cw
      self.src_rect.width = @cw
    end
    self.visible = !@character.transparent
    sx = @character.pattern * @cw
    sy = (@character.direction - 2) / 2 * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
    self.x = @character.screen_x
    self.y = @character.screen_y
    self.z = @character.screen_z(@ch)
    self.opacity = @character.opacity
    self.blend_type = @character.blend_type
    self.bush_depth = @character.bush_depth
  end
 
  def create_bitmap
    self.bitmap.dispose if self.bitmap != nil
    bitmap = RPG::Cache.character(@character_name, 0)
    self.bitmap = Bitmap.new(bitmap.width, bitmap.height)
    BlizzCFG::DRAW_ORDER.each_key {|dir|
        equipment = []
        a_id = (BlizzCFG::ACTOR_UNIQUE ? "#{@character.battler.id}_" : '')
        BlizzCFG::DRAW_ORDER[dir].each {|index|
            if index == 0
              @weapons.each {|id|
                  equipment.push("#{BlizzCFG::PREFIX_WEAPON}#{a_id}#{id}")}
            else
              @armors.each {|id|
                  if $data_armors[id].kind == index - 1
                    equipment.push("#{BlizzCFG::PREFIX_ARMOR}#{a_id}#{id}")
                  end
              }
            end
        }
        sprite_name = @character.character_name.sub(
            @character.character_name_org) {''}
        y = BlizzCFG.equipment_offset(@character.character_name_org)
        index = dir / 2 - 1
        equipment.each {|name|
            b = RPG::Cache.character("#{name}#{sprite_name}", 0)
            h = b.height / BlizzCFG::DRAW_ORDER.size
            self.bitmap.blt(0, y + index * h, b, Rect.new(0, index * h, b.width, h))
        }
    }
  end
 
end

#==============================================================================
# Control_Sprite_Character
#==============================================================================

class Control_Sprite_Character
 
  alias update_blizzabsve_later update
  def update
    update_blizzabsve_later
    return if !@character.is_a?(Map_Actor)
    if $game_system.visual_equipment && @character.valid? &&
        @character.battler.visual_equipment && @sprite != nil &&
        (@character.battler.weapons.size > 0 ||
        @character.battler.armors.size > 0)
      if @equipment == nil
        @equipment = Sprite_CharacterEquipment.new(@viewport, @character)
      else
        @equipment.update
      end
    elsif @equipment != nil
      @equipment.dispose if !@equipment.disposed?
      @equipment = nil
    end
  end
 
  alias dispose_blizzabsve_later dispose
  def dispose
    dispose_blizzabsve_later
    @equipment.dispose unless @equipment == nil || @equipment.disposed?
    @equipment = nil
  end
 
end



Instructions

In the script in the first comment.


Compatibility

Requires Blizz-ABS to work.


Credits and Thanks


  • Boris "Blizzard" Mikić



Author's Notes

Keep in mind that this plugin comes UNDER Blizz-ABS. This script is not fully supported by me as my other scripts are.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Very nice blizzard! Many have been waiting for this! Thank you *lv's up*

Blizzard

The the irony is that it took almost longer to type down the instructions and the configuration than the script itself. Also, the instructions and the configuration part have more lines than the actual script. #_#

But Blizz-ABS FTW! So easy to make plugins. :3
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade

Oh wow, this is awesome. I haven't had time to play around with it, but I hope there will be a way to use this system with custom poses and the like (for cutscenes). If that's possible, it'll be epic. If not, it'll be like some older 2D games where you're always wearing your default outfit in cutscenes. Either way, awesome addon, thanks blizz.

element

February 01, 2010, 12:02:11 pm #4 Last Edit: February 01, 2010, 02:43:50 pm by elementisland
*Does the happy Dance ^^*
I can complete my game now ! ^^ *Lvl's up*


EDIT : !!!
First error :
Spoiler: ShowHide




wich brings me to this line :


    return if @character.is_a?(Map_Actor) || @character.is_a?(Map_OnlineBattler)

Online battler ? something with Blizz online-system ? quz I'm not using that :S

Blizzard

Ah, shit. ._. That was supposed to be compatibility for RMX-OS later. ._.; I'll remove it for now and add it later.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G


Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Is there anyway you can add this to the draw_actor_graphic?
My guy's naked in the menu D:

element

same with me ^^
Also in the load/save screen my guy's naked :/
not a that good look :p

G_G

Bug. My actual character is behind the tent but his visual equipment armor is above the tent.

Spoiler: ShowHide

Godsigma

wow blizz... Ive been waitin for this.... now that its here i could cry, but i wont. but i will smoke a bowl in honor of its completion!

Blizzard

Smoke a bowl?! O_O Lol.

I fixed the thing that should display it below the tent.
I'll add the draw_character_graphics later.

I can't add it in the save screen because the by default the save file display doesn't even load actor data. It loads only the spriteset filenames.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

element

February 03, 2010, 06:54:33 am #13 Last Edit: February 18, 2010, 03:03:10 pm by elementisland
can i change the load/save thing with editing the default scene ?
and if yes, can someone learn me ? xD

element

 :roll: *hey i'm up there !*

Is it possible, or will it be in later versions, to make the sprite for .. a halmet for example be always the same. so I dant have to have 1 normal sprite, 7 actions, a skill, def and item sprite ?

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

element


DreadWing

My armor 1 sprite fails to show regardless of draw order position. Is the display of the "shield" armor type connected to the defend action, (I have chosen to omit a defend dynamic in my project) or am I missing something here?

Thanks.

Blizzard

Are you sure you configured everything right? There is an EXCLUDE_ARMORS option after all.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

DreadWing

Yeah, everything appears to be configured correctly. The EXCLUDE_ARMORS was left at default, which I believe outlined armors 1-7. None of my custom sprites were affected as I began my list at armor number 30. To be on the safe side, however, I changed it to zero. My draw order is arranged so that the armor_1 slot is drawn directly before the weapon sprite--no change. Armor_1 is simply not drawn if equipped. Damned bizarre.

Script configuration:
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Visual Equipment for Blizz-ABS by Blizzard
# Version: 1.0
# Type: Blizz-ABS Add-on
# Date: 1.2.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and requires Blizz-ABS v2.57 or
#   higher to work properly. It will display equipment on the map. All sprites
#   are placed in the Graphics/Characters folder. Also keep in mind that using
#   this script can cause additional lag due to additional sprite display.
#   
#   
# Configuration:
#   
#   EXCLUDE_WEAPONS - weapons that should not be drawn
#   EXCLUDE_ARMORS  - armors that should not be drawn
#   DRAW_ORDER      - drawing order from first to last sprite (0 for weapon;
#                     1, 2, 3 and 4 for armor kinds)
#   PREFIX_WEAPON   - prefix for each spriteset file for weapons (can include
#                     a full path)
#   PREFIX_ARMOR    - prefix for each spriteset file for armors (can include
#                     a full path)
#   ACTOR_UNIQUE    - allows separate equipment files for every single actor
#   
#   
# Notes:
#   
#   - The default file naming convention is:
#     
#       WPREFIX + WID          - weapon files
#       APREFIX + AID          - armor files
#       WPREFIX + WID + SUFFIX - weapon action files
#       APREFIX + AID + SUFFIX - armor action files
#     
#       WPREFIX - by default "Equipment/w", but it can be changed
#       APREFIX - by default "Equipment/a", but it can be changed
#       WID     - weapon ID
#       AID     - armor ID
#       SUFFIX  - action suffix (i.e. _atk1, _skl, etc.)
#     
#     examples:
#       
#       Equipment/w3.png      - weapon ID 3
#       Equipment/a41.png     - armor ID 41
#       Equipment/w1_atk1.png - weapon ID 1, attack type 1
#       Equipment/a76_skl.png - armor ID 1, skill use
#     
#     If you are using the ACTOR_UNIQUE option, then the naming convention are:
#     
#       WPREFIX + BID + SEPARATOR + WID          - weapon files
#       APREFIX + BID + SEPARATOR + AID          - armor files
#       WPREFIX + BID + SEPARATOR + WID + SUFFIX - weapon action files
#       APREFIX + BID + SEPARATOR + AID + SUFFIX - armor action files
#       
#       BID       - actor ID
#       SEPARATOR - the character _ (underscore)
#     
#     examples:
#       
#       Equipment/w4_2.png      - actor ID 4, weapon ID 2
#       Equipment/a1_22.png     - actor ID 1, armor ID 22
#       Equipment/w77_7_def.png - actor ID 77, weapon ID 7, defending
#       Equipment/a3_8_atk5.png - actor ID 3, armor ID 8, attack type 5
#     
#     The default prefixes can be changed in the configuration, but the other
#     parts are fixed.
#     
#   - If you are not using the ACTOR_UNIQUE option and Blizz-ABS's action
#     animation frames other than the default, you have to adjust the action
#     animation frames. In this case all actors will use the same equipment
#     files for display and the files' frame number has to match the animation
#     frames number for every actor which also means that all actors need to
#     have the same number of action sprites for the various actions. i.e. All
#     actors have to have the same number of frames for attack type 1, the same
#     number of frames for attack type 2, the same number of frames for skill
#     use, the same number of frames for defending, etc.
#     
#   - Keep in mind that the dimensions of the spriteset and the equipment
#     sprite should match. i.e. If the actor spriteset is 192x192 pixels, then
#     the equipment for that sprite has to be 192x192 pixels as well. If you
#     have actors that use different spritesets among each other
#     
#   - You can disable / enable Visual Equipment for specific characters by
#     using a Call Script event command with the following code:
#       
#       $game_actors[ID].visual_equipment = true/false
#       $game_party.actors[POS].visual_equipment = true/false
#     
#     ID  - the actor's ID in the database
#     POS - the actor's position in the party (STARTS FROM 0, not 1!)
#     
#   - You can disable / enable Visual Equipment globally by using a Call Script
#     event command with the following code:
#       
#       $game_system.visual_equipment = true/false
#     
#   
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.57
  raise 'ERROR: The "Visual Equipment" plugin requires Blizz-ABS 2.57 or higher.'
end

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG
 
  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # START Configuration
  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  EXCLUDE_WEAPONS = [1, 3, 4, 5, 6, 7, 8]
  EXCLUDE_ARMORS =

  •   DRAW_ORDER = [4, 2, 3, 1, 0]
      PREFIX_WEAPON = 'Equipment/w'
      PREFIX_ARMOR = 'Equipment/a'
      ACTOR_UNIQUE = false
     
      def self.equipment_offset(character_name)
        case character_name
        #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        # START Equipment Sprite Offset
        #   
        #   Here you can define the equipment Y offset in pixels. This can be used
        #   to adjust the equipment sprites' position for smaller or tall
        #   character spritesets. Configure which spritesets have an offset:
        #   
        #     when NAME then return OFFSET
        #   
        #   NAME   - spriteset name
        #   OFFSET - offset in pixels
        #   
        #   Make sure you don't mispell the filenames.
        #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        when '011-Lancer03' then return -1
        #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        # END Equipment Sprite Offset
        #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        end
        return 0
      end

      #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
      # END Configuration
      #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     
      $blizzabs_visual_equipment = 1.0
     
    end

    #==============================================================================
    # Game_System
    #==============================================================================

    class Game_System
     
      attr_accessor :visual_equipment
     
      alias init_blizzabsve_later initialize
      def initialize
        init_blizzabsve_later
        @visual_equipment = true
      end
     
    end

    #==============================================================================
    # Game_Actor
    #==============================================================================

    class Game_Actor

      attr_accessor :visual_equipment
     
      alias init_blizzabsve_later initialize
      def initialize(actor_id)
        init_blizzabsve_later(actor_id)
        @visual_equipment = true
      end
     
      def weapons
        return (self.weapon_ids - BlizzCFG::EXCLUDE_WEAPONS -
  • ) if defined?(G7_MS_MOD)
        return ([@weapon_id] - BlizzCFG::EXCLUDE_WEAPONS -
  • )
      end
     
      def armors
        return (self.armor_ids - BlizzCFG::EXCLUDE_ARMORS -
  • ) if defined?(G7_MS_MOD)
        return ([@armor1_id, @armor2_id, @armor3_id, @armor4_id] -
            BlizzCFG::EXCLUDE_ARMORS -
  • )
      end
     
    end

    #==============================================================================
    # Sprite_CharacterEquipment
    #==============================================================================

    class Sprite_CharacterEquipment < RPG::Sprite
     
      def initialize(viewport, character)
        super(viewport)
        @character = character
        update
      end
     
      def update
        super
        weapons = @character.battler.weapons
        armors = @character.battler.armors
        if @weapons != weapons || @armors != armors ||
            @character_name != @character.character_name
          @weapons = weapons
          @armors = armors
          @character_name = @character.character_name
          self.create_bitmap
          @cw = self.bitmap.width / @character.pattern_size
          @ch = bitmap.height / 4
          self.ox = @cw / 2
          self.oy = @ch
          self.src_rect.x = @character.pattern * @cw
          self.src_rect.width = @cw
        end
        self.visible = !@character.transparent
        sx = @character.pattern * @cw
        sy = (@character.direction - 2) / 2 * @ch
        self.src_rect.set(sx, sy, @cw, @ch)
        self.x = @character.screen_x
        self.y = @character.screen_y
        self.z = @character.screen_z(@ch)
        self.opacity = @character.opacity
        self.blend_type = @character.blend_type
        self.bush_depth = @character.bush_depth
      end
     
      def create_bitmap
        self.bitmap.dispose if self.bitmap != nil
        bitmap = RPG::Cache.character(@character_name, 0)
        self.bitmap = Bitmap.new(bitmap.width, bitmap.height)
        equipment = []
        a_id = (BlizzCFG::ACTOR_UNIQUE ? "#{@character.battler.id}_" : '')
        BlizzCFG::DRAW_ORDER.each {|index|
            if index == 0
              @weapons.each {|id|
                  equipment.push("#{BlizzCFG::PREFIX_WEAPON}#{a_id}#{id}")}
            else
              @armors.each {|id|
                  if $data_armors[id].kind == index
                    equipment.push("#{BlizzCFG::PREFIX_ARMOR}#{a_id}#{id}")
                  end}
            end}
        sprite_name = @character.character_name.sub(
            @character.character_name_org) {''}
        y = BlizzCFG.equipment_offset(@character.character_name_org)
        equipment.each {|name|
            b = RPG::Cache.character("#{name}#{sprite_name}", 0)
            self.bitmap.blt(0, y, b, Rect.new(0, 0, b.width, b.height))}
      end
     
    end

    #==============================================================================
    # Control_Sprite_Character
    #==============================================================================

    class Control_Sprite_Character
     
      alias update_blizzabsve_later update
      def update
        update_blizzabsve_later
        return if !@character.is_a?(Map_Actor)
        if $game_system.visual_equipment && @character.valid? &&
            @character.battler.visual_equipment && @sprite != nil &&
            (@character.battler.weapons.size > 0 ||
            @character.battler.armors.size > 0)
          if @equipment == nil
            @equipment = Sprite_CharacterEquipment.new(@viewport, @character)
          else
            @equipment.update
          end
        elsif @equipment != nil
          @equipment.dispose if !@equipment.disposed?
          @equipment = nil
        end
      end
     
      alias dispose_blizzabsve_later dispose
      def dispose
        dispose_blizzabsve_later
        @equipment.dispose unless @equipment == nil || @equipment.disposed?
        @equipment = nil
      end
     
    end