Ace 스크립트

break_screen.jpgcraft_screen.jpg

 

자세한 기능 : http://rpgmaker.net/scripts/319/

 

 

#==============================================================================
# Coelocanth's item crafting system
# Version: 0.9.4 (beta)
#==============================================================================
# License Information:
# Free for non commercial use.
# Please give attribution in your credits file.
#
# Commercial use is permitted in exchange for a free copy of the full game,
# and attribution in your credits file and any in game credits.
#
#==============================================================================
# Crafting system
#
# Concept:
#
# Crafting assembles a new item by consuming ingredients.
# If you don't have the required ingredients, the item will be
# disabled in the crafting interface
#
# A recipe may be required to know how to craft an item
# One recipe can cover any number of items
# (e.g. a blacksmithing for beginners book could be the recipe for
# tier 1-2 weapons and armors in your game)
# If you don't have the recipe, the item won't even show up in the
# crafting interface.
#
# A tool may be required to craft an item.
# Tools are like ingredients but not consumed.
# (e.g. you need an alchemist's still to craft elixirs)
# If you don't have the tool, the item will be disabled in the
# crafting interface
#
# Ingredients to craft an item are specified by notetags
# on the item that can be crafted.
#
# <craft item:id>            - consume 1 item in crafting
# <craft item:id:quantity>   - consume (quantity) of item in crafting
# <craft weapon:id>          - consume 1 item in crafting
# <craft weapon:id:quantity> - consume (quantity) of item in crafting
# <craft armor:id>           - consume 1 item in crafting
# <craft armor:id:quantity>  - consume (quantity) of item in crafting
# <craft gold:quantity>      - price to craft this recipe
# <craft recipe:id>          - item id required to be able to see this
#                              craftable item in the interface
# <craft switch:id>          - game switch must be ON to see this recipe
# <craft tool:id>            - item id is required to craft this item,
#                              but is not consumed
#
# Additionally, there are tags to allow items to be broken down
# into ingredients.
#
# <craft break item:id>            - give 1 item in breakdown
# <craft break item:id:quantity>   - give (quantity) of item in breakdown
# <craft break weapon:id>          - give 1 item in breakdown
# <craft break weapon:id:quantity> - give (quantity) of item in breakdown
# <craft break armor:id>           - give 1 item in breakdown
# <craft break armor:id:quantity>  - give (quantity) of item in breakdown
# <craft break gold:quantity>      - price to perform this breakdown
# <craft break recipe:id>          - item id required to be able to see this
#                                    breakable item in the interface
# <craft break switch:id>          - game switch must be ON to see this recipe
# <craft break tool:id>            - item id is required to break this item.
#
# example: crafting a partisan requires 3 iron bars and a spear.
# And it can be broken down to give 2 iron bars back.
# <craft item:72:3>
# <craft weapon: 13>
# <craft break item:72:2>
#
# example: crafting spicy soup requires potato, meat and chilli
#          as well as a cauldron tool to cook it in.
# <craft item: 74>
# <craft item: 75>
# <craft item: 76>
# <craft tool: 80>
#
# Integration:
#
# By default, "Crafting" and "Breakdown" commands are added to the menu.
# To change this, or control when the commands are available, set the
# configuration variables in the section below.
#
# To call the crafting system from an event, use a script item:
# SceneManager.call(Scene_Crafting)
# Fiber.yield
#
# To call the breakdown system from an event, use a script item:
# SceneManager.call(Scene_Craft_Breakdown)
# Fiber.yield
#
#==============================================================================
# Version History
# 0.9.4: Crafting shop features:
#        - gold price to craft
#        - switch to allow different shops to enable different recipes
# 0.9.3: Fixed script error on OK key when recipe window is empty
# 0.9.2: Added breakdown system and title texts
# 0.9.1: Fixed capturing of item counts in craft tags
#        Visual improvements to ingredient window
# 0.9.0: Initial release
#==============================================================================
#
# Script configuration
#
module CRAFTING
  # Should crafting be available from the menu?
  # If not, set to false.
  MENU_COMMAND = true
  # Label for the menu command
  MENU_COMMAND_TEXT = "Crafting"
  # Menu command is always enabled?
  MENU_COMMAND_ENABLE = true
  # Menu command enabled by switch?
  # set to the switch number to use that switch.
  MENU_COMMAND_SWITCH = 0
  # Menu command enabled when specific actor ID in party?
  MENU_COMMAND_ACTOR = 0
  # Menu command enabled when specific class ID in party?
  MENU_COMMAND_CLASS = 0
  # Text for ingredients panel, note \\ is needed in ruby where \ is used in DB
  TEXT_INGREDIENTS_TITLE = "\\c[6]Ingredients:"
  TEXT_INGREDIENTS_TOOLS = "\\c[6]Tools:"
  TEXT_INGREDIENTS_PRICE = "\\c[6]Price:"
