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 메뉴 메뉴에 그림넣기 4 file 백호 2009.02.22 4413
27 메뉴 메뉴 단축키 스크립트 14 백호 2009.02.22 2958
26 메뉴 Materia System 2.01v by SephirothSpawn 6 file 백호 2009.02.22 2101
25 메뉴 메뉴등에서 움직이는 엑터 9 file 백호 2009.02.22 3163
24 메뉴 [자작]명성치 사용 스크립트 16 Rainsy 2009.03.22 3390
23 메뉴 1인 캐릭터 메뉴 스크립트 27 file - 하늘 - 2009.08.06 4790
22 메뉴 메뉴....있길래올립니다. 9 벨☆ 2010.01.23 2001
21 메뉴 AP 올리기 8 알피지GM 2010.02.15 1490
20 메뉴 메이플스토리처럼 메뉴를^^ 57 file 딸기님 2010.07.13 7141
19 메뉴 새로운 메뉴 15 file 또라에몽 2010.07.17 5304
18 메뉴 자작 메뉴 스크립트들(L's Simple CMS and menu scenes) (SDK 호환?) 10 Alkaid 2010.09.02 3456
17 메뉴 Ryex's Collapsing CMS 2.51 3 Alkaid 2010.09.05 1667
16 메뉴 Stormtronics CMS 5.39b - Hybrid Edition by Blizzard 4 file Alkaid 2010.09.06 1742
15 메뉴 Ring menu edit for SDK2 (Original by Hypershadow180) file Alkaid 2010.09.08 1374
14 메뉴 Ring menu edit (Non-SDK ver.) Alkaid 2010.09.08 1538
13 메뉴 L's Custom Menu #4: 'Compact' (SDK 2.x 필수) Alkaid 2010.09.11 1755
12 메뉴 L's Custom Menu #3: 1인용 메뉴 Revision 1 3 Alkaid 2010.09.12 2360
11 메뉴 CoaMenuVer0.1 10 file 코아 코스튬 2010.09.25 2702
10 메뉴 CoaMenu2탄Ver2.0 15 file 코아 코스튬 2010.10.03 2091
9 메뉴 3D Menu Script 7 현문 2010.10.06 4077
Board Pagination Prev 1 2 3 4 5 Next
/ 5