def room(): from autospawner.spawner import Spawner spawner = Spawner() shard = spawner.getShard() room = spawner.getRoom(shard) position = spawner.getPosition(room, shard) click.echo("%s %s %s,%s" % (shard, room, position['x'], position['y']))
def shouldspawn(): from autospawner.spawner import Spawner spawner = Spawner() doit = spawner.shouldSpawn() click.echo("%s" % (doit, )) if not doit: sys.exit(-1)
def room(): from autospawner.spawner import Spawner spawner = Spawner() shard = spawner.getShard() room = spawner.getRoom(shard) if not room: click.echo('No suitable room') sys.exit(-1) position = spawner.getPosition(room, shard) click.echo("%s %s %s,%s" % (shard, room, position['x'], position['y']))
def dt(room, shard): from autospawner.spawner import Spawner spawner = Spawner() dt = spawner.roominfo.getDistaceTranceform(room, shard) for y in range(0, 50): row = '' for x in range(0, 50): row = '%s%s' % (row, dt[x][y]) click.echo(row)
def terrain(room, shard): from autospawner.spawner import Spawner spawner = Spawner() terrain = spawner.roominfo.getRoomTerrain(room, shard) for y in range(0, 50): row = '' for x in range(0, 50): if terrain[x][y] == 'wall': score = 0 elif terrain[x][y] == 'plain': score = 1 elif terrain[x][y] == 'swamp': score = 2 row = '%s%s' % (row, score) click.echo(row)
def respawn(): from autospawner.spawner import Spawner spawner = Spawner() if not spawner.shouldSpawn(): click.echo('Not appropriate to spawn at this time') sys.exit(-1) shard = spawner.getShard() room = spawner.getRoom(shard) position = spawner.getPosition(room, shard) click.echo("%s %s %s,%s" % (shard, room, position['x'], position['y']))
def shard(): from autospawner.spawner import Spawner spawner = Spawner() shard = spawner.getShard() click.echo(shard)
def resetmemory(): from autospawner.spawner import Spawner spawner = Spawner() spawner.resetMemory() click.echo('Memory reset')
def validate(room, shard): from autospawner.spawner import Spawner spawner = Spawner() click.echo(spawner.filterRoom(room, shard))