I'm working on a mini script and I've hit something I don't know how to do. I'm looking for a conditional that checks if the target of an action has a specific state and effects the hit rate. I'll write what I have so far. The underlined part is just pseudocode, since that's what I don't know. I'm pretty sure the rest should work fine.
class Game_Battler < Game_BattlerBase
def item_hit(user, item)
rate = 1.0
rate = 0.5 if target.has_state[5]? # Lower hit rate to 50% if target has specific state.
return rate
end
end
So, yeah. I just need to know what to replace the underlined part with.
class Game_Battler < Game_BattlerBase
def item_hit(user, item)
rate = 1.0
rate = 0.5 if target.has_state[5]? # Lower hit rate to 50% if target has specific state.
return rate
end
end
So, yeah. I just need to know what to replace the underlined part with.