XP 스크립트

#==============================================================================
# ■ 에너미 HP&SP(ver 0.98)
#==============================================================================


#==============================================================================
# 걽 긇긚??귽긛?귽깛긣
#==============================================================================
module PLAN_HPSP_DRAW
  FONT_NAME         = ["Comic Sans MS", "굃굍 뼻뮝"]    # 폰트
  FONT_SIZE         =  15                               # 크기
  FONT_BOLD         = true                              # 굵은 글씨
  FONT_ITALIC       = true                              # 이탤릭

  DRAW_NAME         = true                              # 이름의 묘화
  DRAW_HP           = true                              # HP 의 묘화
  DRAW_SP           = true                              # SP 의 묘화

  DRAW_WIDTH        =  80                               # 묘화폭
  DRAW_HEIGHT       = 3 * 32                            # 묘화 높이
  DRAW_SPACE        =   0                               # 행간
  DRAW_Y            =  24                               # Y 좌표 수정치
end

 

 

#==============================================================================
# 걾 Sprite_Battler
#==============================================================================

class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # 걶 긆긳긙긃긏긣룊딖돸
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_initialize initialize
  def initialize(viewport, battler = nil)
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_initialize(viewport, battler)
    # 긄긨??궻뤾뜃
    if @battler.is_a?(Game_Enemy)
      width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
      height = PLAN_HPSP_DRAW::DRAW_HEIGHT + 32
      x = @battler.screen_x - width / 2
      y = @battler.screen_y - height + 32 + PLAN_HPSP_DRAW::DRAW_Y
      @enemy_hpsp_window = Window_Base.new(x, y, width, height)
      @enemy_hpsp_window.contents = Bitmap.new(width - 32, height - 32)
      @enemy_hpsp_window.contents.font.name = PLAN_HPSP_DRAW::FONT_NAME
      @enemy_hpsp_window.contents.font.size = PLAN_HPSP_DRAW::FONT_SIZE
      @enemy_hpsp_window.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
      @enemy_hpsp_window.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
      y = 0
      @old_enemy_hpsp = []
      one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
      if PLAN_HPSP_DRAW::DRAW_NAME
        @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
        y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
        @old_enemy_hpsp.push(@battler.name)
      end
      if PLAN_HPSP_DRAW::DRAW_HP
        @enemy_hpsp_window.draw_actor_hp(@battler, 0, y, width - 32)
        y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
        @old_enemy_hpsp.push(@battler.hp)
      end
      if PLAN_HPSP_DRAW::DRAW_SP
        @enemy_hpsp_window.draw_actor_sp(@battler, 0, y, width - 32)
        @old_enemy_hpsp.push(@battler.sp)
      end
      @enemy_hpsp_window.opacity = 0
      @enemy_hpsp_window.contents_opacity = 0
      @enemy_hpsp_window.z = -2
    end
  end
  #--------------------------------------------------------------------------
  # 걶 됶뺳
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_dispose dispose
  def dispose
    # 긄긨??궻뤾뜃
    if @battler.is_a?(Game_Enemy)
      @enemy_hpsp_window.dispose
    end
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_dispose
  end
  #--------------------------------------------------------------------------
  # 걶 긲깒??뛛륷
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_update update
  def update
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_update
    # 긄긨??궻뤾뜃
    if @battler.is_a?(Game_Enemy)
      @enemy_hpsp_window.visible = @battler_visible
    # 긚긵깋귽긣궻띆뷭귩먠믦
      width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
      @enemy_hpsp_window.x = self.x - width / 2
      @now_enemy_hpsp = []
      if PLAN_HPSP_DRAW::DRAW_NAME
        @now_enemy_hpsp.push(@battler.name)
      end
      if PLAN_HPSP_DRAW::DRAW_HP
        @now_enemy_hpsp.push(@battler.hp)
      end
      if PLAN_HPSP_DRAW::DRAW_SP
        @now_enemy_hpsp.push(@battler.sp)
      end
      if @old_enemy_hpsp != @now_enemy_hpsp and $game_temp.enemy_hpsp_refresh
        @old_enemy_hpsp = @now_enemy_hpsp
        @enemy_hpsp_window.contents.clear
        y = 0
        width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
        one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
        if PLAN_HPSP_DRAW::DRAW_NAME
          @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
          y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
        end
        if PLAN_HPSP_DRAW::DRAW_HP
          @enemy_hpsp_window.draw_actor_hp(@battler, 0, y, width - 32)
          y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
        end
        if PLAN_HPSP_DRAW::DRAW_SP
          @enemy_hpsp_window.draw_actor_sp(@battler, 0, y, width - 32)
        end
        Graphics.frame_reset
      end
    end
  end
  #--------------------------------------------------------------------------
  # 걶 visible 궻먠믦
  #--------------------------------------------------------------------------
  if !method_defined?("plan_enemy_hpsp_draw_visible=")
    alias plan_enemy_hpsp_draw_visible= visible=
  end
  def visible=(bool)
    # 긄긨??궻뤾뜃
    if @battler.is_a?(Game_Enemy)
      @enemy_hpsp_window.visible = bool
    end
    # 뙰궻긽?긞긤궸뽣궥
    self.plan_enemy_hpsp_draw_visible=(bool)
  end
  #--------------------------------------------------------------------------
  # 걶 븉벁뼻뱗궻먠믦
  #--------------------------------------------------------------------------
  if !method_defined?("plan_enemy_hpsp_draw_opacity=")
    alias plan_enemy_hpsp_draw_opacity= opacity=
  end
  def opacity=(n)
    # 뙰궻긽?긞긤궸뽣궥
    self.plan_enemy_hpsp_draw_opacity=(n)
    # 긄긨??궻뤾뜃
    if @battler.is_a?(Game_Enemy)
      @enemy_hpsp_window.contents_opacity = n
    end
  end
  #--------------------------------------------------------------------------
  # 걶 ?긽?긙
  #--------------------------------------------------------------------------
  def damage(value, critical)
    super(value, critical)
    bitmap = @_damage_sprite.bitmap
    @_damage_sprite.dispose
    @_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
    @_damage_sprite.bitmap = bitmap
    @_damage_sprite.ox = 80
    @_damage_sprite.oy = 20
    @_damage_sprite.x = self.x
    @_damage_sprite.y = self.y - self.oy / 2
    @_damage_sprite.viewport.z = self.viewport.z + 1
    @_damage_sprite.z = 3000
    @_damage_duration = 40
  end
  #--------------------------------------------------------------------------
  # 걶 ?긽?긙됶뺳
  #--------------------------------------------------------------------------
  def dispose_damage
    if @_damage_sprite != nil
      @_damage_sprite.viewport.dispose
    end
    super
  end
