european_son
Member
I'm trying to make the actor's hit rate dependent on both the actor's Int level and the equipped weapon. I haven't figured out a good algorithm yet, but I've made this block of code so far (in Game_Battler):
The problem is that I get an 'undefined method' error pointing to 'weapon_id'. Any help would be greatly appreciated!
Code:
 #--------------------------------------------------------------------------
 # * Get Hit Rate
 #--------------------------------------------------------------------------
 def hit
  n = (int + 85) / 2
  case $data_weapons[@actor.weapon_id]
  when 1
   n = (int + 95) / 2
  when 2
   n = (int + 95) / 2
  when 3
   n = (int + 95) / 2
  when 11
   n = (int + 75) / 2
  end
  for i in @states
   n *= $data_states[i].hit_rate / 100.0
  end
  return Integer(n)
 end
Â
The problem is that I get an 'undefined method' error pointing to 'weapon_id'. Any help would be greatly appreciated!