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
801 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2917
800 HUD 맵이름 스크립트 1 file 긔염둥이♥ 2012.05.19 2913
799 스킬 패시브 스킬 (출처 RPGXP 포럼 - 후우님) 18 백호 2009.02.21 2913
798 메뉴 수정, 추가 링메뉴 10 file 백호 2009.02.22 2912
797 기타 스탭 롤 9 file 허걱 2009.08.13 2905
» 전투 에너미 HP&SP 스크립트 4 파이널판타지 2011.08.16 2901
795 이동 및 탈것 도트이동 5 file 허걱 2009.08.19 2889
794 HUD 맵 이름 표시 스크립트 수정하기 (계속 뜨게 하기, 위치 바꾸기 등) 3 뮤리온。 2011.10.08 2886
793 온라인 NetRPGXP Client Core 일부분임 8 백호 2009.10.06 2883
792 기타 몬스터도감 - 개량형 ? 7 file 백호 2009.02.22 2883
791 스킬 [RTAB] 스킬영창시간 7 file 백호 2009.02.22 2872
790 전투 쿼터뷰 전투 스크립트 3 file 백호 2009.02.21 2869
789 전투 XAS_Hero_3_6 24 ok하승헌 2010.02.18 2868
788 기타 폰트 자동 설치 스크립트 12 file 백호 2009.02.22 2865
787 온라인 Multi-Netplay Extended (신버전) 10 백호 2009.02.22 2864
786 메뉴 링메뉴 New 9 sdjfl465 2008.09.27 2861
785 메뉴 메뉴바꾸기 4 file ureazy 2012.07.23 2843
784 직업 직업 10 file 이안 2010.01.17 2838
783 아이템 CSSR14-아이템 합성 3 file 백호 2009.02.22 2833
782 전투 전투링메뉴.(턴알) 7 백호 2009.02.21 2820
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 52 Next
/ 52