Busan Port version 1.0
  • description

    Based on real port in Busan, Korea. Enjoy!

  • authors

    kmsi 12 Galaxy 2 phalanx 1 ilrak 2

  • downloads
    voxlap .vxl 2.82 MiB
    Download
    pyspades .txt 1.94 KiB
    Download
  • text file
    name = 'Busan Port'
    
    version = '1'
    
    author = 'ilrak, phalanx, kmsi'
    
    description = 'Based on real port in Busan, Korea. Enjoy!'
    
    extensions = {
    'boundary_damage' :
        {
            'left' : 95,
            'right' : 416,
            'top' : 31,
            'bottom' : 480,
            'damage' : 30
        }
    }
    
    #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 (396, 470, 53)
    
        if entity_id == GREEN_FLAG:
    
            return (396, 41, 53)
    
        if entity_id == BLUE_BASE:
    
            return (406, 470, 53)
    
        if entity_id == GREEN_BASE:
    
            return (406, 41, 53)
    
    
    spawn_locations_blue = [
                           (396, 450, 53), 
                           (283, 450, 53), 
                           (208, 450, 53)
    ]
    spawn_locations_green = [
                           (396, 61, 53), 
                           (283, 61, 53), 
                           (208, 61, 53)
    ]
    
    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
        y += 0
        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)
    
    global protected_x, protected_y
    
    protected_x=[95,416]
    protected_y=[31,480]
    # protects specific x, y coordinate from building
    # by kmsi([email protected])
            
    def on_block_destroy(self, x, y, z, mode):
        if (x==protected_x[0]) or (x==protected_x[1]) or (y==protected_y[0]) or (y==protected_y[1]):
            return False
            
    def on_block_build_attempt(self, x, y, z):
        if (x==protected_x[0]) or (x==protected_x[1]) or (y==protected_y[0]) or (y==protected_y[1]):
            return False