#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# Sample master list for crafting script
# written by Deke
#============================================================================================
# 简介:
# 这是一个很不错的合成物品系统,可以通过游戏的过程,不断学习可以合成的
# 物品方法。
#
# 使用方法:
# 1、召唤界面:使用脚本$scene = Scene_Craft.new
#
# 2、学习合成:$game_party.learn_recipe(合成项目)
#
# 3、合成定义:
# 这个合成脚本可以定义两种合成物品。一种是预先定义好了的,就像下面这样,
# 直接写在这里就可以,另一种是在学习之前现场定义。
#
# 4、举例
# 4.1、学会recipe_list[1]定义的合成:$game_party.learn_recipe($game_temp.recipe_list[1])
# 注意,一行如果输入不下,在(的后面或[的后面按回车换行,否则可能出错
#
# 4.2、在游戏中临时定义一种合成,让玩家学会。使用事件中的脚本如下,
# 脚本:
# 材料 = [$game_variables[1],$game_variables[2]] #——材料编号是变量1、2的编号
# 材料种类 = [0,0] #——材料是物品
# 材料数量 = [$game_variables[3],$game_variables[4]] #——需要材料数量是变量3、4的编号
# 成品 = $game_variables[5] #——获得结果编号是5
# 成品种类 = 1 #——成品是防具类
# $game_party.learn_recipe(Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类))
#===========================================================================================
class Game_Temp
attr_reader :recipe_list
alias crafting_temp_initialize initialize
def initialize
crafting_temp_initialize
@recipe_list=[]
get_recipe_list
end
def get_recipe_list
##########################################################################
#合成:XXX
##########################################################################
材料 = [X,X,X] # 需要材料的数据库编号
材料种类 = [X,X,X] # 需要材料的种类,0是普通物品,1是防具,2是武器
材料数量 = [X,X,X] # 需要材料的数量
成品 = X # 获得物品编号
成品种类 = X # 获得物品种类,0是普通物品,1是防具,2是武器
@recipe_list[10] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
end # of get_recipe_list method
end # of updates to Game_Temp Class
#================================
# CRAFTING PROGRAM
#----------------------------------------------------------------
#-written by Deke
#-yes_no window code created by Phsylomortis
#----------------------------------------------------------------
#================================
#updates to Game_Party class
class Game_Party
attr_accessor :recipes
alias crafting_party_initialize initialize
def initialize
crafting_party_initialize
@recipes=[]
end
#----------------------------------------------------------------------
def know?(recipe, version = 1)
unless recipe.is_a?(Game_Recipe)
recipe = get_recipe_from_master_list(recipe, version)
end
return $game_party.recipes.include?(recipe)
end
#----------------------------------------------------------------------
def learn_recipe(recipe , version = 1)
unless recipe.is_a?(Game_Recipe)
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# Sample master list for crafting script
# written by Deke
#============================================================================================
# 简介:
# 这是一个很不错的合成物品系统,可以通过游戏的过程,不断学习可以合成的
# 物品方法。
#
# 使用方法:
# 1、召唤界面:使用脚本$scene = Scene_Craft.new
#
# 2、学习合成:$game_party.learn_recipe(合成项目)
#
# 3、合成定义:
# 这个合成脚本可以定义两种合成物品。一种是预先定义好了的,就像下面这样,
# 直接写在这里就可以,另一种是在学习之前现场定义。
#
# 4、举例
# 4.1、学会recipe_list[1]定义的合成:$game_party.learn_recipe($game_temp.recipe_list[1])
# 注意,一行如果输入不下,在(的后面或[的后面按回车换行,否则可能出错
#
# 4.2、在游戏中临时定义一种合成,让玩家学会。使用事件中的脚本如下,
# 脚本:
# 材料 = [$game_variables[1],$game_variables[2]] #——材料编号是变量1、2的编号
# 材料种类 = [0,0] #——材料是物品
# 材料数量 = [$game_variables[3],$game_variables[4]] #——需要材料数量是变量3、4的编号
# 成品 = $game_variables[5] #——获得结果编号是5
# 成品种类 = 1 #——成品是防具类
# $game_party.learn_recipe(Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类))
#===========================================================================================
class Game_Temp
attr_reader :recipe_list
alias crafting_temp_initialize initialize
def initialize
crafting_temp_initialize
@recipe_list=[]
get_recipe_list
end
def get_recipe_list
##########################################################################
#合成:XXX
##########################################################################
材料 = [X,X,X] # 需要材料的数据库编号
材料种类 = [X,X,X] # 需要材料的种类,0是普通物品,1是防具,2是武器
材料数量 = [X,X,X] # 需要材料的数量
成品 = X # 获得物品编号
成品种类 = X # 获得物品种类,0是普通物品,1是防具,2是武器
@recipe_list[10] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类)
end # of get_recipe_list method
end # of updates to Game_Temp Class
#================================
# CRAFTING PROGRAM
#----------------------------------------------------------------
#-written by Deke
#-yes_no window code created by Phsylomortis
#----------------------------------------------------------------
#================================
#updates to Game_Party class
class Game_Party
attr_accessor :recipes
alias crafting_party_initialize initialize
def initialize
crafting_party_initialize
@recipes=[]
end
#----------------------------------------------------------------------
def know?(recipe, version = 1)
unless recipe.is_a?(Game_Recipe)
recipe = get_recipe_from_master_list(recipe, version)
end
return $game_party.recipes.include?(recipe)
end
#----------------------------------------------------------------------
def learn_recipe(recipe , version = 1)
unless recipe.is_a?(Game_Recipe)