장비

Rei(레이)의 Paperdoll(비쥬얼 장비)스크립트

by 루시페르 posted Jul 29, 2009
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

드디어 이 스크립트를 올려보는군요.

모바일 게임 "영웅서기"나 여러 알피지 게임의 묘미, 하면 아이템과 캐릭터의 모습이죠...(아닌가?)

하여튼, 알만툴을 이용해서  장비 착용시 캐릭터 모습의 변화를 적용시키는 것은 상당히 애먹는 작업임에 틀림이 없습니다.

(이벤트를 이용해 만들 수는 있지만...... 깨지지않는 절대노가다죠... 

이 스크립트는 레이라는 분이 만든 비쥬얼 장비 스크립트인데요....

굉장히 유용하더군요. 캐릭터의 모습을 굉장히 쉽게 바꾸어주는 스크립트입니다.

하지만 유일한 단점이라고 말하자면....

1) 갑옷부분과 투구 부분등을 따로 따로 구해야 합니다..

예) 갑옷만 돌아다니는 캐릭터 자료.

      투구만 돌아다니는 캐릭터자료.

구하기 쉽지않죠.... 하지만 쓰실 분은 써주세요.

저는 저만의 방법대로 캐릭터 자료를 구해서 유용히 쓰고 있답니다아.

사용법:

이 스크립트를 보시면

ENARMR = true # Enables visual armor sprite?
    ENHELM = true # Enables visual helmet sprite?
    ENSHLD = true # Enables visual shield sprite?
    ENACCS = false # Enables visual accessory sprite?
    ENWEAP = false # Enables visual weapon sprite?

이런 부분이 있는데요, false로 설정을 하면 그 장비에 해당하는 그래픽을 사용하지 않는다는 뜻입니다.

예) ENSHLD = true # Enables visual shield sprite? 즉, 장비중 방패를 바꿀 경우에 그것에 대해서 캐릭터 그래픽을 변경하지 않는다.

그 다음

ARMORS = {
    19 => "$회갑옷",  # Armor's ID => Charset name
    } # << Don't delete this.

이 부분은 방어구를 꼈을 시의 캐릭터 그래픽(덧씌워지는 그래픽)의 설정입니다.

이 부분은 갑옷의 설정부분인데요. 맨 처음부분의 숫자는 장비의 ID번호, 큰따옴표 안의 것은 덧씌워지는 그래픽의 이름입니다.

꼭 참고하시구요.

장비의 종류는 5종류로 설정되어있습니다.(검, 방패, 갑옷, 투구, 장신구)

이 5가지에 한해서만 비쥬얼 장비를 적용 시킬 수 있습니다. (장비종류 추가 스크립트와 병용이 안된다는 뜻입니다.)

 

아래서부터 복사하세요.

