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
1021 액터 (killer님 요청)자동회복 스크립트 3 나뚜루 2009.02.22 2572
1020 기타 (T-RPG) 데미지 표시 시의 폰트를 설정 백호 2009.02.22 1348
1019 메뉴 1-Scene CMS 1.03 by LegACy@rmxp.org (SDK호환) file 백호 2009.02.22 871
1018 메뉴 1-Scene CMS 1.1 by LegACy@rmxp.org (SDK호환) file 백호 2009.02.22 953
1017 메뉴 1-Scene CMS 1.16 by LegACy (SDK호환) 3 file 백호 2009.02.22 1564
1016 메시지 1문자식 표시랑 따랑소리 나는 스크립트 8 백호 2009.02.22 2305
1015 메뉴 1인 캐릭터 메뉴 스크립트 27 file - 하늘 - 2009.08.06 4790
1014 메뉴 1인용 메뉴 스크립트 6 WMN 2008.03.17 2450
1013 메뉴 3D Menu Script 7 현문 2010.10.06 4077
1012 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
1011 이동 및 탈것 3D 캐릭 스크립트 7 백호 2009.02.22 3443
1010 기타 3D스크립트 48 file ok하승헌 2010.02.18 3808
1009 기타 4방향 마우스 스크립트 12 file 아방스 2009.02.28 2662
1008 기타 8방향 마우스 스크립트 10 file 아방스 2009.02.28 4063
1007 이동 및 탈것 8방향 스크립트 12 file 백호 2009.02.21 2412
1006 이동 및 탈것 8방향 이동 & 대쉬 스크립트 5 백호 2009.02.21 1703
1005 이동 및 탈것 8방향움직임과 8방향 캐릭터칩 호환 2 file 백호 2009.02.21 2274
1004 이동 및 탈것 8방향이동 9 캉쿤 2011.09.19 2529
1003 이동 및 탈것 8방향이동, Shift키 누르면 대쉬 63 WinHouse 2010.06.12 4025
1002 전투 A-battle 수정 file 백호 2009.02.21 1155
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52