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
561 메뉴 넷플레이 업그레이드됀 메뉴 스크립트 4 백호 2009.02.22 2040
560 저장 [KCG] 2 Pane Save Scene file 백호 2009.02.22 1128
559 저장 [KCG] 2 Pane Save Scene 번역본 백호 2009.02.22 1118
558 기타 광물캐기 스크립트 1 file 백호 2009.02.22 1850
557 기타 레벨, 능력치 무한 스크립트 3 백호 2009.02.22 1712
556 이름입력 영어 이름 입력기 2 백호 2009.02.22 1335
555 전투 SBABS v3 6 file 백호 2009.02.22 2046
554 기타 Book Event v2 by Bruth 5 백호 2009.02.22 1694
553 기타 레벨업시 전회복 by ccoa 8 백호 2009.02.22 2514
552 스킬 Trickster's Bag of Skill Effects file 백호 2009.02.22 1077
551 기타 메세지를 분출해 표시 백호 2009.02.22 1169
550 전투 전투의 커맨드에 따라 능력치를 상승 백호 2009.02.22 904
549 기타 스테이터스 표시 플러스 1.00ver 백호 2009.02.22 1141
548 기타 (T-RPG) 데미지 표시 시의 폰트를 설정 백호 2009.02.22 1348
547 기타 Crafting/Recipe system script by Axe Man Deke 백호 2009.02.22 829
546 기타 치트키 시스템 3 백호 2009.02.22 1594
545 기타 대화창 글자 한글자씩뜨는 스크립트 7 백호 2009.02.22 2185
» 메뉴 스테이터스 화면 from Harts Horn 2 백호 2009.02.22 1571
543 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1557
542 상태/속성 Custom stat growing system 1.0 by Blizzard@rmxp.org file 백호 2009.02.22 1088
Board Pagination Prev 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... 52 Next
/ 52