#===============================================================================
# † [VX] † Rei Paperdoll † †
# † Enables visible equipments on a character †
#-------------------------------------------------------------------------------
# † by reijubv [aruyasoft@comic.com]
# † Inspired by Ramiazul's paperdoll wich was translated by LoMastul
# † RPG RPG Revolution
# † Released on: 22/05/2009
# † Version: 2.0 (June 16th 2009)
#-------------------------------------------------------------------------------
# > Changelog:
#   V.1.0 (22-05-09) = Initial release
#   V.1.1 (24-05-09) = >Fixed a bug with accessory sprite
#                      >Added compatibility with my actor resize script
#   V.1.2 (29-05-09) = >Added weapon sprite
#   V.2.0 (16-06-09) = >Improved performance
#                      >Rewrited some part of the script
#                      >Compatible with default and Kaduki Takentai SBS
#-------------------------------------------------------------------------------
# This script is the same as Ramiazul's Paperdoll script, but this script
# enables more than just an armor that can be visible on player.
# With this, events may also have visual equipments.
#
# Note : Because some parts of this script was rewrited, past version users
#        may need to change a few configuration settings.
#        Rei Size Changer has no effect inside battle
#-------------------------------------------------------------------------------
# How to use :
# For player : Just change the equipments, with the ones wich Ids specified below
# For events : First, write reipap (can be changed) in event's comment to enable
#              visual equipments in that event.
#              Second, adds one of these to event's comments :
#              ( Must be placed in one line OR in new comment )
#              [rpa#] < To change event's visual armor to Id #
#              [rph#] < To change event's visual helmet to Id #
#              [rps#] < To change event's visual shield to Id #
#              [rpc#] < To change event's visual accessory to Id #
#              [rpw#] < To change event's visual weapon to Id #
# Just see examples inside the demo!
#-------------------------------------------------------------------------------
# Credits:
# Ramiazul for the original Paperdoll script.
# Reijubv for making this script.
#-------------------------------------------------------------------------------
# ? Installation:
# Put this script above main, setup script below on Rei module
#-------------------------------------------------------------------------------
# Compatibility :
#                * Rewrites    : Sprite_Battler.mirage (if using Takentai)
#                * Aliases     : Game_Event.initialize
#                                Sprite_Character.dispose
#                                Sprite_Character.update
#
#===============================================================================
$imported = {} if $imported == nil
$imported["Rei_"+"Paperdolls"] = true
#---------------------------------------------------------------------------
# ** Rei Module
#---------------------------------------------------------------------------
module Rei
  module Paperdolls
    ENARMR = true # Enables visual armor sprite?
    ENHELM = true # Enables visual helmet sprite?
    ENSHLD = false # Enables visual shield sprite?
    ENACCS = false # Enables visual accessory sprite?
    ENWEAP = false # Enables visual weapon sprite?
   
    PAPACT = "reipap" # Only event that have this comment that can use visual
                      # Equipments
   
    ARMORS = {
    19 => "",  # Armor's ID => Charset name

    } # << Don't delete ths!
   
    HELMETS = {
    7 => "",  # Helmet's ID => Charset name

    } # << Don't delete this!
   
    SHIELDS = {
    # Shield's ID => Charset name
   
    } # << Don't delete this!
   
    ACC = {
    # Accessory's ID => Charset name
   
   
    } # << Don't delete this!
   

    # V.1.2

    WEAPONS = {
    # Weapon's Id => Charset name
   
    }
   
   
    # V.2.0
   
    TAKENTAI = false       # Are you using takentai sbs?
  end
end

