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,126
Reaction score
522
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

And back. Trying to work online with no internet for 1.5 days was...interesting. I felt like a character in a old Sierra game trying to find internet due to all the hoops I had to jump through just to get online for work.
grief... if MV didn't have certain plugins already, I think I'd upgrade to MZ. seeing like 10 MV plugins in 1 MZ one is hilariously convenient lol.
Have you already checkes out my mapping tutorial on the blog? I would love to hear your feedback and things you'd like to see in the future!

one of character for my upcoming game idk how to design o_O

Designing patches that can 'augmented' to clothing based armor. Such good fun. A bit time consuming due to the need to create image displays, but the patches are limited so it's not too tiring.
Note: lol, posting this made me find a couple mistakes.

Forum statistics

Threads
100,737
Messages
978,948
Members
132,359
Latest member
PhilKeepItReal
Top