Adding bonus damage to an attack if the target is poisoned.

PixelBoy360

Villager
Member
Joined
Apr 11, 2015
Messages
21
Reaction score
1
First Language
English
So basically I want a skill to do 10% more damage if the enemy it's attacking is poisoned.
None of the formulas do anything and I'm not sure if this is due to a plugin inhibiting it or my own negligence in finding the problem?
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,676
Reaction score
2,119
First Language
English
Primarily Uses
RMMV
Yanfly's Damage Core can probably do something like this. You'll need a note tag with some JavaScript that checks whether the target has the Poison state and then multiply the damage by 1.10 or something similar to this. Someone here more familiar with the plugin can probably give you the exact code.
 

Wavelength

Pre-Merge Boot
Global Mod
Joined
Jul 22, 2014
Messages
4,626
Reaction score
3,892
First Language
English
Primarily Uses
RMVXA

I've moved this thread to MV Support. Please be sure to post your threads in the correct forum next time. Thank you.



Use a formula like this:

if (b.isStateAffected(n)) { damage formula 1 } else { damage formula 2 }

You can also use the form:

b.isStateAffected(n) ? damage formula 1 : damage formula 2

Replace n with the State ID of Poison. Replace damage formula 1 and damage formula 2 with the damage formulas you want to use if the target is poisoned, and is not poisoned, respectively. For example:

if (b.isStateAffected(28)) { a.mat * 4.4 - b.mdf * 2.2 } else { a.mat * 4 - b.mdf * 2 }

or

b.isStateAffected(28) ? a.mat * 4.4 - b.mdf * 2.2 : a.mat * 4 - b.mdf * 2
 
Last edited:

PixelBoy360

Villager
Member
Joined
Apr 11, 2015
Messages
21
Reaction score
1
First Language
English
Yes! This worked perfectly, not sure why it wasn't working before but I'm glad it's working now. Thanks! :MV1:
 

DeveloDude

Warper
Member
Joined
Aug 3, 2019
Messages
3
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
If I want to make smth like that I'll just add Option to Skill (Change Def\MDef to *n* point) or (add Weakness to phys.\mag. atk)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Me: "Finally finished most of my game backlog. Probably time to do some gamedev" | Steam: *offer sales*
If I recorded while I created (what I think is) a small plugin, would you be interested enough in the process to watch it?
I keep trying to explain to clients that the huddle masses behind the old K-Mart are a Fallout Reenactment group. Somehow I don't think they believe me. :LZSskeptic:
Hey people! What do you think about a core plugin? This will save some lines of code that I repeatedly use in all my plugins...
Wondering if I should make my enemies scale in my non-linear rpg. I'm leaning towards yes, but I don't want to use Yanfly's plugin...

Forum statistics

Threads
94,594
Messages
922,167
Members
124,464
Latest member
foghiszdenisz
Top