I think this should work...
if b.isStateAffected(59) b.addState(61); a.mat*1.33-b.mdf*0.33
edit: Okay, now I got it to work. Thanks.
Last edited by a moderator:
I think this should work...
if b.isStateAffected(59) b.addState(61); a.mat*1.33-b.mdf*0.33
This is what caused the first part of the formula to go wrong thank you, but now the enemy doesn't deal damage i have also tried this:try to separate else if
if(a.actorId() == 1){a.atk * 4 + 560 - b.def * 2;} else if( a.isEnemy()){a.atk * 4 - b.def * 2 ;}
It doesn't work for meThe only notable thing I did as far as I know was add a space between the } and the else and it worked for me...
if(a.actorId() == 1){a.atk * 4 + 560 - b.def * 2;} else if( a.isEnemy()){a.atk * 4 - b.def * 2 ;}
Thank you for your efforts and fast replies, just woke up so i'm glnna check it a bit later.Uh. I tested again, and this time it dealt no damage...
Then tested if( a.isEnemy()){a.atk * 4 - b.def * 2 ;} to see if the problem is there, it worked. Did not test if(a.actorId() == 1){a.atk * 4 + 560 - b.def * 2;} because you said it worked.
so I tested again with if(a.actorId() == 1){a.atk * 4 + 560 - b.def * 2;} else if( a.isEnemy()){a.atk * 4 - b.def * 2 ;} and it worked again.
http://starecat.com/content/wp-content/uploads/my-code-doesnt-work-i-have-no-idea-why-my-code-works.jpg
ThanksHappy Birthday!
Seriously, if anyone that understands damage formulas better could tell what we did, wrong and right...
I thank you once more this is what works thus what i needed...
That wouldn't make the damage be 0 though...
ok, try if( a.isActor() && a.actorId() === 1) since the problem could be either the lack of a third = (javascript uses three =s mosd of the time from what I saw, no idea of the difference yet (for lack of research) but it is there and may be it) or the fact that a.actorid() checks the id but...what does it give when it is not an actor?
Ok, I can find out easily, but it is too late right now and I'm sleepy...
Your first problem: b.isStateAffected(59) ? b.addState(57) ; a.atk * 1.5 - b.def * 0.33 : a.atk * 1.5 - b.def * 0.33
There is nothing there saying they are supposed to be together. As far as the program goes, b.isStateAffected(59) ? b.addState(57) ; is one line and a.atk * 1.5 - b.def * 0.33 : a.atk * 1.5 - b.def * 0.33 is the other.
Your second problem is one I had earlier. I do not think ? : can be used with more than one line, even with {}s, or so my problem seemed. You'll have to use if-else instead.
So it would be
if b.isStateAffected(59) {b.addState(57) ; a.atk * 1.5 - b.def * 0.33;} else a.atk * 1.5 - b.def * 0.33
Give it a try