[RMMV] Magic Hit Rate

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
331
Reaction score
486
First Language
German
Primarily Uses
RMMV
Hello everyone.

I'd like to make the Hit Rate of characters affect both physical attacks and magical attacks

basically:

Magic Attack Hit rate: user.hit - target.mev (or rather user.hit * (1 - target.mev)
Physical Attack Hit rate. user.hit - target.eva (or rather user.hit * (1 - target.eva)

As I understand, by default, all magic attacks have a 100% hit rate which gets reduced by magical evasion but is unaffected by the users hitrate.
Because if you're blinded, why would you miss with a bow and arrow but not with a fireball which you have to aim aswell?

So far I have only found VX scripts for this but none for MV.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
you'll need a plugin to change hit calculations.
yanfly has a hit accuracy one, if I recall right, not sure if anyone else did one yet.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
331
Reaction score
486
First Language
German
Primarily Uses
RMMV
I don't know if you could do this with yanfly's hit accuracy plugin.
And even so you can't even purchase this plugin right now and I don't want to spend 10 bucks for a single plugin.

Since in an old thread the same problem was solved for VX (here), I though it may not be too difficult in MV either.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
I'm almost sure it was it. One of his plugins let you set how hit chance is calculated, physical skills using hit and magical skills using 1.
Unfortunately, if you don't want to use yanfly's you'll have to hunt down a substitute. While his plugins were free people were kinda "yanfly already covered this, no need to make a new one, better just expand it or make something else".
Which kinda gave everyone else a problem when he paywalled them years later.
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
533
Reaction score
235
First Language
English
Primarily Uses
RMMV
Basically, you just need to modify this function in rpg_objects.js:

JavaScript:
Game_Action.prototype.itemHit = function(target) {
    if (this.isPhysical()) {
        return this.item().successRate * 0.01 * this.subject().hit;
    } else {
        return this.item().successRate * 0.01;
    }
};
So if you paste the following code into a plugin (ideally one included high in your plugin list) or replacing the function in rpg_objects.js, it will give the formula you mentioned.

Magic Attack Hit rate: user.hit - target.mev (or rather user.hit * (1 - target.mev)
Physical Attack Hit rate. user.hit - target.eva (or rather user.hit * (1 - target.eva)
JavaScript:
Game_Action.prototype.itemHit = function(target) {
    if (this.isPhysical()) {
        return this.item().successRate * 0.01 * this.subject().hit * (1 - target.eva);
    } else {
        return this.item().successRate * 0.01 * this.subject().hit * (1 - target.mev);
    }
};
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
331
Reaction score
486
First Language
German
Primarily Uses
RMMV
Hmm... yes that's a great start I believe. It does function properly.
However this seems to deactivate the "evade" motion trigger for magic evasion.

If I miss an enemy with magic it just states that the action failed and not that the attack missed.
As a result there is no evasion sound or battler motion. But this is still better than before.
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
533
Reaction score
235
First Language
English
Primarily Uses
RMMV
Yeah, that just changes the calculation. It's not really a plugin, just a starting point for what you want.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top