Skill cost equal to target's current HP/MP?

SilentZeroX

Villager
Member
Joined
Oct 29, 2016
Messages
14
Reaction score
2
First Language
English
Primarily Uses
Hey there! So what I want should be pretty simple to understand (though not simple to actually do, otherwise I wouldn't be here, lol). Basically, I want a skill that costs in MP however much HP the foe has. For example, if the foe has 999 HP left, it would cost 999 MP to use the skill. If the foe has 224 HP left, it would cost 224 MP to use the skill. (I haven't played FF15 yet, but from what I saw in trailers, it's probably VERY similar to that in effect.)


Is something like this possible? Note that I'm using Yanfly plugins, so I'd prefer a method that uses those, if possible.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
Consider that you choose the skill first (and if you don't have enough MP for the skill, it's not available to select), and then you choose the target.  So when your skill selection window is open, you have no idea how much MP the skill is going to cost because you haven't reached the part where you select the target.


This is not as easy as you might think it's going to be.


However, Yanfly has a skill cost plugin, and there may be some way in that to handle it.  
 

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
126
Reaction score
105
First Language
English
Not sure if what you want to achieve is achievable...

Here is a hack way of doing it. Put the formula in any skill/item formula box:
 


if(b.hp <= a.mp) { a.gainMp(-b.hp); b.hp; } else { 0; }


If b (target)'s HP is less than or equal to a (user's) MP, then a (user) loses target's HP and does damage equal to target's HP
If b (target)'s HP is above a (user's) MP, then skill does 0 damage

The issue is if there are multiple targets, then the skill cost would have to change dynamically. To my limited knowledge, there is no easy way to extract the "target's" parameters until you select the target (once you select the target, the target's parameters become "b").

 
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Yeah, you cannot actually do it as is because the skill selection is done before target selection... But well you can maybe modify the selection script so that it computes for the "mp cost" and checks if you have enough, if not it returns you to the skill selection.


The method above should work too but the problem is it means you will only know if the user can use it during damage calculation, if not then it will not deal damage. That can be frustrating to the player
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top