def walk(life, to=None, path=None):
	if life['speed']>0:
		if life['stance'] == 'standing':
			life['speed'] -= 1
		elif life['stance'] == 'crouching':
			life['speed'] -= 0.5
		elif life['stance'] == 'crawling':
			life['speed'] -= 0.3
		else:
			clear_actions(life)
			stand(life)
		
		return False
	elif life['speed']<=0:
		life['speed_max'] = get_max_speed(life)
		life['speed'] = life['speed_max']
		
		if life['recoil']<.5:
			life['recoil'] = .5
	
	_dest = path_dest(life)
	_existing_chunk_path = alife.brain.get_flag(life, 'chunk_path')
	
	if path:
		life['path'] = path
		life['path_state'] = life['state']
	elif _existing_chunk_path and to == _existing_chunk_path['end']:
		if not life['path']:
			life['path'] = pathfinding.walk_chunk_path(life)
	elif to and (not _dest or not (_dest[0], _dest[1]) == tuple(to[:2])):
		alife.brain.unflag(life, 'chunk_path')
		
		_zone = can_walk_to(life, to)
		
		if _zone:
			life['path'] = pathfinding.create_path(life, life['pos'], to, _zone)
			life['path_state'] = life['state']
	
	life['prev_pos'] = life['pos'][:]
	
	return walk_path(life)
Performs a single walk tick. Waits or returns success of life.walk_path().
dataset/ETHPy150Open flags/Reactor-3/life.py/walk