end

 

 

#==============================================================================
# 걾 Game_Temp
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # 걶 뚺둎귽깛긚?깛긚빾릶
  #--------------------------------------------------------------------------
  attr_accessor :enemy_hpsp_refresh
  #--------------------------------------------------------------------------
  # 걶 긆긳긙긃긏긣룊딖돸
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_initialize initialize
  def initialize
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_initialize
    @enemy_hpsp_refresh = false
  end
end

#==============================================================================
# 걾 Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # 걶 긵깒긫긣깑긲긃?긛둎럑 (긄긨??뼹?귺깑긲?긹긞긣뾭)
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_start_phase1 start_phase1
  def start_phase1
    $game_temp.enemy_hpsp_refresh = true
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_start_phase1
  end
  #--------------------------------------------------------------------------
  # 걶 긬?긡귻긓?깛긤긲긃?긛둎럑 (긄긨??뼹?귺깑긲?긹긞긣뾭)
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_start_phase2 start_phase2
  def start_phase2
    $game_temp.enemy_hpsp_refresh = false
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_start_phase2
  end
  #--------------------------------------------------------------------------
  # 걶 긲깒??뛛륷 (긽귽깛긲긃?긛 긚긡긞긵 5 : ?긽?긙?렑)
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_update_phase4_step5
    $game_temp.enemy_hpsp_refresh = true
  end
  #--------------------------------------------------------------------------
  # 걶 긲깒??뛛륷 (긽귽깛긲긃?긛 긚긡긞긵 6 : 깏긲깒긞긘깄)
  #--------------------------------------------------------------------------
  alias plan_enemy_hpsp_draw_update_phase4_step6 update_phase4_step6
  def update_phase4_step6
    # 뙰궻긽?긞긤궸뽣궥
    plan_enemy_hpsp_draw_update_phase4_step6
    $game_temp.enemy_hpsp_refresh = false
  end
end


#==============================================================================
# 걾 Window_Base
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # 걶 뼹멟궻?됪
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y, width = 120, align = 0)
    self.contents.font.color = normal_color
    align = 1 if $scene.is_a?(Scene_Battle)
    self.contents.draw_text(x, y, width, 32, actor.name, align)
  end
  #--------------------------------------------------------------------------
  # 걶 긚긡?긣궻?됪
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    # 뙰궻긽?긞긤궸뽣궥
    text = make_battler_state_text(actor, width, true)
    self.contents.draw_text(x, y, width, 32, text, 1)
  end
end

 

아까... 에너미 HP&SP 스크립트는 없어서 올려봤습니다.

쓰고 싶으면 쓰세요~

Comment '4'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
921 기타 창고 스크립트 2 백호 2009.02.21 1203
920 기타 참 시스템 완성! 1 file 백호 2009.02.22 1523
919 장비 착용한 장비에 따라 모습이 달라지는 스크립트 예제 5 file 게임애호가 2015.02.14 2002
918 HUD 직업명띄우기 스크립트 2 백호 2009.02.21 1123
917 직업 직업마다 다른 성장 2 백호 2009.02.22 1723
916 직업 직업 10 file 이안 2010.01.17 2838
915 아이템 지정한 아이템 갯수 제한 3 백호 2009.02.22 1282
914 기타 지정범위안에 들어오면 특정한 움직임을 취한다!! 1 백호 2009.02.21 919
913 변수/스위치 지정범위안에 들어오면 특정 스위치를 온/오프/교환 한다!! 2 백호 2009.02.21 1365
912 전투 중복일지도 모르는 ATB 전투 11 file 백호 2009.02.22 4057
911 타이틀/게임오버 죽었을떄 마을로이동하기&생명초 사용하기 9 WMN 2008.03.17 2097
910 타이틀/게임오버 죽엇을경우 마을로이동하기 스크립트 16 file 백호 2009.02.22 3325
909 HUD 주인공,NPC이름 머리 나타내기 49 file 송긔 2010.11.28 6060
908 좌표 표시 하는 스크랩트 1 WMN 2008.03.17 1214
907 기타 좌표 스크립트 2 백호 2009.02.21 908
906 이동 및 탈것 젤다 스타일 맵스크롤 5 file 백호 2009.02.21 1838
905 스킬 제한시간내 커맨드를 입력해야 스킬이 발동~ 3 file 백호 2009.02.22 2614
904 기타 제작한 게임의 파일을 모두 exe파일 하나에 쓸어담기 by sheefo@Creation Asylum 1 file 백호 2009.02.22 1239
903 기타 제련시스템 수정본입니다. 3 file 백호 2009.02.21 1020
902 메뉴 제가추천하는 메뉴스크립트 11 file 백호 2009.02.22 5298
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52