For those coming from the 'new topic' column, this is a VX Ace request.
I want spells in my game to be based on the user's MAT stat. If the user's MAT is 10, then the MP cost is 10. If MAT is 20, then MP cost is 20.
I tried messing with Yanfly's Skill cost script, and while it's probably possible through a roundabout method, it does not allow me to use display the costs as evals like his MV plugin does. I thought I found a patch from estiole, but it does not appear to work.
I keep feeling like I'm close to the answer, but I can't quite put my finger on it.
MP cost based on Actor's Magic stat
● ARCHIVED · READ-ONLY
-
-
Should work technically
Code:class Game_Actor def skill_mp_cost(skill) return self.mat if skill.id == xxx return super end end -
That was easier than I expected. Thank you.
Just one thing, how can I create multiple instances of this? I know I can use || (or) for spells costing the same MP. But if I wanted other skills to be self.mat * 2. I tried to implement that as a separate line, but it all goes to whatever is displayed first (meaning it's all self.mat regardless if I have mat*2 or mat/2).
Edit: NM, I got it to work with code like this:
class Game_Actor
def skill_mp_cost(skill)
return self.mat if skill.id == 13
return self.mat if skill.id == 22
return self.mat*2 if skill.id == 27
return super
end
end -
Code:
class Game_Actor def skill_mp_cost(skill) case skill.id when 20 return <formula A> when 21 return <formula B> else # use default on database return super end end end