How to make attacking skill have a chance of debuffing?

catchneko

Villager
Member
Joined
Jan 14, 2022
Messages
9
Reaction score
6
First Language
English
Primarily Uses
RMMV
1642778673468.png
Here we have Nuzzle. It's meant to be a physical Thunder attack that lowers Agility.
I've found that it's a little overpowered with its 100% chance of lowering Agility if it hits. It's the primary attack of one of the characters in the party, so it's likely to be used a lot, and so any enemy with high AGI is turned into a joke with near-constant AGI -2 when that character is being used, and basically makes the character who specializes in debuffs obsolete.

Are there any ways to change it to a *chance* of lowering AGI instead of making it 100%? Are there any plugins that enable this?
 

IndiSkye

Warper
Member
Joined
Jan 21, 2022
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
If nothing else, you could try making a state that lowers agility. That would stack with normal debuffs (but not itself, unless you use a plug-in for that) though, which may or may not be a good thing depending on how you look at it. It would also give you more control over how it applies the debuff (the chance of it happening, how much it reduces, and so on).
 

pawsplay

Veteran
Veteran
Joined
Mar 29, 2012
Messages
495
Reaction score
265
First Language
English
Primarily Uses
RMMV
It should be possible. If it were built into a weapon, you could use Yanfly's Weapon Unleash. I'm not sure if you could use that with a state or something, or if you would have to adapt the code.
 

BlackGoldSaw

Veteran
Veteran
Joined
Oct 10, 2017
Messages
88
Reaction score
47
First Language
English
Primarily Uses
RMMV
You can add this to the beginning of the Skill's Damage Formula:

JavaScript:
((Math.randomInt(10) + 1) > 9) ? b.addDebuff(6, 4) : 0;

"(Math.randomInt(10) + 1)" rolls a random number between 1-10. You can change the "9" to adjust the ratio. 9 = 10% chance, 5 would be 50% etc. The "6" is AGI, and the "4" is Turn Duration. Be sure to place your actual Damage Formula AFTER this code.
 

pawsplay

Veteran
Veteran
Joined
Mar 29, 2012
Messages
495
Reaction score
265
First Language
English
Primarily Uses
RMMV
Does that not run the risk of triggering even when the skill is not used?
 

BlackGoldSaw

Veteran
Veteran
Joined
Oct 10, 2017
Messages
88
Reaction score
47
First Language
English
Primarily Uses
RMMV
Does that not run the risk of triggering even when the skill is not used?
Do you mean when the Skill misses? I tested that and as far as I can tell, the Damage Formula only applies if the Skill connects. Unless you were referring to something else.
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
173
Reaction score
144
First Language
German
Primarily Uses
RMMV

BlackGoldSaw

Veteran
Veteran
Joined
Oct 10, 2017
Messages
88
Reaction score
47
First Language
English
Primarily Uses
RMMV
You can read here, why putting extra code inside the damage formula can cause problems:

That said, @catchneko could just slap the code you provided into a <Post-Damage Eval> (or something like that) from Yanfly's free plugin Skill Core:
Ah, interesting :oops:. I was toying around with this, but couldn't seem to find any problems personally.
 
Last edited:

catchneko

Villager
Member
Joined
Jan 14, 2022
Messages
9
Reaction score
6
First Language
English
Primarily Uses
RMMV
You can add this to the beginning of the Skill's Damage Formula:

JavaScript:
((Math.randomInt(10) + 1) > 9) ? b.addDebuff(6, 4) : 0;

"(Math.randomInt(10) + 1)" rolls a random number between 1-10. You can change the "9" to adjust the ratio. 9 = 10% chance, 5 would be 50% etc. The "6" is AGI, and the "4" is Turn Duration. Be sure to place your actual Damage Formula AFTER this code.
You can read here, why putting extra code inside the damage formula can cause problems:

That said, @catchneko could just slap the code you provided into a <Post-Damage Eval> (or something like that) from Yanfly's free plugin Skill Core:
Thank you! It seems to work now.
 

Latest Threads

Latest Profile Posts

It's time for Da Update...

Prototyping some overworld abilities. Some of the characters you'll meet on your journey can use special overworld skills to travel around. This can be something like digging holes in the ground or getting hints towards your next objective.

Even more things I made.
Equipping Abilities is very important.
fLhHhZjh.gif
demonow.jpg

Eniko: Ghosts Of Grace Alpha Demo is Officially LIVE on Steam!

>> DOWNLOAD AND PLAY THE DEMO ON STEAM NOW!
Firefly130984 wrote on WallCat's profile.
Hello, I would try to beta test your game.
Parallel I would write a guide.

Forum statistics

Threads
122,137
Messages
1,146,826
Members
160,427
Latest member
richard6watkins
Top