case @action.attack_range_type
when Map::RHOMBUS
hit_check = (dx.abs + dy.abs <= range)
when Map::SQUARE
hit_check = (dx.abs <= range and dy.abs <= range)
when Map::LINE
case self.direction
when 2
hit_check = (dx == 0 and dy >= 0 and dy <= range)
when 8
hit_check = (dx == 0 and dy <= 0 and dy >= -range)
when 6
hit_check = (dy == 0 and dx >= 0 and dx <= range)
when 4
hit_check = (dy == 0 and dx <= 0 and dx >= -range)
end
end
case @action.attack_range_type
when Map::RHOMBUS
hit_check = (dx.abs + dy.abs <= range)
when Map::SQUARE
hit_check = (dx.abs <= range and dy.abs <= range)
when Map::LINE
case self.direction
when 2
hit_check = (dx == 0 and dy >= 0 and dy <= range)
when 8
hit_check = (dx == 0 and dy <= 0 and dy >= -range)
when 6
hit_check = (dy == 0 and dx >= 0 and dx <= range)
when 4
hit_check = (dy == 0 and dx <= 0 and dx >= -range)
end
end