module Battle_System
alias_method :process_skill_cost_base_MODNAME, :process_skill_cost
def process_skill_cost(skill)
# process_skill_cost_base_MODNAME(skill)
process_skill_cost_compare_MODNAME(skill)
end
def process_skill_cost_compare_MODNAME(skill)
skill.cost.each{
|cost|
cost_val = self.battle_stat.get_stat(cost.base.attr,cost.base.attr_type)
cost_val = get_affected_attr(cost.base) - get_affected_attr(cost.compare)
self.battle_stat.set_stat(cost.base.attr,cost_val,cost.base.attr_type)
}
end
alias_method :process_skill_cost_reverse_base_MODNAME, :process_skill_cost_reverse
def process_skill_cost_reverse(skill)
# process_skill_cost_reverse_base_MODNAME(skill)
process_skill_cost_reverse_compare_MODNAME(skill)
end
def process_skill_cost_reverse_compare_MODNAME(skill)
skill.cost.each{
|cost|
cost_val1=self.battle_stat.get_stat(cost.base.attr,cost.base.attr_type)
cost_val2= cost_val1 - ( get_affected_attr(cost.base) - get_affected_attr(cost.compare) )
cost_val2= (cost_val2*0.5).to_i
cost_val3=cost_val1+cost_val2
self.battle_stat.set_stat(cost.base.attr,cost_val3,cost.base.attr_type)
}
end
end
—————————
Simply use this code as mod. This method allow to use value of another stat (or percent of it), to decrease (or increase) base cost of skill. Using compare in skill's cost data.
I found that "cost" - "compare" in skills data doesn't work. And then i fixed it, or figured out a way to use it.
For example, now you can use (one percent of?) constitution trait to decrease (or increase) cost (in sta) of skill. Or ony another stat instead of constitution trait.
Or you can do something strange.
First cost [{}] in sta (cost=3), compare with constitution trait * (0.01). But second cost [{}] in this skill in sta too, but base cost=0, and compare in mood * (0.01). And it's gonna go like this, constitution trait will decrease cost, and positive mood wil decrease too, but negative mood will increase cost.