Monster Skills: Damage and Logic

Well, first thing is that I have damage formula that makes the skill deals bonus damage against 0 Agility actors(such as those being Paralyzed. In my little project, Paralyzed characters have their Agility set to 0). Here's how it looks:


if (b.agi <= 0) {a.atk * 4 + a.agi * 10 - b.def * 4} else {a.atk * 4 + a.agi * 4 - b.def * 4}


However, always comes out the "else" option, regardless if "if" condition is met. By the way, there my Paralysis state. And the stats of creature that uses these.


After I done with these, I want that Cockatrice to use it's finisher skill whenever there is Paralyzed actor. And never when there is none.


Paralysis.png


Cockatrice.png
Wasn't sure if I should bump it or repost it. Sadly, deleting wasn't available, so I end up bumping it.
The issue is that formulas must return a numeric value as the last value.


so your forumla would need to be something like


var result; if (b.agi <= 0) { result = a.atk * 4 + a.agi * 10 - b.def * 4} else { result = a.atk * 4 + a.agi * 4 - b.def * 4}; result;


but since you want to just change the skill multplier, you could shorten your formula to something like:


a.atk * 4 + a.agi * (b.agi <= 0 ? 10 : 4) - b.def * 4
That funny fact that it didn't worked. So I console-logged my actors and found out that my Paralyze state doesn't set target's AGI to 0. It sets AGI to 1. So I changed formula to fit that cause, and now it works. LOL


Now I may as well not give them Logic AI that uses finish skill exquisitely on Paralyzed actors, since as of now, they are threat enough for Level 1 party. Heh...

Original thread: https://forums.rpgmakerweb.com/threads/monster-skills-damage-and-logic.59473/