XP 스크립트

#이 스크립트를 사용하기전에 [Scene_Debug] 아래에 삽입버튼을 눌러 이름을
#아무렇게나 정한후
#$game_special_elements = {}
#$imported = {}
#$data_states = load_data("Data/States.rxdata")
#$data_system = load_data("Data/System.rxdata")
#이 스크립트를 넣어주세요 (앞에 #는 삭제)


#번역:버밀
#스크립트 에디터 -> 맨 아래의 메인을 우클릭 -> 삽입버튼 클릭 -> 이름을 보관소
#로 한후 이 스크립트를 붙여넣기 한다

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆변수 숍- KGC_VariableShop
#_/----------------------------------------------------------------------------
#_/ 변수로 아이템의 구입을 하는 특수한 가게를 작성합니다.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

# 도입 이 끝난 상태 플래그를 온
$imported["VariableShop"] = true

#==============================================================================
# ★ 커스터마이즈(customize) 항목 ★
#==============================================================================

# 변수 숍에 사용하는 변수 ID
#  게임중에도 변경 가능
$vs_id = 10

# 판매 가격 설정 비율(판매 가격표시가 [데이타베이스의 가격]‰ 이 된다)
#  게임중에도 변경 가능
$vs_rate = 10

# 가격의 단위 설정
#  변수 ID를 첨자로 한 배열을 작성
$vs_domination = []
$vs_domination[10] = "배틀포인트"  # 변수 ID10:배틀 포인트

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Module_RPG
#------------------------------------------------------------------------------
#  RPG 모듈재정의
#==============================================================================

module RPG
  class Item
    #------------------------------------------------------------------------
    # ● 특수 가격
    #------------------------------------------------------------------------
    def price2
      n = @price * $vs_rate / 100 # 이 3개의 숫자 부분에서 배틀포인트 비율을 정하는거죠
    end
  end
  class Weapon
    def price2
      n = @price * $vs_rate / 100 # 10으로 하면 아이템의 원가이고 0이 늘어나면 점점 가격
    end
  end
  class Armor
    def price2
      n = @price * $vs_rate / 100 # 하락... 1로 하면 가격이 급상승 대충 이해하세요 -_-;
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_Variable
#------------------------------------------------------------------------------
#  변수를 표시하는 윈도우입니다.
#==============================================================================

class Window_Variable < Window_Gold
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    cx = contents.text_size($vs_domination[$vs_id]).width
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120-cx-2, 32, $game_variables[$vs_id].to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(124-cx, 0, cx, 32, $vs_domination[$vs_id], 2)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_VariableShopCommand
#------------------------------------------------------------------------------
#  변수 숍 화면에서 , 용건을 선택하는 윈도우입니다.
#==============================================================================

class Window_VariableShopCommand < Window_ShopCommand
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias initialize_KGC_VariableShop initialize
  def initialize
    # 원래의 처리를 실행
    initialize_KGC_VariableShop

    @item_max = 2
    @commands = ["구입한다", "그만둔다"]
    refresh
    self.index = 0
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_VariableShopBuy
#------------------------------------------------------------------------------
#  변수 숍 화면에서 , 구입할 수 있는 상품의 일람을 표시하는 윈도우입니다.
#==============================================================================

class Window_VariableShopBuy < Window_ShopBuy
  #--------------------------------------------------------------------------
  # ● 항목의 묘화
  #    index : 항목 번호
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    # 아이템의 소지수를 취득
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    # 가격이 변수의 값 이하 , 한편 소지수가 99 가 아니면 통상 문자색에 ,
    # 그렇지 않으면 무효 문자색으로 설정
    if item.price2 <= $game_variables[$vs_id] && number < 99
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 88, 32, item.price2.to_s, 2)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_VariableShopNumber
#------------------------------------------------------------------------------
#  변수 숍 화면에서 , 구입하는 아이템의 개수를 입력하는 윈도우입니다.
#==============================================================================