#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================
class Game_Event < Game_Character
  attr_accessor :weapon
  attr_accessor :armor
  attr_accessor :helmet
  attr_accessor :acc
  attr_accessor :shield
  attr_accessor :reieqarr
  alias reipapinit initialize unless method_defined?('reipapinit')
   def initialize(map_id, event)
    @weapon = 0
    @armor = 0
    @helmet = 0
    @acc = 0
    @shield = 0
    @reieqarr  = [0,0,0,0] #event's default armor,helmet,shield,accessory
    geteventequipments
    reipapinit(map_id, event)
  end
    #---------------------------------------------------------------------------
    # * get event's visual equipments
    #---------------------------------------------------------------------------
  def geteventequipments
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list[i].code != 108
        if @list[i].parameters[0].include?("[rpa")
          list = @list[i].parameters[0].scan(/[rpa([0-9]+)]/)
          @armor = $1.to_i
        end
        if @list[i].parameters[0].include?("[rph")
          list = @list[i].parameters[0].scan(/[rph([0-9]+)]/)
          @helmet = $1.to_i
        end
        if @list[i].parameters[0].include?("[rpc")
          list = @list[i].parameters[0].scan(/[rpc([0-9]+)]/)
          @acc = $1.to_i
        end
        if @list[i].parameters[0].include?("[rps")
          list = @list[i].parameters[0].scan(/[rps([0-9]+)]/)
          @shield = $1.to_i
        end
        if @list[i].parameters[0].include?("[rpw")
          list = @list[i].parameters[0].scan(/[rpw([0-9]+)]/)
          @weapon = $1.to_i
        end
      end
      @reieqarr = [@armor,@helmet,@shield,@acc,@weapon]
      return @reieqarr
    end
  end
    #---------------------------------------------------------------------------
    # * check if event has a specified comment
    #---------------------------------------------------------------------------
  def has_comment?(comment, return_comment = false )
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list[i].code != 108
          if @list[i].parameters[0].include?(comment)
            return @list[i].parameters[0] if return_comment
            return true
          end
      end
      return '' if return_comment
      return false
    end
  end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character < Sprite_Base
  alias reiinitforpaperdoll initialize unless method_defined?('reiinitforpaperdoll')
  def initialize(viewport, character = nil)
    reiinitforpaperdoll(viewport, character)
  end
   #----------------------------------------------------------------------------
   # Script settings for easier use..
   #----------------------------------------------------------------------------
  def setpaperdollsthings(what)
    case what
    when 0 # armor
      @armor.x, @armor.y, @armor.z  = self.x, self.y, self.z + 1
      @armor.ox, @armor.oy = self.ox, self.oy
      @armor.src_rect, @armor.visible, @armor.opacity = self.src_rect, self.visible, self.opacity
    when 1 # helmet
      @helmet.x, @helmet.y, @helmet.z  = self.x, self.y, self.z + 1
      @helmet.ox, @helmet.oy = self.ox, self.oy
      @helmet.src_rect, @helmet.visible, @helmet.opacity = self.src_rect, self.visible, self.opacity
    when 2 # shield
      @shield.x, @shield.y, @shield.z  = self.x, self.y, self.z + 1
      @shield.ox, @shield.oy = self.ox, self.oy
      @shield.src_rect, @shield.visible, @shield.opacity = self.src_rect, self.visible, self.opacity
    when 3 # accessory
      @acc.x, @acc.y, @acc.z  = self.x, self.y, self.z + 1
      @acc.ox, @acc.oy = self.ox, self.oy
      @acc.src_rect, @acc.visible, @acc.opacity = self.src_rect, self.visible, self.opacity
    when 4 # weapon
      @weapon.x, @weapon.y, @weapon.z  = self.x, self.y, self.z + 1
      @weapon.ox, @weapon.oy = self.ox, self.oy
      @weapon.src_rect, @weapon.visible, @weapon.opacity = self.src_rect, self.visible, self.opacity
    end
  end
   #----------------------------------------------------------------------------
   # Determine who use visual equipments other than player and event
   #----------------------------------------------------------------------------
  def what_else?
    return @character.is_a?(Game_Follower) if Rei::Paperdolls::TRCKCATERPILLAR
    return @character.is_a?(Game_WCateracter) if Rei::Paperdolls::WORACATERPILLAR
    return @character.is_a?(Game_Pet) if Rei::Paperdolls::ORWJCATERPILLAR
    return false
  end
   #----------------------------------------------------------------------------
   # Update equipments sprite!
   #----------------------------------------------------------------------------
  def update_equipments
    setpaperdollsthings(0) if @armor
    setpaperdollsthings(1) if @helmet
    setpaperdollsthings(2) if @shield
    setpaperdollsthings(3) if @acc
    setpaperdollsthings(4) if @weapon
   #----------------------------------------------------------------------------
   # For player sprite
   #----------------------------------------------------------------------------
   if @character.is_a?(Game_Player) and self.visible
   #----------------------------------------------------------------------------
   # Player armor sprite
   #----------------------------------------------------------------------------
     if Rei::Paperdolls::ENARMR
      if @armorid !=  $game_party.members[0].armor3_id
       @armorid =  $game_party.members[0].armor3_id
        if Rei::Paperdolls::ARMORS.include?(@armorid)
          @armor.dispose if @armor
          @armor = Sprite.new(self.viewport)
          @armor.bitmap = Cache.character(Rei::Paperdolls::ARMORS[@armorid])
          setpaperdollsthings(0)
        end
      end
     end
   #----------------------------------------------------------------------------
   # Player helmet sprite
   #----------------------------------------------------------------------------
     if Rei::Paperdolls::ENHELM
      if @helmid !=  $game_party.members[0].armor2_id
       @helmid =  $game_party.members[0].armor2_id
        if Rei::Paperdolls::HELMETS.include?(@helmid)
          @helmet.dispose if @helmet
          @helmet = Sprite.new(self.viewport)
          @helmet.bitmap = Cache.character(Rei::Paperdolls::HELMETS[@helmid])
          setpaperdollsthings(1)
        end
      end
     end
   #----------------------------------------------------------------------------
   # Player shield sprite
   #----------------------------------------------------------------------------
     if Rei::Paperdolls::ENSHLD
      if @shldid !=  $game_party.members[0].armor1_id
       @shldid =  $game_party.members[0].armor1_id
        if Rei::Paperdolls::SHIELDS.include?(@shldid)
          @shield.dispose if @shield
          @shield = Sprite.new(self.viewport)
          @shield.bitmap = Cache.character(Rei::Paperdolls::SHIELDS[@shldid])
          setpaperdollsthings(2)
        end
      end
     end
   #----------------------------------------------------------------------------
   # Player accessory sprite
   #----------------------------------------------------------------------------
    if Rei::Paperdolls::ENACCS
      if @accid !=  $game_party.members[0].armor4_id
       @accid =  $game_party.members[0].armor4_id
        if Rei::Paperdolls::ACC.include?(@accid)
          @acc.dispose if @acc
          @acc = Sprite.new(self.viewport)
          @acc.bitmap = Cache.character(Rei::Paperdolls::ACC[@accid])
          setpaperdollsthings(3)
        end
      end   
    end
   #----------------------------------------------------------------------------
   # Player weapon sprite
   #----------------------------------------------------------------------------
    if Rei::Paperdolls::ENWEAP
      if @weapid !=  $game_party.members[0].weapon_id
       @weapid =  $game_party.members[0].weapon_id
        if Rei::Paperdolls::WEAPONS.include?(@weapid)
          @weapon.dispose if @weapon
          @weapon = Sprite.new(self.viewport)
          @weapon.bitmap = Cache.character(Rei::Paperdolls::WEAPONS[@weapid])
          setpaperdollsthings(4)
        end
      end   
    end
   #----------------------------------------------------------------------------
   # For event sprite
   #----------------------------------------------------------------------------
   elsif @character.is_a?(Game_Event) and self.visible and
     @character.has_comment?(Rei::Paperdolls::PAPACT)
   #----------------------------------------------------------------------------
   # Event armor sprite
   #----------------------------------------------------------------------------
     if Rei::Paperdolls::ENARMR
      if @armorid != @character.geteventequipments[0]
       @armorid = @character.geteventequipments[0]
        if Rei::Paperdolls::ARMORS.include?(@armorid) and @armorid !=0
          @armor.dispose if @armor
          @armor = Sprite.new(self.viewport)
          @armor.bitmap = Cache.character(Rei::Paperdolls::ARMORS[@armorid])
          setpaperdollsthings(0)
        end
      end
     end
   #----------------------------------------------------------------------------
   # Event helmet sprite
   #----------------------------------------------------------------------------
     if Rei::Paperdolls::ENHELM
      if @helmid != @character.geteventequipments[1]
       @helmid = @character.geteventequipments[1]
        if Rei::Paperdolls::HELMETS.include?(@helmid) and @helmid !=0
          @helmet.dispose if @helmet
          @helmet = Sprite.new(self.viewport)
          @helmet.bitmap = Cache.character(Rei::Paperdolls::HELMETS[@helmid])
          setpaperdollsthings(1)
        end
      end
     end
   #----------------------------------------------------------------------------
   # Event shield sprite
   #----------------------------------------------------------------------------
     if Rei::Paperdolls::ENSHLD
      if @shldid != @character.geteventequipments[2]
       @shldid = @character.geteventequipments[2]
        if Rei::Paperdolls::SHIELDS.include?(@shldid) and @shldid !=0
          @shield.dispose if @shield
          @shield = Sprite.new(self.viewport)
          @shield.bitmap = Cache.character(Rei::Paperdolls::SHIELDS[@shldid])
          setpaperdollsthings(2)
        end
      end
     end
   #----------------------------------------------------------------------------
   # Event accessory sprite
   #----------------------------------------------------------------------------
    if Rei::Paperdolls::ENACCS
      if @accid != @character.geteventequipments[3]
       @accid = @character.geteventequipments[3]
        if Rei::Paperdolls::ACC.include?(@accid) and @accid !=0
          @acc.dispose if @acc
          @acc = Sprite.new(self.viewport)
          @acc.bitmap = Cache.character(Rei::Paperdolls::ACC[@accid])
          setpaperdollsthings(3)
        end
      end
    end
   #----------------------------------------------------------------------------
   # Event weapon sprite
   #----------------------------------------------------------------------------
    if Rei::Paperdolls::ENWEAP
      if @weapid != @character.geteventequipments[4]
       @weapid = @character.geteventequipments[4]
        if Rei::Paperdolls::WEAPONS.include?(@weapid) and @weapid !=0
          @weapon.dispose if @weapon
          @weapon = Sprite.new(self.viewport)
          @weapon.bitmap = Cache.character(Rei::Paperdolls::WEAPONS[@weapid])
          setpaperdollsthings(4)
        end
      end
    end
   end
  end # update_equipments end here
  def disposepaperdollthings
    @armor.dispose if @armor
    @helmet.dispose if @helmet
    @acc.dispose if @acc
    @shield.dispose if @shield
    @weapon.dispose if @weapon
  end
  alias reipaperdolldispose dispose unless method_defined?('reipaperdolldispose')
  def dispose
    disposepaperdollthings
    reipaperdolldispose
  end
  alias reipaperdollupdate update unless method_defined?('reipaperdollupdate')
  def update
    reipaperdollupdate
    update_equipments if self.bitmap
    @weapon.visible = self.visible if @weapon
    @acc.visible = self.visible if @acc
    @helmet.visible = self.visible if @helmet
    @armor.visible = self.visible if @armor
    @shield.visible = self.visible if @shield
    if $imported["Rei_"+"ZoomActor"]
      if @character.is_a?(Game_Player) and $game_switches[Rei::ZoomActor::FLAG]
        @armor.zoom_x = Rei::ZoomActor::ZOOMX if @armor
        @helmet.zoom_x = Rei::ZoomActor::ZOOMX if @helmet
        @acc.zoom_x = Rei::ZoomActor::ZOOMX if @acc
        @shield.zoom_x = Rei::ZoomActor::ZOOMX if @shield
        @weapon.zoom_x = Rei::ZoomActor::ZOOMX if @weapon
        @armor.zoom_y = Rei::ZoomActor::ZOOMY if @armor
        @helmet.zoom_y = Rei::ZoomActor::ZOOMY if @helmet
        @acc.zoom_y = Rei::ZoomActor::ZOOMY if @acc
        @shield.zoom_y = Rei::ZoomActor::ZOOMY if @shield
        @weapon.zoom_y = Rei::ZoomActor::ZOOMY if @weapon
      elsif @character.is_a?(Game_Event) and $game_switches[Rei::ZoomActor::EFLAG] and @character.has_comment?(Rei::ZoomActor::ECOMM)
        if @character.has_comment?("[rsvx")
          @armor.zoom_x = Rei::ZoomActor::ARR[@character.getsizeindex[0]] if @armor
          @helmet.zoom_x = Rei::ZoomActor::ARR[@character.getsizeindex[0]] if @helmet
          @acc.zoom_x = Rei::ZoomActor::ARR[@character.getsizeindex[0]] if @acc
          @shield.zoom_x = Rei::ZoomActor::ARR[@character.getsizeindex[0]] if @shield
          @weapon.zoom_x = Rei::ZoomActor::ARR[@character.getsizeindex[0]] if @weapon
        else
          @armor.zoom_x = Rei::ZoomActor::EZUMX if @armor
          @helmet.zoom_x = Rei::ZoomActor::EZUMX if @helmet
          @acc.zoom_x = Rei::ZoomActor::EZUMX if @acc
          @shield.zoom_x = Rei::ZoomActor::EZUMX if @shield
          @weapon.zoom_x = Rei::ZoomActor::EZUMX if @weapon
        end
        if @character.has_comment?("[rsvy")
          @armor.zoom_y = Rei::ZoomActor::ARR[@character.getsizeindex[1]] if @armor
          @helmet.zoom_y = Rei::ZoomActor::ARR[@character.getsizeindex[1]] if @helmet
          @acc.zoom_y = Rei::ZoomActor::ARR[@character.getsizeindex[1]] if @acc
          @shield.zoom_y = Rei::ZoomActor::ARR[@character.getsizeindex[1]] if @shield
          @weapon.zoom_y = Rei::ZoomActor::ARR[@character.getsizeindex[1]] if @weapon
        else
          @armor.zoom_y = Rei::ZoomActor::EZUMY if @armor
          @helmet.zoom_y = Rei::ZoomActor::EZUMY if @helmet
          @acc.zoom_y = Rei::ZoomActor::EZUMY if @acc
          @shield.zoom_y = Rei::ZoomActor::EZUMY if @shield
          @weapon.zoom_x = Rei::ZoomActor::EZUMY if @weapon
        end
      end
    end
  end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  This sprite is used to display battlers. It observes a instance of the
