name = 'way war' version = '1' author = 'Penguin_' description = 'good play!' protected = ['E4', 'E5'] extensions = { 'arena' : True, 'water_damage' : 100} # script from pyspades.constants import * from pyspades.server import ServerConnection import random def get_entity_location(team, entity_id): if entity_id == BLUE_FLAG: return (290, 215, 62) if entity_id == GREEN_FLAG: return (280, 293, 62) if entity_id == BLUE_BASE: return (280, 215, 62) if entity_id == GREEN_BASE: return (290, 293, 62) spawn_locations_blue = [ (267, 211, 62), (302, 211, 62), ] spawn_locations_green = [ (302, 297, 62), (268, 297, 62), ] def get_spawn_location(connection): if connection.team is connection.protocol.blue_team: x, y, z = random.choice(spawn_locations_blue) elif connection.team is connection.protocol.green_team: x, y, z = random.choice(spawn_locations_green) z -= 2.4 # magic numbers x += 0.5 y += 0.5 if connection.protocol.map.get_z(x, y) <= z: # allows spawning lower if the ground is destroyed return x, y, z else: return x, y, connection.protocol.map.get_z(x, y)