Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # The idea of Push
- # Teams spawn at set locations with the intel
- # They push the intel towards the CP's, which is also a set location
- #
- #Essentially we need read the map meta data get the spawn and cp locations
- # and have the players and cp spawn at the apporiate locations
- #
- #Bonus feature: on intel cap the map rollbacks
- #
- # Sample extensions dictionary of an arena map with two gates:
- # In this example there is one spawn location for blue and two spawn locations for green.
- # extensions = {
- # 'push': True,
- # 'push_blue_spawn' : (91, 276, 59),
- # 'push_blue_cp' : (91, 276, 59),
- # 'push_green_spawn' : (78, 86, 59),
- # 'push_green_cp' : (78, 86, 59),
- # 'water_damage' : 100
- # }
- # If ALWAYS_ENABLED is False, then the 'push' key must be set to True in
- # the 'extensions' dictionary in the map metadata
- ALWAYS_ENABLED = False
- def apply_script(protocol, connection, config):
- class PushConnection(connection):
- class PushProtocol(protocol):
- def on_map_change(self, map):
- extensions = self.map_info.extensions
- if ALWAYS_ENABLED:
- self.push_enabled = True
- else:
- if extensions.has_key('push'):
- self.push_enabled = extensions['push']
- else:
- self.push_enabled = False
- if self.push_enabled:
- if extensions.has_key('push_blue_spawn'):
- self.blue_team.push_spawns = extensions['push_blue_spawn']
- if extensions.has_key('push_green_spawn'):
- self.green_team.push_spawns = extensions['push_green_spawn']
- return protocol.on_map_change(self, map)
- return PushProtocol, PushConnection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement