Hello Everyone,
Thanks in advance for helping me out here as my scripter skills are really not that good.
What I want to achieve is instead of having the evasion based on the Hit type I want it based upon the skill type. I tried lots of different code lines but just can't figure it out. Here is the part I want to edit in case it helps: This is in Game_Battler.
#--------------------------------------------------------------------------
# * Apply Effect of Skill/Item
#--------------------------------------------------------------------------
def item_apply(user, item)
@result.clear
@result.used = item_test(user, item)
@result.missed = (@result.used && rand > item_hit(user, item))
@result.evaded = (!@result.missed && rand < item_eva(user, item))
if @result.hit?
unless item.damage.none?
@result.critical = (rand < item_cri(user, item))
make_damage_value(user, item)
execute_damage(user)
end
item.effects.each {|effect| item_effect_apply(user, item, effect) }
item_user_effect(user, item)
end
end
I want the @result.evaded to be conditioned based upon the skill type so I can define what it looks at to evade. Example: I want a Skill type Body to be evaded by parameter Def.
if stype=='Body'
@result.evaded = (!@result.missed && rand < item_def(user, item)
Something across this line. But I could not succeed. Some of my attempts said there was an unitiliazed method or variable in Game_Enemy.
THanks in advance if someone can take the time and effort to either guide me into the right direction or make the snippet I need.
Best regards,
Anduruin.
Evasion based upon Skill types
● ARCHIVED · READ-ONLY
-
-
you're looking at the wrong part of the code.
Line 505 basically says: The result is evaded, if not_missed AND random number smaller than evasion rating.
In that line, item_eva(user, item) is a function that will return the value to be checked for evasion.
You should not change this line (505), but the result returned by item_eva().
If you look for the function definition (Hint: Line 480++ in Game-Battler), then I think you'll see a much better way to add your other evasion types... -
Hi Andar,
Thanks for the hint as I was not sure and I persevered and it works now. Stupid == and I was putting a simple =...
This thread can be closed now. Thanks Andar.