XP 스크립트

아래의 스크립트를 에러없이 사용하려면 게이지 그림파일이 필요합니다.  그림파일은 http://hartshorn-id.hp.infoseek.co.jp/material/status.html 에서 찾아 보세요(파일명은 bar.png).


#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。再定義
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 次のレベルまでの EXP の割合取得
  #--------------------------------------------------------------------------
  def exp_rate
    return @exp_list[@level+1] > 0 ? (@exp - @exp_list[@level]) * 100 / (@exp_list[@level+1] - @exp_list[@level]) : 100
  end
end

#==============================================================================
# ■ Harts_Window_StatusTitle
#------------------------------------------------------------------------------
#  アイテム画面で、タイトルを表示するウィンドウ。
#==============================================================================

class Harts_Window_StatusTitle < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120, 32, "ステータス", 1)
  end
end

#==============================================================================
# ■ Harts_Window_StatusName
#------------------------------------------------------------------------------
#  ステータス画面で表示する、名前ウィンドウです。
#==============================================================================

class Harts_Window_StatusName < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #    actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 480, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
  end
end

#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  ステータス画面で表示する、ステータスウィンドウです。
#==============================================================================

class Harts_Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #    actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 640, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # バトラーグラフィックロード
    bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(16, 0, bitmap, src_rect)
    # バーグラフィックロード
    bar = Bitmap.new("./Graphics/Pictures/bar.png")
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 4 + 144, 32)
    draw_actor_state(@actor, 4 + 144, 64)
   
    hpbar = @actor.hp * 100 / @actor.maxhp
    spbar = @actor.sp * 100 / @actor.maxsp
    self.contents.blt(390, 107, bar, Rect.new(0, 0, 102, 6))
    self.contents.blt(390, 139, bar, Rect.new(0, 0, 102, 6))
    if hpbar < 25
      self.contents.blt(391, 108, bar, Rect.new(0, 20, hpbar, 4))
    elsif hpbar < 50
      self.contents.blt(391, 108, bar, Rect.new(0, 16, hpbar, 4))
    else
      self.contents.blt(391, 108, bar, Rect.new(0, 12, hpbar, 4))
    end
    if spbar < 25
      self.contents.blt(391, 140, bar, Rect.new(0, 20, spbar, 4))
    elsif spbar < 50
      self.contents.blt(391, 140, bar, Rect.new(0, 16, spbar, 4))
    else
      self.contents.blt(391, 140, bar, Rect.new(0, 12, spbar, 4))
    end
    draw_actor_hp(@actor, 320, 80, 172)
    draw_actor_sp(@actor, 320, 112, 172)
   
    strbar = @actor.str * 100 / 999
    dexbar = @actor.dex * 100 / 999
    agibar = @actor.agi * 100 / 999
    intbar = @actor.int * 100 / 999
    self.contents.blt(480, 176, bar, Rect.new(0, 0, 102, 6))
    self.contents.blt(480, 208, bar, Rect.new(0, 0, 102, 6))
    self.contents.blt(480, 240, bar, Rect.new(0, 0, 102, 6))
    self.contents.blt(480, 272, bar, Rect.new(0, 0, 102, 6))
    self.contents.blt(481, 177, bar, Rect.new(0, 24, strbar, 4))
    self.contents.blt(481, 209, bar, Rect.new(0, 24, dexbar, 4))
    self.contents.blt(481, 241, bar, Rect.new(0, 24, agibar, 4))
    self.contents.blt(481, 273, bar, Rect.new(0, 24, intbar, 4))
    draw_actor_parameter(@actor, 320, 288, 0)
    draw_actor_parameter(@actor, 320, 320, 1)
    draw_actor_parameter(@actor, 320, 352, 2)
    draw_actor_parameter(@actor, 320, 160, 3)
    draw_actor_parameter(@actor, 320, 192, 4)
    draw_actor_parameter(@actor, 320, 224, 5)
    draw_actor_parameter(@actor, 320, 256, 6)
   
    self.contents.blt(320, 59, bar, Rect.new(0, 6, 202, 6))
    self.contents.blt(321, 60, bar, Rect.new(0, 24, @actor.exp_rate * 2, 4))
    self.contents.font.color = system_color
    self.contents.draw_text(320, 0, 80, 32, "EXP")
    self.contents.draw_text(320, 32, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 0, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 32, 84, 32, @actor.next_rest_exp_s, 2)
   
    self.contents.font.color = system_color
    self.contents.draw_text(4, 192, 96, 32, "装備")
    draw_item_name($data_weapons[@actor.weapon_id], 16, 224)
    draw_item_name($data_armors[@actor.armor1_id], 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 16, 288)
    draw_item_name($data_armors[@actor.armor3_id], 16, 320)
    draw_item_name($data_armors[@actor.armor4_id], 16, 352)
  end
