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
28 메뉴 Ryex's Collapsing CMS 2.51 3 Alkaid 2010.09.05 1667
» 메뉴 스테이터스 화면 from Harts Horn 2 백호 2009.02.22 1571
26 메뉴 Star Ocean 3 형식으로 스테이터스 화면 변경 1 file 백호 2009.02.21 1570
25 메뉴 1-Scene CMS 1.16 by LegACy (SDK호환) 3 file 백호 2009.02.22 1564
24 메뉴 Ring menu edit (Non-SDK ver.) Alkaid 2010.09.08 1538
23 메뉴 MOG - Scroll Bar for XP file 습작 2014.07.06 1532
22 메뉴 AP 올리기 8 알피지GM 2010.02.15 1490
21 메뉴 FF7형식의 메뉴로 변경하는 스크립트 1 file 백호 2009.02.21 1462
20 메뉴 Leidy's Ring Command Window 1.2 by DerVVulfman Alkaid 2012.09.09 1430
19 메뉴 링메뉴에 돈(G)표시하기 백호 2009.02.21 1414
18 메뉴 콤보 스크립트 백호 2009.02.22 1399
17 메뉴 링메뉴 스크립트 file 백호 2009.02.21 1391
16 메뉴 Ring menu edit for SDK2 (Original by Hypershadow180) file Alkaid 2010.09.08 1374
15 메뉴 플레이 시간 윈도우 개조 file 백호 2009.02.21 1328
14 메뉴 스테이터스 일람 스크립트 file 백호 2009.02.21 1328
13 메뉴 Advanced Command Windows by Tsunokiette file 백호 2009.02.22 1307
12 메뉴 L's Simple Custom Menu #1 R2 (SDK 2.x 필요) Alkaid 2013.01.18 1227
11 메뉴 Materia System 2 file 백호 2009.02.22 1222
10 메뉴 CogWheel Plug'n'Play Menu Bar by DerVVulfman@rmxp.org 2 백호 2009.02.22 1222
9 메뉴 메뉴에서 실제시간 보기 2 백호 2009.02.21 1124
Board Pagination Prev 1 2 3 4 5 Next
/ 5