Olympic version 1.0
  • authors

    onigiri 60

  • downloads
    voxlap .vxl 2.32 MiB
    Download
    pyspades .txt 1.33 KiB
    Download
  • text file
    name = "Olympic"
    version = '1.0'
    author = 'onigiri'
    fog=(128,232,255)
    
    # script
    from pyspades.server import ServerConnection
    from pyspades.constants import *
    import random
    
    
    def get_entity_location(team, entity_id):
        if entity_id == GREEN_FLAG:
            z = team.protocol.map.get_z(0, 0)
            return ( 197, 300, 57)
        if entity_id == GREEN_BASE:
            z = team.protocol.map.get_z(0, 0)
            return (289, 282, 58)
        if entity_id == BLUE_FLAG:
            z = team.protocol.map.get_z(0, 0)
            return ( 197, 282, 57)
        if entity_id == BLUE_BASE:
            z = team.protocol.map.get_z(0, 0)
            return  ( 289, 300, 58)
    
    
    spawn_locations_blue = [
        ( 291, 236, 60),( 202, 199, 59),( 232, 191, 59),
    ]
    
    spawn_locations_green = [
        ( 267, 327, 59),( 290, 358, 59),( 216, 356, 59)
    ]
    
    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 -= 0 # 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)