[GAME MODE] Rush

Intended for use on live public servers.
16 posts Page 1 of 2 First unread post
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


Sorta like TOW, but the blue team has longer respawns and can't capture teritories. If the green team capture all the teretories, they win. Otherwise, after 5 minutes, the blue team win. Sound fun?
Code: Select all
"""
Rush by thepolm3.
Horray!
"""

from pyspades.constants import *
from pyspades.server import Territory
from random import randint
from twisted.internet.reactor import callLater

CP_COUNT = 4
TIME_LIMIT=5 #minutes before blue wins
WILDNESS=10

def apply_script(protocol, connection, config):
    class RushTerritory(Territory):
    
        def add_player(self, player):
            if player.team==self.protocol.blue_team and self.team!=player.team:return
            if self.team.id:move = -1
            else: move = 1
            try:
                if self.protocol.entities[self.id+move].team==self.team:return
            except Exception:
                pass
            Territory.add_player(self, player)
        
    class RushConnection(connection):

        def get_respawn_time(self):
            if self.team==self.protocol.blue_team:
                return (self.protocol.respawn_time-1)*2
            return connection.get_respawn_time(self)
            
    class RushProtocol(protocol):
        game_mode = TC_MODE

        def get_cp_entities(self):
            entities=[]
            p=WILDNESS
            add=0
            a,b,c=randint(-p,p),randint(-p,p),randint(-p,p)
            #generate a quadratic equation (ax^2)+bx+c
            p=min(16,max(1,CP_COUNT)) #gets us a value between 1 and 16
            xspread=(min(100,500/p)) #gets how spread out the tents will be
            xstart=randint(0,abs(512-(p*xspread))) #gets where to start
            xys=[]
            for i in range(p):
                x=float((xstart+xspread*i)-256)/50 #gets the x
                y=(a*(x**2))+(b*x)+c+256 #finds the y
                x=(x*50)+256 #undoes any negativity
                xys.append([x,y]) #add it to da list
                add=min(max(add,-y),512-y) #if out of bounds, add that to all tents
            for i in range(len(xys)):
                x,y=xys[i]
                y=min(max(0,y+add),512) #get the true y
                z=self.map.get_z(x,y) #get x
                cp = RushTerritory(i,self,x,y,z) #turn this indo into a territory
                cp.team=self.blue_team
                entities.append(cp) #add it to da list
            return entities #PWNAGE AT ALGEBRA

        def on_map_change(self,map):
            callLater(TIME_LIMIT*60,self.reset_game)
            return protocol.on_map_change(self,map)

    return RushProtocol, RushConnection
Attachments
rush.py
(2.41 KiB) Downloaded 186 times
Last edited by thepolm3 on Sat Jun 22, 2013 8:55 am, edited 2 times in total.
KillerShot


Yes, it does sound fun. Could any server host it?
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


Best gamemode yet, besides moba that is. Keep up the great work!
Handles
League Participant
League Participant
Posts: 1087
Joined: Tue Jan 08, 2013 9:46 pm


Wow, nice. I should talk to topo or PABH or tin and ask them to use this in their next event Green_BigSmile
IceCream
Hoster
Hoster
Posts: 322
Joined: Thu Nov 01, 2012 12:18 pm


nice script thepolm3 :)

btw. I could host a server, if you want.

IceCraft
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


IceCraft wrote:
nice script thepolm3 :)

btw. I could host a server, if you want.

IceCraft
I would like that
IceCream
Hoster
Hoster
Posts: 322
Joined: Thu Nov 01, 2012 12:18 pm


k server online
IceCream
Hoster
Hoster
Posts: 322
Joined: Thu Nov 01, 2012 12:18 pm


btw., the anti-respawn makes the gamemode a bit boring and the players mad. they disconnect very fast. may you could chnage it? :)
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


I tested it ot on icecraft and heres what I think. The gamemode is fun, kind like a tc version of infiltration, but the no respawn makes a lot of the players mad and forces them to leave. Its fun but with the no respawn it makes the gamemode boring.
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


What would you suggest?
You understand, I just implemented a suggestion I got
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


I suggest having the respawn be set at 7 seconds, the gamemode is fine you just need to enable respawning. Can you define the respawn time in the gamemode?
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


Finished!
Now blue takes double the time to respawn, but doesn't have limited respawns
XxXAtlanXxX
Deuced Up
Posts: 557
Joined: Sun Dec 16, 2012 12:26 am


<3
Venator
League Participant
League Participant
Posts: 1225
Joined: Wed Nov 07, 2012 8:32 pm


thepolm3 masterscripter.
<33333
TB_
Post Demon
Post Demon
Posts: 998
Joined: Tue Nov 20, 2012 6:59 pm


Do the tents spawn at random places, or do you select it some places for custom maps?
16 posts Page 1 of 2 First unread post
Return to “Completed Releases”

Who is online

Users browsing this forum: No registered users and 20 guests