new scoreboard , auto team balance , auto coop mode with less players, fetch playlist anytime,powrups,quickturn

This commit is contained in:
imayushsaini 2021-11-29 18:52:58 +05:30
parent 9d9ffe5e42
commit f460316202
196 changed files with 1315 additions and 227 deletions

View file

@ -93,7 +93,7 @@ ffa_series_length: 24
# currently-signed-in account's id. To fetch info about an account, # currently-signed-in account's id. To fetch info about an account,
# your back-end server can use the following url: # your back-end server can use the following url:
# http://bombsquadgame.com/accountquery?id=ACCOUNT_ID_HERE # http://bombsquadgame.com/accountquery?id=ACCOUNT_ID_HERE
#stats_url: https://mystatssite.com/showstats?player=${ACCOUNT} stats_url: https://discord.gg/ucyaesh
# If present, the server subprocess will attempt to gracefully exit after # If present, the server subprocess will attempt to gracefully exit after
# this amount of time. A graceful exit can occur at the end of a series # this amount of time. A graceful exit can occur at the end of a series

View file

@ -13,7 +13,7 @@ if TYPE_CHECKING:
import ba import ba
TEAM_COLORS = [(0.2, 0.4, 1.6)] TEAM_COLORS = [(0.2, 0.4, 1.6)]
TEAM_NAMES = ['Good Guys'] TEAM_NAMES = ['Humans']
class CoopSession(Session): class CoopSession(Session):
@ -33,7 +33,7 @@ class CoopSession(Session):
""" """
use_teams = True use_teams = True
use_team_colors = False use_team_colors = False
allow_mid_activity_joins = False allow_mid_activity_joins = True
# Note: even though these are instance vars, we annotate them at the # Note: even though these are instance vars, we annotate them at the
# class level so that docs generation can access their types. # class level so that docs generation can access their types.
@ -92,11 +92,11 @@ class CoopSession(Session):
def should_allow_mid_activity_joins(self, activity: ba.Activity) -> bool: def should_allow_mid_activity_joins(self, activity: ba.Activity) -> bool:
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from ba._gameactivity import GameActivity # from ba._gameactivity import GameActivity
# Disallow any joins in the middle of the game. # Disallow any joins in the middle of the game.
if isinstance(activity, GameActivity): # if isinstance(activity, GameActivity):
return False # return False
return True return True
@ -127,10 +127,12 @@ class CoopSession(Session):
level = self.campaign.getlevel(self.campaign_level_name) level = self.campaign.getlevel(self.campaign_level_name)
nextlevel: Optional[ba.Level] nextlevel: Optional[ba.Level]
if level.index < len(levels) - 1: # if level.index < len(levels) - 1:
nextlevel = levels[level.index + 1] # nextlevel = levels[level.index + 1]
else: # else:
nextlevel = None # nextlevel = None
nextlevel=levels[(level.index+1)%len(levels)]
if nextlevel: if nextlevel:
gametype = nextlevel.gametype gametype = nextlevel.gametype
settings = nextlevel.get_settings() settings = nextlevel.get_settings()
@ -278,8 +280,18 @@ class CoopSession(Session):
# If we're in a between-round activity or a restart-activity, # If we're in a between-round activity or a restart-activity,
# hop into a round. # hop into a round.
if outcome=="victory" or outcome=="restart" or outcome=="defeat":
outcome = 'next_level'
if (isinstance(activity, if (isinstance(activity,
(JoinActivity, CoopScoreScreen, TransitionActivity))): (JoinActivity, CoopScoreScreen, TransitionActivity))) or True:
from tools import TeamBalancer
TeamBalancer.checkToExitCoop()
if outcome == 'next_level': if outcome == 'next_level':
if self._next_game_instance is None: if self._next_game_instance is None:
@ -339,7 +351,11 @@ class CoopSession(Session):
# actual round. # actual round.
elif isinstance(activity, TutorialActivity): elif isinstance(activity, TutorialActivity):
self.setactivity(_ba.newactivity(TransitionActivity)) self.setactivity(_ba.newactivity(TransitionActivity))
else: else:
pass
if False:
playerinfos: list[ba.PlayerInfo] playerinfos: list[ba.PlayerInfo]

View file

@ -347,9 +347,7 @@ def on_kick_vote_end() -> None:
pass pass
# print("kick vote end") # print("kick vote end")
def on_player_join(pb_id:str)-> None: def on_player_join(pb_id:str)-> None:
pass pass
# print(pb_id+" joined python layer") # print(pb_id+" joined python layer")

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more