Skill like "Punishment" from Pokemon

Whirlnado

Villager
Member
Joined
Feb 10, 2018
Messages
16
Reaction score
1
First Language
German
Primarily Uses
RMMV
I'm trying to make a skill that deals more damage if the enemy has either an attack or m.attack buff.
So i did some research and this is the formula i've come up with, but sadly it doesn't work.

a.buffs[2] > 0 || a.buffs[4] > 0 ? a.mat * 7 - b.mdf : a.mat * 2 - b.mdf

I also tried replacing a.buffs with b.buffs and leaving out the second check like this:

b.buffs[2] > 0 ? a.mat * 7 - b.mdf : a.mat * 2 - b.mdf

But that also does not work.
Any Ideas?
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,113
Reaction score
517
First Language
English
Primarily Uses
RMMV
I've only ever used addBuff(ID, turns) so I'm not 100% sure on how you should write it to check for a buff.

Maybe it would be the same for a state?

isBuffAffected(buffId)

And if you're checking if the target is affected, then target = b

You could try this

b.isBuffAffected(buffId) ? a.mat * 7 . b.mdf : a.mat * 2 - b.mdf

I think my above statement would work if you have the correct syntax to check if the target is affected by the particular buff. I'm just not sure on the correct syntax. Maybe someone who knows will chime in.
 

Whirlnado

Villager
Member
Joined
Feb 10, 2018
Messages
16
Reaction score
1
First Language
German
Primarily Uses
RMMV
I tried it out and it worked even after adding the second condition.

b.isBuffAffected(2) || b.isBuffAffected(4) ? a.mat * 7 - b.mdf : a.mat * 2 - b.mdf

Thanks ^^
 

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

Latest Threads

Latest Profile Posts

I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:
I'm having a fun time working with the MZ RTP. The waterfall hasn't changed, though, so I'm wondering if they didn't make a new one or if they forgot to put it in...

good progress on the typescript Definitions files almost done all the Manager and yet I still have to do the Battle Manager...who is seriously so much data lol
Are the export options for MZ known yet?
I thought they were supposed to be my friends T_T

Forum statistics

Threads
100,645
Messages
978,065
Members
132,259
Latest member
RegularManGuy
Top