Hey gamers,
I am currently working on a project and am using yanfly's damage core. I have a damage formula notetag that works for what I need it to do except it looks really ugly and since I am still new to programming, I am having a hard time condensing it down. Any help in making this code more condensed would be greatly appreciated ^_^
I am currently working on a project and am using yanfly's damage core. I have a damage formula notetag that works for what I need it to do except it looks really ugly and since I am still new to programming, I am having a hard time condensing it down. Any help in making this code more condensed would be greatly appreciated ^_^
<damage formula>
if (b.def <= (Math.randomInt(20) + 1 + a.atk))
{
If(a.level < 4)
{
value = Math.randomInt(6) + 1;
}
if (a.level >= 4 && a.level <8)
{
value = Math.randomInt(6) + Math.randomInt(6) + 2;
}
if (a.level >= 8)
{
value = Math.randomInt(6) + Math.randomInt(6) + Math.randomInt(6) + 3;
}
}
</damage formula>
if (b.def <= (Math.randomInt(20) + 1 + a.atk))
{
If(a.level < 4)
{
value = Math.randomInt(6) + 1;
}
if (a.level >= 4 && a.level <8)
{
value = Math.randomInt(6) + Math.randomInt(6) + 2;
}
if (a.level >= 8)
{
value = Math.randomInt(6) + Math.randomInt(6) + Math.randomInt(6) + 3;
}
}
</damage formula>