class Window_VariableShopNumber < Window_ShopNumber
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_item_name(@item, 4, 96)
    self.contents.font.color = normal_color
    self.contents.draw_text(272, 96, 32, 32, "×")
    self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2)
    self.cursor_rect.set(304, 96, 32, 32)
    # 합계 가격과 단위를 묘화
    domination = $vs_domination[$vs_id]
    cx = contents.text_size(domination).width
    total_price = @price * @number
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(332-cx, 160, cx, 32, domination, 2)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Shop
#------------------------------------------------------------------------------
#  숍 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Shop
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  alias main_KGC_VariableShop main
  def main
    # 변수 숍을 호출했을 경우
    if $call_vs && $game_variables[$vs_id] != nil
      # 변수 숍 화면에 이행
      $scene = Scene_VariableShop.new
      $call_vs = false
      return
    end

    # 원래의 처리를 실행
    main_KGC_VariableShop
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_VariableShop
#------------------------------------------------------------------------------
#  변수 숍 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_VariableShop < Scene_Shop
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Map.new
    # 헬프 윈도우를 작성
    if $imported["HelpExtension"]
      @help_window = Window_HelpExtension.new
    else
      @help_window = Window_Help.new
    end
    @help_window.back_opacity = 160
    # 커멘드 윈도우를 작성
    @command_window = Window_VariableShopCommand.new
    @command_window.back_opacity = 160
    # 변수 윈도우를 작성
    @variable_window = Window_Variable.new
    @variable_window.back_opacity = 160
    @variable_window.x = 480
    @variable_window.y = $imported["HelpExtension"] ? 128 : 64
    # 더미 윈도우를 작성
    if $imported["HelpExtension"]
      @dummy_window = Window_Base.new(0, 192, 640, 288)
    else
      @dummy_window = Window_Base.new(0, 128, 640, 352)
    end
    @dummy_window.back_opacity = 160
    # 구입 윈도우를 작성
    @buy_window = Window_VariableShopBuy.new($game_temp.shop_goods)
    @buy_window.back_opacity = 160
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    # 個?入力ウィンドウを作成
    @number_window = Window_VariableShopNumber.new
    @number_window.back_opacity = 160
    @number_window.active = false
    @number_window.visible = false
    # ステ?タスウィンドウを作成
    @status_window = Window_ShopStatus.new
    @status_window.back_opacity = 160
    @status_window.visible = false
    # トランジション?行
    Graphics.transition
    # メインル?プ
    loop do
      # ゲ?ム?面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレ?ム更新
      update
      # ?面が切り替わったらル?プを中?
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @spriteset.dispose
    @help_window.dispose
    @command_window.dispose
    @variable_window.dispose
    @dummy_window.dispose
    @buy_window.dispose
    @number_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新
  #--------------------------------------------------------------------------
  def update
    # ウィンドウを更新
    @help_window.update
    @command_window.update
    @variable_window.update
    @dummy_window.update
    @buy_window.update
    @number_window.update
    @status_window.update
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ
    if @command_window.active
      update_command
      return
    end
    # 購入ウィンドウがアクティブの場合: update_buy を呼ぶ
    if @buy_window.active
      update_buy
      return
    end
    # 個?入力ウィンドウがアクティブの場合: update_number を呼ぶ
    if @number_window.active
      update_number
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新 (コマンドウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_command
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # マップ?面に切り替え
      $scene = Scene_Map.new
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # コマンドウィンドウのカ?ソル位置で分岐
      case @command_window.index
      when 0  # 購入する
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ウィンドウの?態を購入モ?ドへ
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.visible = true
        @buy_window.refresh
        @status_window.visible = true
      when 1  # やめる
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # マップ?面に切り替え
        $scene = Scene_Map.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新 (購入ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_buy
    # ステ?タスウィンドウのアイテムを設定
    @status_window.item = @buy_window.item
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # ウィンドウの?態を初期モ?ドへ
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @buy_window.visible = false
      @status_window.visible = false
      @status_window.item = nil
      # ヘルプテキストを消去
      @help_window.set_text("")
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # アイテムを取得
      @item = @buy_window.item
      # アイテムが無?の場合、または?格が所持金より上の場合
      if @item == nil || @item.price2 > $game_variables[$vs_id]
        # ブザ? SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # アイテムの所持?を取得
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # すでに 99 個所持している場合
      if number == 99
        # ブザ? SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      # 最大購入可能個?を計算
      max = @item.price2 == 0 ? 99 : $game_variables[$vs_id] / @item.price2
      max = [max, 99 - number].min
      # ウィンドウの?態を個?入力モ?ドへ
      @buy_window.active = false
      @buy_window.visible = false
      @number_window.set(@item, max, @item.price2)
      @number_window.active = true
      @number_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # ● フレ?ム更新 (個?入力ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_number
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # 個?入力ウィンドウを非アクティブ?不可視に設定
      @number_window.active = false
      @number_window.visible = false
      # ウィンドウの?態を購入モ?ドへ
      @buy_window.active = true
      @buy_window.visible = true
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # ショップ SE を演奏
      $game_system.se_play($data_system.shop_se)
      # 個?入力ウィンドウを非アクティブ?不可視に設定
      @number_window.active = false
      @number_window.visible = false
      # 購入?理
      $game_variables[$vs_id] -= @number_window.number * @item.price2
      case @item
      when RPG::Item
        $game_party.gain_item(@item.id, @number_window.number)
      when RPG::Weapon
        $game_party.gain_weapon(@item.id, @number_window.number)
      when RPG::Armor
        $game_party.gain_armor(@item.id, @number_window.number)
      end
      # 各ウィンドウをリフレッシュ
      @variable_window.refresh
      @buy_window.refresh
      @status_window.refresh
      # ウィンドウの?態を購入モ?ドへ
      @buy_window.active = true
      @buy_window.visible = true
      return
    end
  end
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
34 전투 Mr Mo DVV Addon #18~#19 Alkaid 2011.07.13 1266
33 전투 전투 속도 조정 스크립트 2 file 백호 2009.02.21 1261
32 전투 Custom Debugger, Battle Debugger by RPG Advocate file 백호 2009.02.22 1248
31 전투 전투의 승리마다 행동에 따라서 능력치가 상승한다! 1 백호 2009.02.22 1238
30 전투 전투위치 보정 스크립트 1 file 백호 2009.02.21 1234
29 전투 Star Ocean Battle System 3 file 백호 2009.02.22 1228
28 전투 마법반사 스크립트 1 file 백호 2009.02.21 1216
27 전투 랜덤으로 적을 출현시키는 스크립트 백호 2009.02.21 1215
26 전투 Advanced Limit Breaks (KGC스크립트를 SDK호환용으로 손질한 것) 백호 2009.02.22 1214
25 전투 Steal Script 5.5 by trickster@rmxp.net (SDK호환) file 백호 2009.02.22 1206
24 전투 SimpleAction (출처 -RPGXP 포럼 비밀소년님의 자작품) 1 file 백호 2009.02.21 1193
23 전투 Advanced Individual Battle Command v2.1 by Trickster@rmxp.org (SDK호환) 1 file 백호 2009.02.22 1189
22 전투 RTAB 1.15와 애드온 from 歯車の城 4 file 백호 2009.02.22 1186
21 전투 데미지마루 백호 2009.02.21 1163
20 전투 A-battle 수정 file 백호 2009.02.21 1155
19 전투 FF10 전투 대미지 공식 by hydro@rmxp.org 백호 2009.02.22 1140
18 전투 물리친 적의수 표시 file 백호 2009.02.21 1131
17 전투 전투에서도 맵 BGM 연결하는 스크립트 2 file 백호 2009.02.21 1129
» 전투 배틀샵 스크립트 1 백호 2009.02.22 1126
15 전투 레벨업 시스템 제거 스크립트 file 백호 2009.02.21 1117
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9