end

#==============================================================================
# ■ Harts_Scene_Status
#------------------------------------------------------------------------------
#  ステータス画面の処理を行うクラスです。再定義
#==============================================================================

class Scene_Status
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #    actor_index : アクターインデックス
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    # アクターを取得
    @actor = $game_party.actors[@actor_index]
    # タイトルウィンドウを作成
    @title_window = Harts_Window_StatusTitle.new
    # 名前ウィンドウを作成
    @name_window = Harts_Window_StatusName.new(@actor)
    @name_window.x = 160
    # ステータスウィンドウを作成
    @status_window = Harts_Window_Status.new(@actor)
    @status_window.y = 64
    # トランジション実行
    Graphics.transition
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @title_window.dispose
    @name_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # メニュー画面に切り替え
      $scene = Scene_Menu.new(3)
      return
    end
    # R ボタンが押された場合
    if Input.trigger?(Input::R)
      # カーソル SE を演奏
      $game_system.se_play($data_system.cursor_se)
      # 次のアクターへ
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # 別のステータス画面に切り替え
      $scene = Scene_Status.new(@actor_index)
      return
    end
    # L ボタンが押された場合
    if Input.trigger?(Input::L)
      # カーソル SE を演奏
      $game_system.se_play($data_system.cursor_se)
      # 前のアクターへ
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # 別のステータス画面に切り替え
      $scene = Scene_Status.new(@actor_index)
      return
    end
  end
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
401 파티 Party Changer 4.0 by Dargor (SDK2.3 호환) 3 WMN 2008.04.06 1572
400 그래픽 Weather Script(버전 불명) by ccoa 1 file Alkaid 2010.09.08 1571
» 메뉴 스테이터스 화면 from Harts Horn 2 백호 2009.02.22 1571
398 메뉴 Star Ocean 3 형식으로 스테이터스 화면 변경 1 file 백호 2009.02.21 1570
397 메뉴 1-Scene CMS 1.16 by LegACy (SDK호환) 3 file 백호 2009.02.22 1564
396 이동 및 탈것 텔레포트 마나소비량 수정하기 3 지존!! 2010.07.22 1563
395 그래픽 Composite Window Skins by PK8 (XP/VX/VXA) Alkaid 2012.08.26 1559
394 기타 Advanced Gold Display by Dubealex (돈 액수를 세자리씩 끊어 표기) 2 Alkaid 2010.11.18 1559
393 기타 데미지 출력 스크립트 예제 9 file 백호 2009.02.22 1559
392 저장 Chaos Project Save Layout 1.4 by Fantasist, Blizzard file Alkaid 2010.10.08 1558
391 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1557
390 전투 버틀러 색조 변경 5 file 백호 2009.02.21 1552
389 기타 RM2kXP file 습작 2014.03.17 1551
388 기타 Trailing Characters ver.1 by SephirothSpawn 6 file 백호 2009.02.22 1551
387 기타 디버그 윈도우 강화! 3 file 백호 2009.02.21 1550
386 스크립트 호출 명령어 통합버전 / Version 2.21 / 8 WMN 2008.04.06 1543
385 넷플2.0(펌) 1 오동훈 2008.02.25 1543
384 메시지 UCoder's Message System by Mr.Mo file Alkaid 2010.10.05 1542
383 이동 및 탈것 Maplinks - 맵연결을 쉽게 하기 1 백호 2009.02.22 1541
382 이동 및 탈것 점프 높이를 자유자제로 조절하는 스크립트!! 8 file 백호 2009.02.21 1539
Board Pagination Prev 1 ... 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 ... 52 Next
/ 52