[semi-solved]how to add element to a.gainHP(value)?

Janusz

Veteran
Veteran
Joined
Jul 4, 2015
Messages
26
Reaction score
4
Primarily Uses
I'm trying create "Burn" state which says:

"Increase Fire elemental damage(x3), at the end of each turn infected battler recive damage depends of its weakness on fire."
How can i get it, how add element Id to target value damage or damage formula?


Or simply how to make "target.gainHp(-value);" fire damage?


I have for now:


<Custom Regenerate Effect>
//this.item().damage.elementId = 2;

//if (user.elementRate(2) > 0 && !user.isDead()) {
// need add elemental ID to damage formula
// value = user.atk * user.elementRate(2);
user.gainHp(-user.atk * user.elementRate(2));

//}
</Custom Regenerate Effect>


(using Yanfly Buffs&States along with Yanfly Elemental Script.)


But it didn't work. Always recive same number even if i put various Traits(Element Rate: Fire*x) and/or notetags from Yanfly Elemental Script.


Edit:  Same damage values was caused by another state with notetag:


<Force Element Fire Rate: 300%>


Looks like my problem with damage formula is solved, but if anyone knows other ways to making it elemental damage please write it, because it may be useful in the future.


Sorry for bad english, and thanks.
 
Last edited by a moderator:

Quickdraws

Veteran
Veteran
Joined
May 31, 2013
Messages
55
Reaction score
8
First Language
English
Primarily Uses
Try this first as per your description you need 3x damage if fire based. so you need a react effect tag. Basically it checks if the skill uses the element id you assigned an if so multiply by 3.


Next the damage tick with the regenerate tag. Now this block cannot access the enemy stats as far as I know. You have user.atk for the damage so that mean your using the afflicted characters own attack as the base damage. I kinda don't care for that so ill offer an alternative but you can use whatever you like.


I use 1% of the targets total hp as a base then add an additionally value based on the afflicted chars level. Next multiply the flat value by fire resist, then multiply by -1 to make it negative for the gainHP effect. Lastly, round the number to flat value and a burn state is finished.


<Custom React Effect>


if (this.item().damage.elementId == 2) {


value = Math.floor(value * 3);


}


<Custom React Effect>


<Custom Regenerate Effect>


var value = user.mhp * 0.01 + user.level * 1.75; 


value = Math.floor(user.element.Rate(2) * value * -1);


user.gainHp(value);


</Custom Regenerate Effect>


Hope this helps.


**Note** Remove user.level * 1.75 in the regen effect if not using enemy levels by YF or it may not work or crash.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top