Skill like "Punishment" from Pokemon

Whirlnado

Villager
Member
Joined
Feb 10, 2018
Messages
17
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,226
Reaction score
603
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
17
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

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top