加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我仿造F1里面的技能消耗物品写了一个技能消耗变量,运行的时候报错,求大触帮忙看下。感谢
class RPG::Skill def variables_cost /<ITEM_COST\s*(\d+)>/ =~ note ? $1.to_i : 0 end end class Game_Actor alias jsgj_skill_cost_payable? skill_cost_payable? def skill_cost_payable?(skill) variables = $game_variables jsgj_skill_cost_payable?(skill) && (!variables || $game_variables > 0 ?(variables)) end end class Game_Actor alias jsgj_pay_skill_cost pay_skill_cost def pay_skill_cost(skill) jsgj_pay_skill_cost(skill) variables = $game_variables[skill.variables_cost] $game_party.$game_variables -= 1 if variables end end
class RPG::Skill
def variables_cost
/<ITEM_COST\s*(\d+)>/ =~ note ? $1.to_i : 0
end
end
class Game_Actor
alias jsgj_skill_cost_payable? skill_cost_payable?
def skill_cost_payable?(skill)
variables = $game_variables
jsgj_skill_cost_payable?(skill) &&
(!variables || $game_variables > 0 ?(variables))
end
end
class Game_Actor
alias jsgj_pay_skill_cost pay_skill_cost
def pay_skill_cost(skill)
jsgj_pay_skill_cost(skill)
variables = $game_variables[skill.variables_cost]
$game_party.$game_variables -= 1 if variables
end
end
|