Rubinblau 9 Posted May 9, 2017 Hello, I am planning to have one of my characters use an attack that does heavy damage to an enemy. Should the enemy be killed, the character will use another attack (shortened, slightly weakened) version of it on another enemy. Should that attack kill the second enemy, the character will use this attack on a third and so forth. How could I achieve this? My main problem is checking if the attack kills an enemy, the rest should be fine. Share this post Link to post Share on other sites
Lord Vectra 414 Posted May 9, 2017 One way to check is to do a conditional based on HP. For example, if the damage formula is a.atk * 5 - b.def * 2.5 then the full damage formula including the conditional will say if b.hp <= a.atk * 5 - b.def * 25; [add what happens here]; a.atk * 5 - b.def * 2.5; else; [whatever happens if not true]; a.atk * 5 - b.def * 2.5; end if that doesn't work if b.hp <= a.atk * 5 - b.def * 25; [add what happens here]; else; [whatever happens if not true]; end; a.atk * 5 - b.def * 2.5 You WILL need 0 variance if you are to do this. If the skill is an element that can possibly be null against certain monsters you have (ex. fire spells against a fire demon), then you'll need to add b.element_rate(x) after a.atk * 5 -- b.def * 25 like this... (a.atk * 5 - b.def * 25) * element_rate(x)PARENTHESIS MATTER! And ONLY do that for the conditional. For example, it'll look like this: if b.hp <= (a.atk * 5 - b.def * 25) * element_rate(x); [add what happens here]; a.atk * 5 - b.def * 2.5; else; [whatever happens if not true]; a.atk * 5 - b.def * 2.5; end Replace "x" with the element ID of the skill. If that is too big, you should go to script editor, create a new one. Then, while its black, put something like... VECTRAISGREAT = "if b.hp <= (a.atk * 5 - b.def * 25) * element_rate(x); [add what happens here]; a.atk * 5 - b.def * 2.5; else; [whatever happens if not true]; a.atk * 5 - b.def * 2.5; end" QUOTATIONS MATTER!And then in the damage formula, put... eval(VECTRAISGREAT) 1 Share this post Link to post Share on other sites