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
161 장비 장비무기가이드&쉴드방어 1 백호 2009.02.22 1179
160 장비 장비착용시 올스탯 표시 2 file 백호 2009.02.21 1664
159 장비 장비창 개조 스크립트 from Harts Horn 7 백호 2009.02.22 1769
158 장비 장비창업그레이드 ps인간 2009.01.23 2478
157 장비 장비창을 다른거로 바꾸기 [헬악이님 제공] 10 file 아방스 2007.11.09 3049
156 장비 장비품개조 - KGC_AlterEquipment (8/12일자) 2 file 백호 2009.02.22 1694
155 저상 슬롯 15개 스크립트 9 WMN 2008.03.18 1496
154 전투 적 한계 HP수치 돌파 스크립트 ■ RPGモジュール 3 쉴더 2009.02.21 1783
153 HUD 적의 남은 HP만큼 적의 이름 색깔 변하는 스크립트 6 file 백호 2009.02.21 2337
152 전투 적의 여러차례 행동 스크립트 1 백호 2009.02.22 1321
151 키입력 전체 키 사용 스크립트 1 백호 2009.02.21 1423
150 장비 전체키 이용을 위한 장비창 스크립트 백호 2009.02.21 1234
149 키입력 전체키 입력 스크립트 v4 by Cybersam 5 file 백호 2009.02.22 1947
148 전체화면 스크립트[해상도 스크립트랑 중복사용 불가] 24 file - 하늘 - 2009.08.06 3975
147 전투 전투 결과 화면 개조 스크립트 10 file 백호 2009.02.21 2496
146 전투 전투 관련 횟수 취득 스크립트 백호 2009.02.21 783
145 전투 전투 난이도 설정 스크립트 file 백호 2009.02.21 1441
144 전투 전투 속도 조정 스크립트 2 file 백호 2009.02.21 1261
143 기타 전투 승리 BGM+페이드아웃 스크립트 1 file 백호 2009.02.21 1159
142 전투 전투 카메라 스크립트 5 file 백호 2009.02.21 2454
Board Pagination Prev 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Next
/ 52