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

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
521 스킬 SG_Skill Invoking Battle Items by sandgolem (SDK호환) 백호 2009.02.22 894
520 전투 전투의 승리마다 행동에 따라서 능력치가 상승한다! 1 백호 2009.02.22 1238
519 기타 대화 글씨가 한글자씩 나오는 스크립트 2 백호 2009.02.22 2464
518 기타 소지금 7자리수(9,999,999원)돌파 6 백호 2009.02.22 1752
517 기타 쓸 용도가 없지만 마비노기 게임 만들 때 좋죠[장작스크립트] 5 백호 2009.02.22 2407
516 기타 SG_Call Script Fix by sandgolem (SDK호환) 백호 2009.02.22 802
515 전투 SG_Auto battle by sandgolem (SDK호환) 백호 2009.02.22 1031
514 기타 광물캐기 시스템 v2 3 백호 2009.02.22 1775
513 메뉴 Customizable Ring Menu by SephirothSpawn 백호 2009.02.22 884
512 기타 My메세지(메세지 출력 스크립트) 1 file 백호 2009.02.22 1533
511 장비 장비 전능력 스크립트 4 file 백호 2009.02.22 1783
510 기타 레벨,능력치 9999 3 백호 2009.02.22 1596
509 전투 Advanced Individual Battle Command v2.1 by Trickster@rmxp.org (SDK호환) 1 file 백호 2009.02.22 1189
» 기타 거울에 자신의모습이 비춰지는 스크립트 2 백호 2009.02.22 1488
507 기타 SG_Window Control v2 by sandgolem 백호 2009.02.22 823
506 메뉴 기본메뉴 뜯어고친것. (스샷추가) 6 file 백호 2009.02.22 4313
505 기타 Rataime's Multi Demo 1 file 백호 2009.02.22 834
504 메뉴 1-Scene CMS 1.03 by LegACy@rmxp.org (SDK호환) file 백호 2009.02.22 871
503 전투 FF10 전투 대미지 공식 by hydro@rmxp.org 백호 2009.02.22 1141
502 기타 SG_Multiple Currencies v3 by sandgolem (SDK호환) 백호 2009.02.22 803
Board Pagination Prev 1 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ... 52 Next
/ 52