Hello,
I guess this is more me asking for help with coding a formula correctly, but it pertains to me using the damage core plugin ability to use code for skills.
I am creating a heal skill that has 3 components, but I am having trouble.
I have set the skill up to be a heal, so the scope is 1 ally and type is hp recover.
The first line I have value = (my formula)
Then I have a.gainMp(another formula)
Then I want to deal damage to an enemy based on another formula that uses the value from the first line, but I don't know how to set this up.
My first question is regarding the second line. I want to be able to call upon the mana cost of the spell I am using instead of manually typing it into the formula. I would like this for 2 reasons. First, if I decide to change the mana cost later, I don't want to have to change it throughout all my formulas, too. And secondly, because I may have some skill or item in the game that changes the mana cost by a percentage, and I hoping that this method would change the variable in my formula, also.
My second question is where I need most help. Since neither the actor, not the target are the ones that I want damage to be dealt to, I don't know how to begin to set this up. I presume I would have to make it so it does damage to a random enemy.
I am also having trouble with the formula I would like to use as the damaging component. The following formula is what I want to use, but it is giving me an error. If someone could point out what is wrong with it, I would appreciate it. [essentially, I want it to damage to a random enemy by the amount it over heals - but, I don't want it to heal the enemy when it doesn't]
(if ((value - (target.mhp - target.hp)) >= 0) { (value - (target.mhp - target.hp)); } else { 0;} )
I guess this is more me asking for help with coding a formula correctly, but it pertains to me using the damage core plugin ability to use code for skills.
I am creating a heal skill that has 3 components, but I am having trouble.
I have set the skill up to be a heal, so the scope is 1 ally and type is hp recover.
The first line I have value = (my formula)
Then I have a.gainMp(another formula)
Then I want to deal damage to an enemy based on another formula that uses the value from the first line, but I don't know how to set this up.
My first question is regarding the second line. I want to be able to call upon the mana cost of the spell I am using instead of manually typing it into the formula. I would like this for 2 reasons. First, if I decide to change the mana cost later, I don't want to have to change it throughout all my formulas, too. And secondly, because I may have some skill or item in the game that changes the mana cost by a percentage, and I hoping that this method would change the variable in my formula, also.
My second question is where I need most help. Since neither the actor, not the target are the ones that I want damage to be dealt to, I don't know how to begin to set this up. I presume I would have to make it so it does damage to a random enemy.
I am also having trouble with the formula I would like to use as the damaging component. The following formula is what I want to use, but it is giving me an error. If someone could point out what is wrong with it, I would appreciate it. [essentially, I want it to damage to a random enemy by the amount it over heals - but, I don't want it to heal the enemy when it doesn't]
(if ((value - (target.mhp - target.hp)) >= 0) { (value - (target.mhp - target.hp)); } else { 0;} )