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
941 전투 XAS Hero Edition Ver. 3.91 3 프리즌커피 2011.12.23 3894
940 맵/타일 Call Map Event by DerVVulfman Alkaid 2011.12.21 1861
939 기타 탤레포트 스크립트 3 앞잡이 2011.12.10 2260
938 전투 Mr. Mo's ABS Ultimate 1.9 by DerVVulfman 2 Alkaid 2011.12.01 1900
937 전투 Mr. Mo's ABS Ultimate 1.2 by DerVVulfman Alkaid 2011.11.13 1640
936 그래픽 Meagan's Particles 1.1 by DerVVulfman 3 Alkaid 2011.11.01 2205
935 HUD 맵 이름 표시와 미니맵을 같이하자 8 file 뮤리온。 2011.10.08 4191
934 HUD 맵 이름 표시 스크립트 수정하기 (계속 뜨게 하기, 위치 바꾸기 등) 3 뮤리온。 2011.10.08 2886
933 기타 업데이트 (죽었을경우부활 )스크립트한글화 2 by향온 2011.09.27 2438
932 온라인 온라인 스크립트입니다^^(예제파일) 7 캉쿤 2011.09.24 4390
931 온라인 온라인 스크립트 KnM 배포합니다. 43 file 뮤바보 2011.09.23 5350
930 기타 부활스크립트 4 캉쿤 2011.09.19 2061
929 이동 및 탈것 8방향이동 9 캉쿤 2011.09.19 2527
928 HUD 맵이름표시 6 캉쿤 2011.09.14 2381
927 상점 상점아템 가격변동(중뷁?) 4 캉쿤 2011.09.14 2188
926 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
925 아이템 아이템 소지수 한계돌파(중복일 확률 높음) 3 캉쿤 2011.09.13 1478
924 저장 렉없는 자동세이브(중복임??) 4 캉쿤 2011.09.12 1986
923 스킬 Blacksmith System 2.0 by ForeverZer0 4 Alkaid 2011.09.07 1768
922 전투 Mr Mo DVV Addon #20~#21 Alkaid 2011.09.05 1432
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