Like r1ctf, but with 2 intels
Code: Select all
"""
thepolm3
rctf, like r1ctf, but cooler :P
"""
from pyspades.collision import vector_collision
from twisted.internet.task import LoopingCall
def apply_script(protocol, connection, config):
class RctfProtocol(protocol):
game_mode=0
def on_flag_spawn(self,x,y,z,flag,entity_id):
return flag.team.other.get_random_location(True)
class RctfConnection(connection):
tentcheck=None
def on_spawn(self,pos):
if self.tentcheck:
self.tentcheck.stop()
self.tentcheck=LoopingCall(self.check_tent)
self.tentcheck.start(0.1)
return connection.on_spawn(self,pos)
def check_tent(self):
if self.world_object:
if vector_collision(self.world_object.position, self.team.other.base):
self.capture_flag(True)
def capture_flag(self,ovveride=False):
if ovveride:
return connection.capture_flag(self)
self.send_chat("Take the intel to the other team's base to score")
return
return RctfProtocol, RctfConnection