diff --git a/.efrocachemap b/.efrocachemap index 0e2e2414..d6c71862 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4132,16 +4132,16 @@ "assets/build/windows/x64/python.exe": "https://files.ballistica.net/cache/ba1/25/a7/dc87c1be41605eb6fefd0145144c", "assets/build/windows/x64/python37.dll": "https://files.ballistica.net/cache/ba1/b9/e4/d912f56e42e9991bcbb4c804cfcb", "assets/build/windows/x64/pythonw.exe": "https://files.ballistica.net/cache/ba1/6c/bb/b6f52c306aa4e88061510e96cefe", - "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e4/b6/bbdb904d5cea6023a50d4dc2c9e9", - "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/17/34/76b4411678f95106d2e3e368c79b", - "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/83/b9/a679a7aaeb67227f94286ea9fffb", - "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/95/a0/7a95002b5cc7d1bacbda49098fd9", - "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/18/b8/1b547866b77a98fcc5ca43c93a07", - "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ee/c4/0e92e825c67a249a77b16bb7a4fa", - "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/31/1e/2d282dff8a9331b121908061c6bc", - "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/1a/eb/9bf8367a161f3e9fb29b4f61216e", - "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/4a/22/30984f1fd3a430755ea62c80ec76", - "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/fe/f5/e99958f225c4b342c1bd4ecb0c23", - "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/54/fd/b26b46b083240ad3855ba93cb42d", - "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/a7/ee/ec0ee56e6f7254b460c4f1116a0c" + "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/86/fd/1edae1d48773436f72ceaf5c4588", + "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/07/88/2e60127c99cd8018f4b7a77c455b", + "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/01/ef/2c661b395a46f1abbd6c2042cb50", + "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/98/ad/d73757e8902b9c5c36c73469773b", + "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/94/e3/9ad5acc492f343a24e790be07ed0", + "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9a/1f/5ae4c3d9b710b24ea2464c1f62ab", + "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/83/f9/de5c6a7a1dd65f305565bd5a0897", + "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c7/29/1f1d904b57ef0379654421737c6b", + "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/bd/7b/308923feba6216c72c565cb9a942", + "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/ce/44/4d2658f31d74fb342604e38bf12a", + "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/53/d7/89dfbf816f8fe6824cf9f62f81f6", + "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/1c/b8/d9def95f52348a50d01b4a9a3996" } \ No newline at end of file diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py index fe13f9ad..6b5325df 100644 --- a/assets/src/ba_data/python/_ba.py +++ b/assets/src/ba_data/python/_ba.py @@ -34,7 +34,7 @@ NOTE: This file was autogenerated by gendummymodule; do not edit by hand. """ # (hash we can use to see if this file is out of date) -# SOURCES_HASH=122350585846084418668853979161934598264 +# SOURCES_HASH=68384686054944380533078060197841658129 # I'm sorry Pylint. I know this file saddens you. Be strong. # pylint: disable=useless-suppression diff --git a/assets/src/ba_data/python/ba/_lobby.py b/assets/src/ba_data/python/ba/_lobby.py index b8c08820..ac7971ee 100644 --- a/assets/src/ba_data/python/ba/_lobby.py +++ b/assets/src/ba_data/python/ba/_lobby.py @@ -987,7 +987,7 @@ class Lobby: self._vpos -= 48 def remove_chooser(self, player: ba.SessionPlayer) -> None: - """Remove a single player's chooser; does not kick him. + """Remove a single player's chooser; does not kick them. This is used when a player enters the game and no longer needs a chooser.""" diff --git a/assets/src/ba_data/python/ba/_player.py b/assets/src/ba_data/python/ba/_player.py index baf64908..6622e609 100644 --- a/assets/src/ba_data/python/ba/_player.py +++ b/assets/src/ba_data/python/ba/_player.py @@ -19,6 +19,7 @@ # SOFTWARE. # ----------------------------------------------------------------------------- """Player related functionality.""" + from __future__ import annotations from typing import TYPE_CHECKING, TypeVar, Generic @@ -32,7 +33,13 @@ TeamType = TypeVar('TeamType', bound='ba.Team') class Player(Generic[TeamType]): - """Testing.""" + """A player in a specific ba.Activity. + + Category: Gameplay Classes + + These correspond to ba.SessionPlayer objects, but are created per activity + so that the activity can use its own custom player subclass. + """ # Defining these types at the class level instead of in __init__ so # that types are introspectable (these are still instance attrs). @@ -112,7 +119,7 @@ class Player(Generic[TeamType]): @property def exists(self) -> bool: - """Whether the player still exists. + """Whether the underlying player still exists. Most functionality will fail on a nonexistent player. Note that you can also use the boolean operator for this same diff --git a/assets/src/ba_data/python/ba/_session.py b/assets/src/ba_data/python/ba/_session.py index cbd8ec11..e46d7a10 100644 --- a/assets/src/ba_data/python/ba/_session.py +++ b/assets/src/ba_data/python/ba/_session.py @@ -46,7 +46,7 @@ class Session: ba.Activity instances such as mini-games and score-screens, and for maintaining state between them (players, teams, score tallies, etc). - Attributes: + Attrs: teams All the ba.Teams in the Session. Most things should use the team @@ -74,10 +74,24 @@ class Session: The ba.Campaign instance this Session represents, or None if there is no associated Campaign. + use_teams + Whether this session groups players into an explicit set of + teams. If this is off, a unique team is generated for each + player that joins. + + use_team_colors + Whether players on a team should all adopt the colors of that + team instead of their own profile colors. This only applies if + use_teams is enabled. + + allow_mid_activity_joins + Whether players should be allowed to join in the middle of + activities. + """ - use_teams = False - use_team_colors = True - allow_mid_activity_joins = True + use_teams: bool = False + use_team_colors: bool = True + allow_mid_activity_joins: bool = True # Note: even though these are instance vars, we annotate them at the # class level so that docs generation can access their types. diff --git a/assets/src/ba_data/python/ba/_team.py b/assets/src/ba_data/python/ba/_team.py index 8a6beaae..2e92d4e9 100644 --- a/assets/src/ba_data/python/ba/_team.py +++ b/assets/src/ba_data/python/ba/_team.py @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # ----------------------------------------------------------------------------- -"""Defines Team class.""" +"""Team related functionality.""" + from __future__ import annotations import weakref @@ -35,9 +36,9 @@ class SessionTeam: Category: Gameplay Classes - Note that a player *always* has a team; + Note that a SessionPlayer *always* has a SessionTeam; in some cases, such as free-for-all ba.Sessions, - each team consists of just one ba.Player. + each SessionTeam consists of just one SessionPlayer. Attributes: @@ -104,7 +105,13 @@ PlayerType = TypeVar('PlayerType', bound='ba.Player') class Team(Generic[PlayerType]): - """Testing.""" + """A team in a specific ba.Activity. + + Category: Gameplay Classes + + These correspond to ba.SessionTeam objects, but are created per activity + so that the activity can use its own custom team subclass. + """ # Defining these types at the class level instead of in __init__ so # that types are introspectable (these are still instance attrs). diff --git a/assets/src/ba_data/python/bastd/game/elimination.py b/assets/src/ba_data/python/bastd/game/elimination.py index d94c7988..97361733 100644 --- a/assets/src/ba_data/python/bastd/game/elimination.py +++ b/assets/src/ba_data/python/bastd/game/elimination.py @@ -263,9 +263,9 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]): # No longer allowing mid-game joiners here; too easy to exploit. if self.has_begun(): - # Make sure our team has survival seconds set if they're all dead - # (otherwise blocked new ffa players would be considered 'still - # alive' in score tallying). + # Make sure their team has survival seconds set if they're all dead + # (otherwise blocked new ffa players are considered 'still alive' + # in score tallying). if (self._get_total_team_lives(player.team) == 0 and player.team.survival_seconds is None): player.team.survival_seconds = 0 diff --git a/docs/ba_module.md b/docs/ba_module.md index ecfa922a..8ec9e7f4 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -

