good play!
voxlap .vxl | 2.03 MiB | |
pyspades .txt | 1.23 KiB |
Water damage 🌊 Arena 🏟️
name = 'Four way'
version = '1.0'
author = '|CyndaquiL|'
description = 'good play!'
protected = ['G8', 'H8']
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 (435, 486, 41)
if entity_id == GREEN_FLAG:
return (509, 486, 41)
if entity_id == BLUE_BASE:
return (437, 486, 41)
if entity_id == GREEN_BASE:
return (507, 486, 41)
spawn_locations_blue = [
(444, 480, 41),
(444, 491, 41),
(435 ,485, 41)
]
spawn_locations_green = [
(500, 491, 41),
(500, 480, 41),
(508, 485, 41)
]
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)