# Game_Battler class and automatically changes sprite conditions.
#==============================================================================
if Rei::Paperdolls::TAKENTAI
class Sprite_Battler < Sprite_Base
   #----------------------------------------------------------------------------
   # Script settings for easier use..
   #----------------------------------------------------------------------------
  def setpaperdollsthings(what)
    case what
    when 0 # armor
      @armor.x, @armor.y, @armor.z  = self.x, self.y, self.z + 1
      @armor.ox, @armor.oy = self.ox, self.oy
      @armor.src_rect, @armor.opacity = self.src_rect, self.opacity
    when 1 # helmet
      @helmet.x, @helmet.y, @helmet.z  = self.x, self.y, self.z + 1
      @helmet.ox, @helmet.oy = self.ox, self.oy
      @helmet.src_rect, @helmet.opacity = self.src_rect, self.opacity
    when 2 # shield
      @shield.x, @shield.y, @shield.z  = self.x, self.y, self.z + 1
      @shield.ox, @shield.oy = self.ox, self.oy
      @shield.src_rect, @shield.opacity = self.src_rect, self.opacity
    when 3 # accessory
      @acc.x, @acc.y, @acc.z  = self.x, self.y, self.z + 1
      @acc.ox, @acc.oy = self.ox, self.oy
      @acc.src_rect, @acc.opacity = self.src_rect, self.opacity
    when 4 # weapon
      @weapon.x, @weapon.y, @weapon.z  = self.x, self.y, self.z + 1
      @weapon.ox, @weapon.oy = self.ox, self.oy
      @weapon.src_rect, @weapon.opacity = self.src_rect, self.opacity
    end
  end
  def update_equipments_sprite
    setpaperdollsthings(0) if @armor
    setpaperdollsthings(1) if @helmet
    setpaperdollsthings(2) if @acc
    setpaperdollsthings(3) if @shield
    setpaperdollsthings(4) if @weapon
    @lastacacc = "yy" if @lastacacc == nil
    if @battler.is_a?(Game_Actor) and @active_action and @active_action[0].is_a?(Numeric)
    #---------------------------------------------------------------------------
    # Player armor sprite
    #---------------------------------------------------------------------------
      if Rei::Paperdolls::ENARMR
        if @armorid !=  @battler.armor3_id or @lastacacc != @active_action[0]
          @armorid =  @battler.armor3_id
          @lastacacc = @active_action[0]
          if  Rei::Paperdolls::ARMORS.include?(@armorid)
            opix = self.bitmap.get_pixel(0,0)
            @armor.dispose if @armor
            @armor = Sprite.new(self.viewport)
            if @active_action[0] == 0
              bmp = Cache.character(Rei::Paperdolls::ARMORS[@armorid])
            else
              bmp = Cache.character(Rei::Paperdolls::ARMORS[@armorid]+"_"+@active_action[0].to_s)
            end
            @armor.bitmap = bmp
            setpaperdollsthings(0)
          end
        end
      end
    #---------------------------------------------------------------------------
    # Player helmet sprite
    #---------------------------------------------------------------------------
      if Rei::Paperdolls::ENHELM
        if @helmid !=  @battler.armor2_id or @lastacacc != @active_action[0]
          @helmid =  @battler.armor2_id
          @lastacacc = @active_action[0]
          if  Rei::Paperdolls::HELMETS.include?(@helmid)
            opix = self.bitmap.get_pixel(0,0)
            @helmet.dispose if @helmet
            @helmet = Sprite.new(self.viewport)
            if @active_action[0] == 0
              bmp = Cache.character(Rei::Paperdolls::HELMETS[@helmid])
            else
              bmp = Cache.character(Rei::Paperdolls::HELMETS[@helmid]+"_"+@active_action[0].to_s)
            end
            @helmet.bitmap = bmp
            setpaperdollsthings(1)
          end
        end
      end
    #---------------------------------------------------------------------------
    # Player shield sprite
    #---------------------------------------------------------------------------
      if Rei::Paperdolls::ENSHLD
        if @shldid !=  @battler.armor1_id or @lastacacc != @active_action[0]
          @shldid =  @battler.armor1_id
          @lastacacc = @active_action[0]
          if  Rei::Paperdolls::HELMETS.include?(@shldid)
            opix = self.bitmap.get_pixel(0,0)
            @shield.dispose if @shield
            @shield = Sprite.new(self.viewport)
            if @active_action[0] == 0
              bmp = Cache.character(Rei::Paperdolls::SHIELDS[@shldid])
            else
              bmp = Cache.character(Rei::Paperdolls::SHIELDS[@shldid]+"_"+@active_action[0].to_s)
            end
            @shield.bitmap = bmp
            setpaperdollsthings(2)
          end
        end
      end
    #---------------------------------------------------------------------------
    # Player accessory sprite
    #---------------------------------------------------------------------------
      if Rei::Paperdolls::ENACCS
        if @accid !=  @battler.armor4_id or @lastacacc != @active_action[0]
          @accid =  @battler.armor4_id
          @lastacacc = @active_action[0]
          if  Rei::Paperdolls::ACC.include?(@accid)
            opix = self.bitmap.get_pixel(0,0)
            @acc.dispose if @acc
            @acc = Sprite.new(self.viewport)
            if @active_action[0] == 0
              bmp = Cache.character(Rei::Paperdolls::ACC[@accid])
            else
              bmp = Cache.character(Rei::Paperdolls::ACC[@accid]+"_"+@active_action[0].to_s)
            end
            @acc.bitmap = bmp
            setpaperdollsthings(3)
          end
        end
      end
    #---------------------------------------------------------------------------
    # Player weapon sprite
    #---------------------------------------------------------------------------
      if Rei::Paperdolls::ENWEAP
        if @weapid !=  @battler.weapon_id or @lastacacc != @active_action[0]
          @weapid =  @battler.weapon_id
          @lastacacc = @active_action[0]
          if  Rei::Paperdolls::ACC.include?(@weapid)
            opix = self.bitmap.get_pixel(0,0)
            @weapon.dispose if @acc
            @weapon = Sprite.new(self.viewport)
            if @active_action[0] == 0
              bmp = Cache.character(Rei::Paperdolls::WEAPONS[@weapid])
            else
              bmp = Cache.character(Rei::Paperdolls::WEAPONS[@weapid]+"_"+@active_action[0].to_s)
            end
            @weapon.bitmap = bmp
            setpaperdollsthings(4)
          end
        end
      end
    end
  end
  alias reipaptankentaiupd update unless method_defined?('reipaptankentaiupd')
  def update
    reipaptankentaiupd
    update_equipments_sprite
  end
  def mirage(body)
    body.bitmap = self.bitmap.dup
    body.x = self.x
    body.y = self.y
    body.ox = self.ox
    body.oy = self.oy
    body.z = self.z - 10
    body.mirror = self.mirror
    body.angle = @angle
    body.opacity = 120
    body.zoom_x = self.zoom_x
    body.zoom_y = self.zoom_y  
    body.src_rect.set(@sx, @sy, @width, @height) if @anime_flug
    body.src_rect.set(0, 0, @width, @height) unless @anime_flug
    body.tone = Tone.new(0,0,255)
  end
end
end
#==============================================================================
# ** END OF SCRIPT
#==============================================================================

데모를 첨부했으니 꼭 보세요. 훨씬 이해가 잘 될것입니다.

 

TAG •