RPG Maker Forums

Hello, I have a trouble with Victor Custom hit formula script which you can find here


You'll see, I tried this formula for magical based attacks like this one


rand < 1 * [[((255 - b.mev * 2) + 1), 1].max, 255].min / 256.0


The problem is, I'm trying to make when the user has the state number 20, the formula works like this


rand < 0.2 * [[((255 - b.mev * 2) + 1), 1].max, 255].min / 256.0


I even tried to create a script line for this


class Game_Battler < Game_BattlerBase
def magic_acc(a, b, base)
x1 = base
if a.state?(20) then x1 *= 0.2 end
acc = rand < x1 * [[((255 - b.mev * 2) + 1), 1].max, 255].min / 256.0
return acc
end
end


And I put this in the <hit formula> tags

Code:
<hit formula>
a.magic_acc(a, b, base)
</hit formula>
Physical formula is this one, the same Victor uses as an example

Code:
rand < hit * ([[((255 - eva * 2) + 1), 1].max, 255].min / 256.0)


I'm having some troubles, it's not checking the state to make the attack fails, it's not considering the target's magic evasion either, with physical based formula, it's not checking hit rate and target's evasion, the attack always hits


Can someone please help me to fix those troubles? Thank you

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top