last updated on 2020-05-20 for Ballistica version 1.5.0 build 20023

+

last updated on 2020-05-20 for Ballistica version 1.5.0 build 20024

This page documents the Python classes and functions in the 'ba' module, which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know. Happy modding!


@@ -25,6 +25,7 @@
  • ba.Lobby
  • ba.Material
  • ba.Node
  • +
  • ba.Player
  • ba.PlayerRecord
  • ba.ScoreInfo
  • ba.Session
  • @@ -39,6 +40,7 @@
  • ba.SessionPlayer
  • ba.SessionTeam
  • ba.Stats
  • +
  • ba.Team
  • ba.TeamGameResults
  • Gameplay Functions

    @@ -196,11 +198,6 @@
  • ba.WidgetNotFoundError
  • -

    Misc Classes

    -

    ba.Achievement

    <top level class> @@ -1593,7 +1590,7 @@ and it should begin its actual game logic.

    Attributes Inherited:

    -
    campaign, lobby, max_players, min_players, players, teams
    +
    allow_mid_activity_joins, campaign, lobby, max_players, min_players, players, teams, use_team_colors, use_teams

    Methods Inherited:

    begin_next_activity(), end(), end_activity(), getactivity(), handlemessage(), launch_end_session_activity(), on_player_request(), on_team_join(), on_team_leave(), set_activity()

    Methods Defined or Overridden:

    @@ -1926,7 +1923,7 @@ its time with lingering corpses, sound effects, etc.

    Attributes Inherited:

    -
    campaign, lobby, max_players, min_players, players, teams
    +
    allow_mid_activity_joins, campaign, lobby, max_players, min_players, players, teams, use_team_colors, use_teams

    Methods Inherited:

    announce_game_results(), begin_next_activity(), end(), end_activity(), get_custom_menu_entries(), get_ffa_series_length(), get_game_number(), get_max_players(), get_next_game_description(), get_series_length(), getactivity(), handlemessage(), launch_end_session_activity(), on_activity_end(), on_player_leave(), on_player_request(), on_team_join(), on_team_leave(), set_activity()

    Methods Defined or Overridden:

    @@ -1947,7 +1944,7 @@ its time with lingering corpses, sound effects, etc.

    Attributes Inherited:

    -
    campaign, lobby, max_players, min_players, players, teams
    +
    allow_mid_activity_joins, campaign, lobby, max_players, min_players, players, teams, use_team_colors, use_teams

    Methods Inherited:

    announce_game_results(), begin_next_activity(), end(), end_activity(), get_custom_menu_entries(), get_ffa_series_length(), get_game_number(), get_max_players(), get_next_game_description(), get_series_length(), getactivity(), handlemessage(), launch_end_session_activity(), on_activity_end(), on_player_leave(), on_player_request(), on_team_join(), on_team_leave(), set_activity()

    Methods Defined or Overridden:

    @@ -2783,7 +2780,7 @@ Intended for use in initial joining-screens.

    remove_chooser()

    remove_chooser(self, player: ba.SessionPlayer) -> None

    -

    Remove a single player's chooser; does not kick him.

    +

    Remove a single player's chooser; does not kick them.

    This is used when a player enters the game and no longer needs a chooser.

    @@ -3240,7 +3237,7 @@ Use ba.getmodel() to instantiate one.

    Attributes Inherited:

    -
    campaign, lobby, max_players, min_players, players, teams
    +
    allow_mid_activity_joins, campaign, lobby, max_players, min_players, players, teams, use_team_colors, use_teams

    Methods Inherited:

    begin_next_activity(), end(), end_activity(), get_custom_menu_entries(), getactivity(), handlemessage(), launch_end_session_activity(), on_player_leave(), on_player_request(), on_team_leave(), set_activity()

    Methods Defined or Overridden:

    @@ -3711,14 +3708,20 @@ even if myactor is set to None.


    ba.Player

    inherits from: typing.Generic

    -

    Testing.

    +

    A player in a specific ba.Activity.

    + +

    Category: Gameplay Classes

    + +

    These correspond to ba.SessionPlayer objects, but are created per activity + so that the activity can use its own custom player subclass. +

    Attributes:

    exists, node, sessionplayer

    exists

    bool

    -

    Whether the player still exists.

    +

    Whether the underlying player still exists.

    Most functionality will fail on a nonexistent player. Note that you can also use the boolean operator for this same @@ -4100,8 +4103,14 @@ Pass 0 or a negative number for no ban time.

    maintaining state between them (players, teams, score tallies, etc).

    Attributes:

    -
    campaign, lobby, max_players, min_players, players, teams
    +
    allow_mid_activity_joins, campaign, lobby, max_players, min_players, players, teams, use_team_colors, use_teams
    +

    allow_mid_activity_joins

    +

    bool

    +

    Whether players should be allowed to join in the middle of +activities.

    + +

    campaign

    Optional[ba.Campaign]

    The ba.Campaign instance this Session represents, or None if @@ -4139,6 +4148,20 @@ not yet selected a character, will only appear on this list.

    All the ba.Teams in the Session. Most things should use the team list in ba.Activity; not this.

    +
    +

    use_team_colors

    +

    bool

    +

    Whether players on a team should all adopt the colors of that +team instead of their own profile colors. This only applies if +use_teams is enabled.

    + +
    +

    use_teams

    +

    bool

    +

    Whether this session groups players into an explicit set of +teams. If this is off, a unique team is generated for each +player that joins.

    +

    Methods:

    @@ -4434,9 +4457,9 @@ other players.

    Category: Gameplay Classes

    -

    Note that a player *always* has a team; +

    Note that a SessionPlayer *always* has a SessionTeam; in some cases, such as free-for-all ba.Sessions, - each team consists of just one ba.Player.

    + each SessionTeam consists of just one SessionPlayer.

    Attributes:

    color, gamedata, id, name, players, sessiondata
    @@ -4735,7 +4758,13 @@ of the session.


    ba.Team

    inherits from: typing.Generic

    -

    Testing.

    +

    A team in a specific ba.Activity.

    + +

    Category: Gameplay Classes

    + +

    These correspond to ba.SessionTeam objects, but are created per activity + so that the activity can use its own custom team subclass. +

    Attributes: