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 6153
781 아이템 아이템창변경 27 카르닉스 2010.02.26 3631
780 아이템 아이템소지수 한계돌파 (중복일지도) 12 카르닉스 2010.02.26 1498
779 전투 방어시회복하는거래요. 8 카르닉스 2010.02.26 1579
778 전투 데미지 폰트변경 7 카르닉스 2010.02.26 2600
777 KGC 스탯올리기 스크립트 (능력치 분배 스크립트) 13 카이어덱터 2010.02.26 2292
776 전투 XAS 여러가지버전. 9 §포뇨§ 2010.02.23 4395
775 전투 XAS_Hero_3_6 24 ok하승헌 2010.02.18 2868
774 이름입력 한글 이름 입력 15 ok하승헌 2010.02.18 4487
» 기타 거울에 캐릭 반사 20 ok하승헌 2010.02.18 2388
772 스킬 기술문서(스킬 습득 아이템) 7 ok하승헌 2010.02.18 2132
771 기타 3D스크립트 48 file ok하승헌 2010.02.18 3808
770 이동 및 탈것 이동루트 설정 스크립트-특정범위 13 file 『★Browneyedgirls』 2010.02.18 2000
769 메뉴 AP 올리기 8 알피지GM 2010.02.15 1490
768 스킬 스킬 레벨 스크립트 # 번역 진행중 6 빗자루씨 2010.02.11 1980
767 퀘스트 퀘스트 시스템 # 번역 24 빗자루씨 2010.02.09 4035
766 메시지 메세지 오류 수정 시스템 3 엘릭스토리안 2010.02.06 1474
765 기타 말풍선 스크립트. 62 file 『동그라미』♥ 2010.02.04 4254
764 상태/속성 KGC_StateIcon(스테이터스 아이콘 표시) 2 file 12345678 2010.02.03 1965
763 이동 및 탈것 동료들끼리 따라오는 스크립트 41 file ◐아이흥행 2010.01.23 3714
762 기타 하나더올립니다....하암........이건...렙제라네요 7 벨☆ 2010.01.23 1754
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