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 장비 MultiSlots! 2.4 by DerVVulfman 2 Alkaid 2011.09.05 1466
920 전투 Mr. Mo's ABS Ultimate by DerVVulfman Alkaid 2011.09.05 1438
» 전투 에너미 HP&SP 스크립트 4 파이널판타지 2011.08.16 2900
918 메시지 TXT 메세지 렌더링 스크립트 16 에돌이 2011.07.14 4069
917 전투 Minkoff's Animated Battlers - Enhanced 13.4 by DerVVulfman 2 Alkaid 2011.07.13 1458
916 전투 Mr Mo DVV Addon #18~#19 Alkaid 2011.07.13 1266
915 메시지 txt 메세징 스크립트 4 에돌이 2011.07.12 2198
914 전투 Mr Mo DVV Addon #14~#17 3 Alkaid 2011.05.23 1285
913 스킬 Grouping and Details 8.1 by DerVVulfman 4 file Alkaid 2011.04.18 1437
912 기타 Text to RGSS by DerVVulfman Alkaid 2011.04.18 1319
911 기타 [게이지바]HelloCoaVer4.0 업데이트 속도 변경 [오랜만의 업데이트] 30 file 코아 코스튬 2011.04.02 3787
910 키입력 Glitchfinder's Input Modules (XP/VX 공용) 2 Alkaid 2011.03.19 1952
909 스킬 MicKo's Skill Tree 1.2 by DerVVulfman 2 Alkaid 2011.03.15 2010
908 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
907 기타 The General Monster Generator 1.1 by DerVVulfman 1 file Alkaid 2011.03.02 1496
906 메시지 Hermes(Hermes Extends RPGXP Message System) 0.4 by derula 1 Alkaid 2011.02.27 3053
905 기타 일시정지 스크립트 13 【§㉤ㅏ법㉧ㅣ§】 2011.02.26 1841
904 저장 심플 세이브&로드 개조(필요할 때 원하는 슬롯에 자동저장) 5 나렌시아 2011.02.24 2291
903 XP의 느린FPS 빠르게하기 16 주유공근615 2011.02.22 3138
902 장비 Multislots! 2.2 by DerVVulfman 4 file Alkaid 2011.02.18 1611
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