def assume_stance(p, stance, towards=None):
	if p['next_stance']['stance'] == stance and p['next_stance']['towards'] == towards:
		if 'player' in p:
			gfx.message('You continue to %s.' % stance)
			return False
		
	if p['next_stance']['forced']:
		if not p['next_stance']['delay']:
			p['next_stance']['forced'] = False
		else:
			print p['name'], 'cannot move (forced)'
			return False

	p['next_stance']['delay'] = get_stance_score(p, stance)
	p['next_stance']['stance'] = stance
	p['next_stance']['towards'] = towards
	p['next_stance']['forced'] = False
	
	if 'player' in p:
		gfx.message('You start to %s.' % stance)
	elif 'player' in LIFE[towards]:
		gfx.message('%s begins to %s.' % (' '.join(p['name']), stance))
	print p['name'], 'begins', p['next_stance']['stance'], '(%s' % p['next_stance']['delay']+')'
	return True
dataset/ETHPy150Open flags/Reactor-3/melee.py/assume_stance/original