def bite(life, target_id, limb):
	logging.debug('%s bit %s in the %s.' % (' '.join(life['name']), ' '.join(LIFE[target_id]['name']), limb))
	target = LIFE[target_id]
	_msg = ['%s' % language.get_introduction(life)]
	
	_bite_strength = random.randint(1, 3)
	
	if numbers.distance(life['pos'], target['pos'])>1:
		_msg.append('bites the air')
		
		return ' '.join(_msg)+'.'
	
	_items_to_check = []
	
	for _item in lfe.get_items_attached_to_limb(target, limb):
		_items_to_check.append({'item': _item, 'visible': True})
		_actual_item = items.get_item_from_uid(_item)
		
		if 'storing' in _actual_item:
			for _item_in_container in _actual_item['storing']:
				_items_to_check.append({'item': _item_in_container, 'visible': False})
	
	for entry in _items_to_check:
		_item = items.get_item_from_uid(entry['item'])

		if not 'thickness' in _item:
			logging.warning('Item \'%s\' has no set thickness. Guessing...' % _item['name'])
			_item['thickness'] = _item['size']/2
		
		_thickness = _item['thickness']
		_item['thickness'] = numbers.clip(_item['thickness']-_bite_strength, 0, 100)
		_bite_strength -= _thickness
		_tear = _item['thickness']-_thickness
		_limb_in_context = False
		
		if _item['material'] == 'cloth':
			if _thickness and not _item['thickness']:
				_msg.append('rips through <own> %s' % _item['name'])
			elif _tear<=-3:
				_msg.append('rips <own> %s' % _item['name'])
			elif _tear<=-2:
				_msg.append('tears <own> %s' % _item['name'])
			elif _tear<=-1:
				_msg.append('slightly tears <own> %s' % _item['name'])
			
			if _bite_strength <= 0 and _item['thickness']:
				_msg.append('is stopped by <own> %s' % _item['name'])
				return ' '.join(_msg)
	
	#if not lfe.limb_is_cut(target, limb):
	if _bite_strength==1:
		_msg.append(limb % ', cutting <own> %s')
	elif _bite_strength==2:
		_msg.append(', tearing <own> %s' % limb)
	elif _bite_strength==3:
		_msg.append(', ripping open <own> %s' % limb)

	if _bite_strength:
		lfe.add_wound(target, limb, cut=_bite_strength)
	
	#TODO: How thick is skin?
	_bite_strength -= 1
	
	#if not _bite_strength:
	#	return ' '.join(_msg)
	
	_ret_string = own_language(target, _msg)
	
	return _ret_string+'.'
dataset/ETHPy150Open flags/Reactor-3/damage.py/bite/swapped operands of `%`