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
821 온라인 온라인스크립트 99Q(NM=No Map)버전 5 백호 2009.02.22 3121
820 메뉴 온라인메뉴처럼!! 메이플 메뉴처럼!! 변신~스크립트 33 WMN 2008.03.17 6815
819 온라인 온라인 스크립트입니다^^(예제파일) 7 캉쿤 2011.09.24 4390
818 온라인 온라인 스크립트 Unis Net RMXP 공식 배포! 25 file 뮤바보 2011.12.25 9398
817 온라인 온라인 스크립트 KnM 배포합니다. 43 file 뮤바보 2011.09.23 5350
816 전투 오버드라이브 8 file 키라링 2009.01.23 2193
815 저장 오류 수정한 자동세이브 2 백호 2009.02.22 1403
814 이름입력 영어 이름 입력기 2 백호 2009.02.22 1335
813 상점 여관 시스템 5 file 백호 2009.02.22 2209
812 기타 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 1 file 백호 2009.02.21 1263
811 기타 엔딩에 스탭롤을 도입하는 스크립트 1 file 백호 2009.02.21 1335
810 전투 엑터, 에너미 개별적인 효과음 스크립트 1 백호 2009.02.21 1292
809 기타 에어리어 설정 by RPG Advocate 백호 2009.02.22 709
808 장비 에러 안나는 장비창 전능력 표시 스크립트... 3 백호 2009.02.21 2352
807 전투 에너미들도 게이지바 달고싶다~!! 14 file 백호 2009.02.21 4099
806 전투 에너미 HP·SP투시 11 file 백호 2009.02.21 3086
805 전투 에너미 HP&SP 표시 스크립트 2 file 백호 2009.02.21 2542
» 전투 에너미 HP&SP 스크립트 4 파이널판타지 2011.08.16 2901
803 기타 업데이트 (죽었을경우부활 )스크립트한글화 2 by향온 2011.09.27 2438
802 기타 어디에 쓰이는지 불확실한 스크립트 1 백호 2009.02.22 1063
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