end

module CRAFT_BREAK
  # Should breakdown be available from the menu?
  # If not, set to false.
  MENU_COMMAND = true
  # Label for the menu command
  MENU_COMMAND_TEXT = "Breakdown"
  # Menu command is always enabled?
  MENU_COMMAND_ENABLE = true
  # Menu command enabled by switch?
  # set to the switch number to use that switch.
  MENU_COMMAND_SWITCH = 0
  # Menu command enabled when specific actor ID in party?
  MENU_COMMAND_ACTOR = 0
  # Menu command enabled when specific class ID in party?
  MENU_COMMAND_CLASS = 0
  # Text for ingredients panel, note \\ is needed in ruby where \ is used in DB
  TEXT_INGREDIENTS_TITLE = "\\c[2]Breakdown Results:"
  TEXT_INGREDIENTS_TOOLS = "\\c[2]Tools:"
  TEXT_INGREDIENTS_PRICE = "\\c[6]Price:"
end
#==============================================================================
# Here be dragons...
#==============================================================================

#==============================================================================
# DataManager
# Hook to read notetags after database load
#==============================================================================

module DataManager
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_crafting load_database; end
  def self.load_database
    load_database_crafting
    load_notetags_crafting
  end
 
  #--------------------------------------------------------------------------
  # new method: load_notetags_crafting
  #--------------------------------------------------------------------------
  def self.load_notetags_crafting
    groups = [$data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_crafting
      end
    end
  end
 
end # DataManager

#==============================================================================
# RPG::BaseItem
# Parse notetags when loading items from the database.
# Adds readable properties for the ingredient lists.
#==============================================================================

class RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_reader :crafting_items
  attr_reader :crafting_weapons
  attr_reader :crafting_armors
  attr_reader :crafting_recipes
  attr_reader :crafting_tools
  attr_reader :crafting_gold
  attr_reader :crafting_switches

  attr_reader :craft_break_items
  attr_reader :craft_break_weapons
  attr_reader :craft_break_armors
  attr_reader :craft_break_recipes
  attr_reader :craft_break_tools
  attr_reader :craft_break_gold
  attr_reader :craft_break_switches
   
  #--------------------------------------------------------------------------
  # common cache: load_notetags_crafting
  #--------------------------------------------------------------------------
  #<craft item:68>
  #<craft item:68:3>
  def load_notetags_crafting
    @crafting_items = {}
    @crafting_weapons = {}
    @crafting_armors = {}
    @crafting_recipes = {}
    @crafting_tools = {}
    @crafting_switches = []
    @crafting_gold = 0

    @craft_break_items = {}
    @craft_break_weapons = {}
    @craft_break_armors = {}
    @craft_break_recipes = {}
    @craft_break_tools = {}
    @craft_break_switches = []
    @craft_break_gold = 0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when /<craft item:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @crafting_items[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft weapon:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @crafting_weapons[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft armor:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @crafting_armors[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft recipe:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @crafting_recipes[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft tool:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @crafting_tools[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft switch:[[:space:]]*(\d+)>/i
        @crafting_switches.push($1.to_i)
      when /<craft gold:[[:space:]]*(\d+)>/i
        @crafting_gold = $1.to_i

      when /<craft break item:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @craft_break_items[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft break weapon:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @craft_break_weapons[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft break armor:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @craft_break_armors[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft break recipe:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @craft_break_recipes[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft break tool:[[:space:]]*(\d+(?:[[:space:]]*:[[:space:]]*(\d+)){0,1})>/i
        @craft_break_tools[$1.to_i] = ($2 ? $2.to_i : 1)
      when /<craft break switch:[[:space:]]*(\d+)>/i
        @crafting_switches.push($1.to_i)
      when /<craft break gold:[[:space:]]*(\d+)>/i
        @craft_break_gold = $1.to_i
      end
    } # self.note.split
    #---
  end
 
  def is_craftable?
    !(@crafting_items.empty? && \
       @crafting_weapons.empty? && \
       @crafting_armors.empty? && \
       @crafting_recipes.empty? && \
       @crafting_tools.empty? && \
       @crafting_switches.empty? && \
       @crafting_gold == 0)
  end

  def is_craft_breakable?
    !(@craft_break_items.empty? && \
       @craft_break_weapons.empty? && \
       @craft_break_armors.empty? && \
       @craft_break_recipes.empty? && \
       @craft_break_tools.empty? && \
       @craft_break_switches.empty? && \
       @craft_break_gold == 0)
  end
end # RPG::BaseItem

#==============================================================================
# Window_MenuCommand
# Integrate crafting command
#==============================================================================
class Window_MenuCommand < Window_Command
  alias add_original_commands_crafting add_original_commands
  def add_original_commands
    add_original_commands_crafting
    if (CRAFTING::MENU_COMMAND)
      enable = CRAFTING::MENU_COMMAND_ENABLE
      if (!enable && CRAFTING::MENU_COMMAND_SWITCH)
        enable = $game_switches[CRAFTING::MENU_COMMAND_SWITCH]
      end
      if (!enable && CRAFTING::MENU_COMMAND_ACTOR)
        required = $game_actors[CRAFTING::MENU_COMMAND_ACTOR]
        enable = $game_party.members.include?(required)
      end
      if (!enable && CRAFTING::MENU_COMMAND_CLASS)
        enable = $game_party.members.map { |a| a.class_id }\
          .include?(CRAFTING::MENU_COMMAND_CLASS)
      end
      add_command(CRAFTING::MENU_COMMAND_TEXT, :crafting, enable)
    end

    if (CRAFT_BREAK::MENU_COMMAND)
      enable = CRAFT_BREAK::MENU_COMMAND_ENABLE
      if (!enable && CRAFT_BREAK::MENU_COMMAND_SWITCH)
        enable = $game_switches[CRAFT_BREAK::MENU_COMMAND_SWITCH]
      end
      if (!enable && CRAFT_BREAK::MENU_COMMAND_ACTOR)
        required = $game_actors[CRAFT_BREAK::MENU_COMMAND_ACTOR]
        enable = $game_party.members.include?(required)
      end
      if (!enable && CRAFT_BREAK::MENU_COMMAND_CLASS)
        enable = $game_party.members.map { |a| a.class_id }\
          .include?(CRAFT_BREAK::MENU_COMMAND_CLASS)
      end
      add_command(CRAFT_BREAK::MENU_COMMAND_TEXT, :craft_break, enable)
    end

  end
end

class Scene_Menu < Scene_MenuBase
  def command_crafting
    SceneManager.call(Scene_Crafting)
  end

  def command_craft_break
    SceneManager.call(Scene_Craft_Breakdown)
  end

  alias create_command_window_crafting create_command_window
  def create_command_window
    create_command_window_crafting
    @command_window.set_handler(:crafting, method(:command_crafting))
    @command_window.set_handler(:craft_break, method(:command_craft_break))
  end
end

#==============================================================================
# Recipe list window, for the crafting scene.
# It's based on the item list, but populated with items the player
# knows the crafting recipe for, rather than current inventory
#==============================================================================
class Window_RecipeList < Window_ItemList
  attr_accessor :ingredient_window
 
  def initialize(x,y,width, height)
    super(x, y, width, height)
    @data = []
    refresh
  end
 
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
 
  def make_item_list
    tdata = $data_items.compact + $data_weapons.compact + $data_armors.compact
    @data = tdata.select { |item| include?(item) }
  end
 
  def item_max
    @data ? @data.size : 1
  end
 
  def col_max
    1
  end
 
  def include?(item)
    ok = super && item && item.is_craftable?
    if ok
      item.crafting_recipes.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
      item.crafting_switches.each { |id| ok &= $game_switches[id] }
    end
    ok
  end

  def enable?(item)
    ok = false
    if item
      ok = ($game_party.gold >= item.crafting_gold)
      item.crafting_items.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
      item.crafting_weapons.each \
      { |key,value| ok &= $game_party.item_number($data_weapons[key]) >= value }
      item.crafting_armors.each \
      { |key,value| ok &= $game_party.item_number($data_armors[key]) >= value }
      item.crafting_recipes.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
      item.crafting_tools.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
    end
    ok
  end
 
  def update_help
    @help_window.set_item(item)
    @ingredient_window.set_item(item)
  end
end

#==============================================================================
# Base ingredient list window
# common to crafting ingredients and breakdown results.
#==============================================================================
class Window_IngredientListBase < Window_Base
  def initialize(x,y,width, height)
    super(x, y, width, height)
    @ingredients_title = "Ingredients:"
    @ingredients = []
    @tools_title = "Tools:"
    @tools = []
    @price_title = "Price:"
    @gold = 0
    @recipe_item = nil
    refresh
  end
 
  def set_item(item)
    @recipe_item = item
    refresh
  end
 
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
 
  def make_metadata(item, need)
    metadata = {item: item}
    metadata[:got] = $game_party.item_number(item)
    metadata[:need] = need
    metadata
  end
 
  def make_item_list
    @ingredients = []
    @tools = []
    @gold = 0
  end
 
  def draw_all_items
    # title text
    ypos = calc_line_height(@ingredients_title)
    draw_text_ex(0,0, @ingredients_title)
    reset_font_settings
    # ingredient list
    @ingredients.each {|item| draw_item(item, ypos); ypos += line_height }
    # tools separator text
    if (@tools.size > 0)
      draw_text_ex(0,ypos, @tools_title)
      ypos += calc_line_height(@tools_title)
      reset_font_settings
      # tools list
      @tools.each {|item| draw_item(item, ypos); ypos += line_height }
    end
    # gold?
    if @gold != 0
      ypos = draw_gold(ypos)
    end
  end

  def item_max
    @data ? @data.size : 1
  end
 
  def col_max
    1
  end

  # override - adding enable flag
  def draw_currency_value(value, unit, x, y, width, enable = true)
    cx = text_size(unit).width
    change_color(normal_color, enable)
    draw_text(x, y, width - cx - 2, line_height, value, 2)
    change_color(system_color)
    draw_text(x, y, width, line_height, unit, 2)
  end

  def draw_gold(ypos)
    got = $game_party.gold

    have_enough = got >= @gold
    draw_text_ex(0, ypos, @price_title)
    ypos += calc_line_height(@price_title)
    draw_currency_value(@gold, Vocab::currency_unit, 0, ypos, contents_width, have_enough)
    ypos += line_height
    return ypos
  end

  def draw_item(item, ypos)
    if item
      have_enough = item[:got] >= item[:need]
      color = have_enough ? normal_color : power_down_color
      draw_item_name(item[:item], 0, ypos, have_enough)
      draw_current_and_max_values(contents_width - 96, ypos, \
                                  96, item[:got], item[:need], \
                                  color, normal_color)
    end
  end

  def update_help
    @help_window.set_item(item)
  end
end

#==============================================================================
# ingredient list window
# shows what the player needs to craft an item
#==============================================================================
class Window_IngredientList < Window_IngredientListBase
  def initialize(x,y,width, height)
    super(x, y, width, height)
    @ingredients_title = CRAFTING::TEXT_INGREDIENTS_TITLE
    @tools_title = CRAFTING::TEXT_INGREDIENTS_TOOLS
    @price_title = CRAFTING::TEXT_INGREDIENTS_PRICE
    refresh
  end

  def make_item_list
    super
    if @recipe_item
      @recipe_item.crafting_items.each \
      { |key,value| @ingredients.push(make_metadata($data_items[key], value)) }
      @recipe_item.crafting_weapons.each \
      { |key,value| @ingredients.push(make_metadata($data_weapons[key], value)) }
      @recipe_item.crafting_armors.each \
      { |key,value| @ingredients.push(make_metadata($data_armors[key], value)) }

      @gold = @recipe_item.crafting_gold

      @recipe_item.crafting_recipes.each \
      { |key,value| @tools.push(make_metadata($data_items[key], value)) }
      @recipe_item.crafting_tools.each \
      { |key,value| @tools.push(make_metadata($data_items[key], value)) }
    end
  end

end

#==============================================================================
# Common code for crafting and breakdown scenes.
#==============================================================================
class Scene_CraftBase < Scene_MenuBase
  def start
    super
    create_help_window
    create_category_window
    create_recipe_list
    create_ingredient_list
  end
 
  #--------------------------------------------------------------------------
  # * Create Category Window
  #--------------------------------------------------------------------------
  def create_category_window
    @category_window = Window_ItemCategory.new
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.y = @help_window.height
    @category_window.set_handler(:ok,     method(:on_category_ok))
    @category_window.set_handler(:cancel, method(:return_scene))
  end

  def create_recipe_list
    wy = @category_window.y + @category_window.height
    wh = Graphics.height - wy
    @recipe_window = Window_RecipeList.new(0,wy,Graphics.width / 2, wh)
    @recipe_window.help_window = @help_window
    @recipe_window.set_handler(:cancel, method(:on_item_cancel))
    @recipe_window.set_handler(:ok,     method(:on_item_ok))
    @category_window.item_window = @recipe_window
  end
 
  #--------------------------------------------------------------------------
  # * Get Currently Selected Item
  #--------------------------------------------------------------------------
  def item
    @recipe_window.item
  end
  #--------------------------------------------------------------------------
  # * Category [OK]
  #--------------------------------------------------------------------------
  def on_category_ok
    @recipe_window.activate
    @recipe_window.select_last
  end
  #--------------------------------------------------------------------------
  # * Item [Cancel]
  #--------------------------------------------------------------------------
  def on_item_cancel
    @recipe_window.unselect
    @ingredient_window.set_item(nil)
    @category_window.activate
  end
end

#==============================================================================
# Crafting scene
#==============================================================================
class Scene_Crafting < Scene_CraftBase
  #--------------------------------------------------------------------------
  # * Item [OK]
  # remove ingredients, add new item to inventory
  #--------------------------------------------------------------------------
  def on_item_ok
    Sound.play_ok
    item.crafting_items.each \
    { |key,value| ok &= $game_party.gain_item($data_items[key], -value) }
    item.crafting_weapons.each \
    { |key,value| ok &= $game_party.gain_item($data_weapons[key], -value) }
    item.crafting_armors.each \
    { |key,value| ok &= $game_party.gain_item($data_armors[key], -value) }
    $game_party.gain_item(item, 1)
    $game_party.lose_gold(item.crafting_gold)
    @recipe_window.refresh
    @recipe_window.activate
  end

  def create_ingredient_list
    wx = @recipe_window.x + @recipe_window.width
    wy = @category_window.y + @category_window.height
    wh = Graphics.height - wy
    @ingredient_window = \
      Window_IngredientList.new(wx,wy,Graphics.width / 2, wh)
    @recipe_window.ingredient_window = @ingredient_window
  end

  def create_recipe_list
    wy = @category_window.y + @category_window.height
    wh = Graphics.height - wy
    @recipe_window = Window_RecipeList.new(0,wy,Graphics.width / 2, wh)
    @recipe_window.help_window = @help_window
    @recipe_window.set_handler(:cancel, method(:on_item_cancel))
    @recipe_window.set_handler(:ok,     method(:on_item_ok))
    @category_window.item_window = @recipe_window
  end
end

#==============================================================================
# Breakdown "recipe list"
# Uses player inventory, but filters out items that don't have
# a breakdown recipe in their tags.
#==============================================================================
class Window_BreakdownRecipeList < Window_ItemList
  attr_accessor :ingredient_window

  def initialize(x,y,width, height)
    super(x, y, width, height)
    @data = []
    refresh
  end

  def refresh
    make_item_list
    create_contents
    draw_all_items
  end

  def item_max
    @data ? @data.size : 1
  end

  def col_max
    1
  end

  def include?(item)
    ok = super && item && item.is_craft_breakable?
    if ok
      item.craft_break_recipes.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
      item.craft_break_switches.each { |id| ok &= $game_switches[id] }
    end
    ok
  end

  def enable?(item)
    ok = false
    if item
      ok = ($game_party.gold >= item.craft_break_gold)
      item.craft_break_recipes.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
      item.craft_break_tools.each \
      { |key,value| ok &= $game_party.item_number($data_items[key]) >= value }
    end
    ok
  end

  def update_help
    @help_window.set_item(item)
    @ingredient_window.set_item(item)
  end
end

#==============================================================================
# Breakdown results
# Uses different item tags and title text from ingredients list
#==============================================================================
class Window_BreakdownResultList < Window_IngredientListBase
  def initialize(x,y,width, height)
    super(x, y, width, height)
    @ingredients_title = CRAFT_BREAK::TEXT_INGREDIENTS_TITLE
    @tools_title = CRAFT_BREAK::TEXT_INGREDIENTS_TOOLS
    @price_title = CRAFT_BREAK::TEXT_INGREDIENTS_PRICE
    refresh
  end

  def make_item_list
    super
    if @recipe_item
      @recipe_item.craft_break_items.each \
      { |key,value| @ingredients.push(make_metadata($data_items[key], value)) }
      @recipe_item.craft_break_weapons.each \
      { |key,value| @ingredients.push(make_metadata($data_weapons[key], value)) }
      @recipe_item.craft_break_armors.each \
      { |key,value| @ingredients.push(make_metadata($data_armors[key], value)) }

      @gold = @recipe_item.craft_break_gold

      @recipe_item.craft_break_recipes.each \
      { |key,value| @tools.push(make_metadata($data_items[key], value)) }
      @recipe_item.craft_break_tools.each \
      { |key,value| @tools.push(make_metadata($data_items[key], value)) }
    end
  end
end

#==============================================================================
# Breakdown scene
#==============================================================================
class Scene_Craft_Breakdown < Scene_CraftBase
  #--------------------------------------------------------------------------
  # * Item [OK]
  #--------------------------------------------------------------------------
  def on_item_ok
    Sound.play_ok
    item.craft_break_items.each \
    { |key,value| ok &= $game_party.gain_item($data_items[key], value) }
    item.craft_break_weapons.each \
    { |key,value| ok &= $game_party.gain_item($data_weapons[key], value) }
    item.craft_break_armors.each \
    { |key,value| ok &= $game_party.gain_item($data_armors[key], value) }
    $game_party.gain_item(item, -1)
    $game_party.lose_gold(item.craft_break_gold)
    @recipe_window.refresh
    @recipe_window.activate
  end

  def create_ingredient_list
    wx = @recipe_window.x + @recipe_window.width
    wy = @category_window.y + @category_window.height
    wh = Graphics.height - wy
    @ingredient_window = \
      Window_BreakdownResultList.new(wx,wy,Graphics.width / 2, wh)
    @recipe_window.ingredient_window = @ingredient_window
  end

  def create_recipe_list
    wy = @category_window.y + @category_window.height
    wh = Graphics.height - wy
    @recipe_window = Window_BreakdownRecipeList.new(0,wy,Graphics.width / 2, wh)
    @recipe_window.help_window = @help_window
    @recipe_window.set_handler(:cancel, method(:on_item_cancel))
    @recipe_window.set_handler(:ok,     method(:on_item_ok))
    @category_window.item_window = @recipe_window
  end
end

Who's 스리아씨

?
뺘라뺘뺘
Atachment
첨부 '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5110
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 28925
137 퀘스트 Quest Journal by modern algebra 11 file 습작 2013.05.03 3695
136 아이템 VXAce 셋트장비 스크립트 9 file 아이미르 2013.03.08 3642
135 HUD Galv's Explorer's HUD 4 file 천공대전 2013.07.21 3638
134 HUD SpriteIcon - 화면에 아이콘 그리기 4 file 허걱 2013.02.24 3630
133 퀘스트 CSCA]콜로세움 시스템 4 file 글쎄,왜 난 적용이 안될까? 2013.06.09 3623
132 메시지 N.A.S.T.Y. Text Pop Over Events 3 file Mimesis 2013.04.08 3619
131 메시지 한국어 조사처리 스크립트 7 Ilike게임 2012.10.09 3603
130 장비 장비 장착을 통한 스킬 습득 및 삭제 4 아이미르 2012.02.05 3597
129 액터 Actor Creation System by Tsukihime 4 Alkaid 2012.09.16 3552
128 타이틀/게임오버 [VX ACE]타이틀 화면에 맵을 표시하는 스크립트 4 file 스리아씨 2013.12.07 3540
127 메뉴 스텟을 랭크로 나타내기 7 file Yeolde 2014.05.10 3536
126 맵/타일 Etude87_Map_Remember_Ace ver.1.2 11 습작 2012.07.17 3516
125 메시지 Etude87_VX_Style_Choice ver.1.00 11 file 습작 2013.02.14 3482
124 맵/타일 MGC님의 Mode 7 Ace 6 file 습작 2013.10.27 3469
123 기타 Picture Gallery Ace by MogHunter 1 Alkaid 2011.12.28 3456
122 메뉴 System Options v1.00 시스템 환경설정, 이동속도 10 file 믛디 2013.07.18 3447
121 타이틀/게임오버 시작 전 로고 띄우기 7 file 냐냐 2014.12.04 3368
120 메시지 ListBox - 선택지 확장 스크립트 11 file 허걱 2014.04.03 3368
119 변수/스위치 Etude87_Variables_Ace 6 file 습작 2012.04.13 3368
118 변수/스위치 TYPE74RX-T: 셀프 스위치를 실시간으로 조작 Alkaid 2011.12.23 3339
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11