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 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
1020 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3335
1019 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2972
1018 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
1017 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2004
1016 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
1015 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6561
1014 미니맵 화면에 축소된 미니맵을 표시하는 스크립트 - 한글 번역 - 6 file 백호 2009.02.21 2559
1013 화면에 축소된 맵을 표시하는 스크립트 7 file 백호 2009.02.21 2394
1012 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2137
1011 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2592
1010 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2528
1009 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
1008 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 493
1007 메시지 한글자씩 뜨는 스크립트 6 백호 2009.02.21 3001
1006 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
1005 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
1004 키입력 한글입력기 6 백호 2009.02.22 4297
1003 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4205
1002 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
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