How to use the melee.get_stance_score function in melee

To help you get started, we’ve selected a few melee examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flags / Reactor-3 / life.py View on Github external
def stand(life):
	if life['stance'] == 'crouching':
		_delay = 5
	elif life['stance'] == 'crawling':
		_delay = 15
	else:
		_delay = melee.get_stance_score(life, 'standing')
	
	set_animation(life, ['^', '@'], speed=_delay/2)
	add_action(life,{'action': 'stand'},
		200,
		delay=_delay)
github flags / Reactor-3 / life.py View on Github external
def crawl(life, force=False):
	if force:
		life['stance'] = 'crawling'
		set_animation(life, ['v', '@'], speed=15)
		return True
	
	if life['stance'] == 'standing':
		_delay = 15
	elif life['stance'] == 'crouching':
		_delay = 5
	else:
		_delay = melee.get_stance_score(life, 'crawling')
	
	set_animation(life, ['v', '@'], speed=_delay/2)
	add_action(life,{'action': 'crawl'},
		200,
		delay=_delay)
github flags / Reactor-3 / life.py View on Github external
def crouch(life):
	if life['stance'] == 'standing':
		_delay = 5
	elif life['stance'] == 'crawling':
		_delay = 15
	else:
		_delay = melee.get_stance_score(life, 'crouching')
	
	set_animation(life, ['n', '@'], speed=_delay/2)
	add_action(life,{'action': 'crouch'},
		200,
		delay=_delay)