XP 스크립트

#==============================================================================
# ■ Sprite_Mirror
# Based on Sprite_Shadow, modified by Rataime
#==============================================================================

class Sprite_Mirror < RPG::Sprite

attr_accessor :character
attr_accessor :events
attr_accessor :event_y

def initialize(viewport=nil)
  super(viewport)
  @character = $game_player
  @events=0
  @event_y=0
  self.opacity=0
  update
end

def update
  super
  if @tile_id != @character.tile_id or
     @character_name != @character.character_name or
     @character_hue != @character.character_hue
    @tile_id = @character.tile_id
    @character_name = @character.character_name
    @character_hue = @character.character_hue
    if @tile_id >= 384
      self.bitmap = RPG::Cache.tile($game_map.tileset_name,
        @tile_id, @character.character_hue)
      self.src_rect.set(0, 0, 32, 32)
      self.ox = 16
      self.oy = 32
    else
      self.bitmap = RPG::Cache.character(@character.character_name,
        @character.character_hue)
      @cw = bitmap.width / 4
      @ch = bitmap.height / 4
      self.ox = @cw / 2
      self.oy = @ch
    end
  end
  self.visible = (not @character.transparent)
  if @tile_id == 0
    sx = (@character.pattern) * @cw
    sy = (@character.direction - 2) / 2 * @ch
    if @character.direction==8
      sy = 0 * @ch
    end
    if @character.direction==2
      sy = 3 * @ch
    end
    self.src_rect.set(sx, sy, @cw, @ch)
  end
  self.x = @character.screen_x
  self.y = self.event_y-($game_player.screen_y-self.event_y).abs+30
  self.z = 10
  self.blend_type = @character.blend_type
  self.bush_depth = @character.bush_depth
  if @character.animation_id != 0
    animation = $data_animations[@character.animation_id]
    animation(animation, true)
    @character.animation_id = 0
  end
end
end

#===================================================
# ▼ CLASS Sprite_Character edit
#===================================================

class Sprite_Character < RPG::Sprite
 alias mirror_initialize initialize
 
 def initialize(viewport, character = nil)
   @character = character
   super(viewport)
   if character.is_a?(Game_Player)
    $game_map.mirror=Sprite_Mirror.new(viewport)
   end
   mirror_initialize(viewport, @character)
 end
 
 alias mirror_update update
 
 def update
  mirror_update
  if (@mirror!=nil and character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["m"])
    if $game_player.screen_y-self.y<80 and self.y<$game_player.screen_y and ($game_player.screen_x-self.x).abs<17
      if (character.list[1]!=nil and character.list[1].code == 108)
        @mirror.opacity=character.list[1].parameters[0].to_f
      else
        @mirror.opacity=$game_player.opacity
      end
      @mirror.events=self.id
      @mirror.event_y=self.y
    else
      if @mirror.events==self.id
        @mirror.events=0
      else
        if @mirror.events==0
          @mirror.opacity=0
        end
      end
    end
  end
  @mirror=$game_map.mirror
  if character.is_a?(Game_Player)
    @mirror.update
  end
 end
 
end

#===================================================
# ▼ CLASS Scene_Save edit
#===================================================
class Scene_Save < Scene_File
 
 alias mirror_write_save_data write_save_data
 
 def write_save_data(file)
   $game_map.mirror = nil
   mirror_write_save_data(file)
 end
end

#===================================================
# ▼ CLASS Game_Map edit
#===================================================
class Game_Map
 attr_accessor :mirror
end

#===================================================
# ▼ CLASS Scene_Map edit
#===================================================
class Spriteset_Map
 
 alias mirror_map_initialize initialize
 
 def initialize
   $game_map.mirror=nil
   mirror_map_initialize
 end
end

 

Comment '20'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 7325
781 전투 Mr. Mo's ABS Ultimate by DerVVulfman Alkaid 2011.09.05 1456
780 온라인 Mr.Metring NPE 1.0 [RPG XP 온라인 스크립트] 35 아방스 2009.01.07 6573
779 전투 Mr.Mo's ABS Ultimate 2.6 by DerVVulfman Alkaid 2012.01.04 1838
778 전투 Mr.Mo's ABS Ultimate 3.4 by DerVVulfman Alkaid 2012.03.14 1818
777 전투 Mr.Mo's ABS Ultimate 7.0 by DerVVulfman 4 Alkaid 2012.08.26 2614
776 전투 Mr.mo's SBABS Lite 5 6 아방스마니아 2010.11.14 2960
775 전투 MrMo DVV Add-On #13: Tinuke's Smart Missiles 2 Alkaid 2011.01.24 1863
774 장비 Multi Equip 3.1.4 by Trickster (SDK2 호환, Method & Class Li… 4 file WMN 2008.04.06 1620
773 장비 Multi-equip script 2 file 백호 2009.02.21 1117
772 장비 Multi-equip script ver.6 by Guillaume777 4 file 백호 2009.02.22 1227
771 장비 Multi-equip script 노신버전 2 file 백호 2009.02.22 1145
770 온라인 Multi-Netplay Extended (신버전) 10 백호 2009.02.22 2888
769 온라인 Multi-Netplay Extended[구버전용] 3 백호 2009.02.22 2198
768 기타 Multiple Currencies(여러 개의 통화단위 사용) 2 백호 2009.02.22 1138
767 기타 Multiple Languages v2 by SephirothSpawn (SDK호환) file 백호 2009.02.22 1416
766 장비 Multislots! 2.1 by DerVVulfman 3 file Alkaid 2010.09.02 1577
765 장비 Multislots! 2.2 by DerVVulfman 4 file Alkaid 2011.02.18 1641
764 장비 MultiSlots! 2.4 by DerVVulfman 2 Alkaid 2011.09.05 1488
763 온라인 multy-netplay 로그인창에서 비밀번호를 ***표시해주는 script~! 1 백호 2009.02.22 1918
762 기타 My메세지(메세지 출력 스크립트) 1 file 백호 2009.02.22 1545
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 52 Next
/ 52