[VX Ace] Changing luk_effect_rate(user)

Hello, I have a question, I'd like to change the luk_effect_rate(user) formula in Game_BattlerBase


The idea is making each 2 points of target's luck decrease in 1% the chance of having the state applied. user's luck won't have any effect


Talking with Saathan I THINK I arrived to the conclusion this formula is the correct one, but I really can't stay for sure


def luk_effect_rate(user)
(1.0 - (target.luk/2 * 0.01), 0.0).max
end
end




Is that the proper syntax to make what I want to do? Thank you 🙂
Hey, 


I am learning js myself atm, but I would approach this as follows:


So the original luk effect rate of the user is:

Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};

You will need 2 cases, one for the probability on actors and one on enemies.


I should think that you can insert an if clause, checking whether the state should be applied to an actor or an enemy

if (this.subject().isActor(){


return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0); //the standard luk effect rate for states on users as you didnt wish anything particular


}


else{


return Math.max(1.0 - (target.luk/2 * 0.01), 0.0); //no idea what this 0.0 at the end means and if you have to delete it, but target.luk/2 means every 2 points = 1, * 0.01 = 1%


}

Hope I could help you and write back if something went wrong with this code!
Hey, 


I am learning js myself atm, but I would approach this as follows:


So the original luk effect rate of the user is:


You will need 2 cases, one for the probability on actors and one on enemies.


I should think that you can insert an if clause, checking whether the state should be applied to an actor or an enemy


Hope I could help you and write back if something went wrong with this code!



I'm not sure but is that JavaScript? Like, for MV? Because I put it was for VX Ace, but I might am reading it wrong and indeed it's for VX ace


In any case, I just want to replace the actual formula with the one I suggested, I won't need to differentiate if is the actor of the enemy who use it because all will be affected with the new formula


But I think I'm getting the idea, it'd be something like this:


def luk_effect_rate(user)
(1.0 - (target.luk/2 * 0.001), 0.0).max #I put the 0.001 because that's how appears in VX Ace original scripting, but I'm not sure if it works like that, it might be 0.01
end
end




Right?
oh, didn't see it was for ace. 


Well, it seems that it was only the math thing to get to your formula. I think, you should cut out the 0 however, because that's how much


the effect rate weigths. *1 => 100% decrease per luk point; *0.1 => 10%; *0.01 => 1% (what you wanted), and *0.001 would be 0.1% (1% per 10 Luk points)


For the rest of it, I think your luk effect rate will work perfectly!
oh, didn't see it was for ace. 


Well, it seems that it was only the math thing to get to your formula. I think, you should cut out the 0 however, because that's how much


the effect rate weigths. *1 => 100% decrease per luk point; *0.1 => 10%; *0.01 => 1% (what you wanted), and *0.001 would be 0.1% (1% per 10 Luk points)


For the rest of it, I think your luk effect rate will work perfectly!



I think I'll wait for someone to rectify this, but I think this one is the correct one, thanks by the help

Code:
def luk_effect_rate(user)
    (1.0 - (target.luk/2 * 0.01), 0.0).max
  end
end
BUMP
The syntax looks good. Test it out, and if a luck of 50 makes all 100% status aliments miss, then you did it.


Though, keep in mind this will apply to *anything* that adds a state, whether that state is positive or negative.
The syntax looks good. Test it out, and if a luck of 50 makes all 100% status aliments miss, then you did it.


Though, keep in mind this will apply to *anything* that adds a state, whether that state is positive or negative.



Actually it should be 200 of luck to have a total states evasion

Mmm interesting, can I make a state evade the luck check? some of them are buffs and you don't want to miss buffs
Right, 200. And maybe on that note I should get some sleep soon.


As for the other part, not sure. I thought I heard that certain hit skills avoid the luck check, but not sure. Otherwise you may need to edit the code to be able to flag some skills as don't apply the luck check here. Or, just do 999% chance to apply the state (though with 200 luck, and your formula, since the luck modifier is multiplied, and anything times 0 is 0, it will still miss).

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-changing-luk_effect_rate-user.66128/