bascenev1lib.game package¶
Submodules¶
bascenev1lib.game.assault module¶
Defines assault minigame.
- class bascenev1lib.game.assault.AssaultGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game where you score by touching the other team’s flag.
- available_settings = [IntSetting(name='Score to Win', default=3, min_value=1, max_value=9999, increment=1), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- create_team(sessionteam: SessionTeam) Team [source]¶
Create the Team instance for this Activity.
Subclasses can override this if the activity’s team class requires a custom constructor; otherwise it will be called with no args. Note that the team object should not be used at this point as it is not yet fully wired up; wait for on_team_join() for that.
- description = 'Reach the enemy flag to score.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Assault'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
bascenev1lib.game.capturetheflag module¶
Defines a capture-the-flag game.
- class bascenev1lib.game.capturetheflag.CTFFlag(team: Team)[source]¶
Bases:
Flag
Special flag type for CTF games.
- class bascenev1lib.game.capturetheflag.CaptureTheFlagGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game of stealing other team’s flag and returning it to your base.
- available_settings = [IntSetting(name='Score to Win', default=3, min_value=1, max_value=9999, increment=1), IntSetting(name='Flag Touch Return Time', default=0, min_value=0, max_value=9999, increment=1), IntSetting(name='Flag Idle Return Time', default=30, min_value=5, max_value=9999, increment=5), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- create_team(sessionteam: SessionTeam) Team [source]¶
Create the Team instance for this Activity.
Subclasses can override this if the activity’s team class requires a custom constructor; otherwise it will be called with no args. Note that the team object should not be used at this point as it is not yet fully wired up; wait for on_team_join() for that.
- description = 'Return the enemy flag to score.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Capture the Flag'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- spawn_player_spaz(player: Player, position: Sequence[float] | None = None, angle: float | None = None) PlayerSpaz [source]¶
Intercept new spazzes and add our team material for them.
bascenev1lib.game.chosenone module¶
Provides the chosen-one mini-game.
- class bascenev1lib.game.chosenone.ChosenOneGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game involving trying to remain the one ‘chosen one’ for a set length of time while everyone else tries to kill you and become the chosen one themselves.
- available_settings = [IntSetting(name='Chosen One Time', default=30, min_value=10, max_value=9999, increment=10), BoolSetting(name='Chosen One Gets Gloves', default=True), BoolSetting(name='Chosen One Gets Shield', default=False), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- create_team(sessionteam: SessionTeam) Team [source]¶
Create the Team instance for this Activity.
Subclasses can override this if the activity’s team class requires a custom constructor; otherwise it will be called with no args. Note that the team object should not be used at this point as it is not yet fully wired up; wait for on_team_join() for that.
- description = 'Be the chosen one for a length of time to win.\nKill the chosen one to become it.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Chosen One'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_player_leave(player: Player) None [source]¶
Called when a bascenev1.Player is leaving the Activity.
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- scoreconfig = ScoreConfig(label='Time Held', scoretype=<ScoreType.POINTS: 'p'>, lower_is_better=False, none_is_winner=False, version='')¶
bascenev1lib.game.conquest module¶
Provides the Conquest game.
- class bascenev1lib.game.conquest.ConquestFlag(*args: Any, **keywds: Any)[source]¶
Bases:
Flag
A custom flag for use with Conquest games.
- class bascenev1lib.game.conquest.ConquestGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]A game where teams try to claim all flags on the map.
- available_settings = [IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- description = 'Secure all flags on the map to win.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Conquest'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_player_join(player: Player) None [source]¶
Called when a new bascenev1.Player has joined the Activity.
(including the initial set of Players)
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- class bascenev1lib.game.conquest.Player[source]¶
-
Our player type for this game.
- property respawn_icon: RespawnIcon | None¶
Type safe access to standard respawn icon.
bascenev1lib.game.deathmatch module¶
DeathMatch game and support classes.
- class bascenev1lib.game.deathmatch.DeathMatchGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]A game type based on acquiring kills.
- announce_player_deaths = True¶
- description = 'Kill a set number of enemies to win.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_available_settings(sessiontype: type[Session]) list[Setting] [source]¶
Return a list of settings relevant to this game type when running under the provided session type.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Death Match'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
bascenev1lib.game.easteregghunt module¶
Provides an easter egg hunt game.
- class bascenev1lib.game.easteregghunt.EasterEggHuntGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]A game where score is based on collecting eggs.
- available_settings = [BoolSetting(name='Pro Mode', default=False), BoolSetting(name='Epic Mode', default=False)]¶
- description = 'Gather eggs!'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Easter Egg Hunt'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- scoreconfig = ScoreConfig(label='Score', scoretype=<ScoreType.POINTS: 'p'>, lower_is_better=False, none_is_winner=False, version='')¶
- class bascenev1lib.game.easteregghunt.Egg(position: tuple[float, float, float] = (0.0, 1.0, 0.0))[source]¶
Bases:
Actor
A lovely egg that can be picked up for points.
- exists() bool [source]¶
Returns whether the Actor is still present in a meaningful way.
Note that a dying character should still return True here as long as their corpse is visible; this is about presence, not being ‘alive’ (see bascenev1.Actor.is_alive() for that).
If this returns False, it is assumed the Actor can be completely deleted without affecting the game; this call is often used when pruning lists of Actors, such as with bascenev1.Actor.autoretain()
The default implementation of this method always return True.
Note that the boolean operator for the Actor class calls this method, so a simple “if myactor” test will conveniently do the right thing even if myactor is set to None.
bascenev1lib.game.elimination module¶
Elimination mini-game.
- class bascenev1lib.game.elimination.EliminationGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game type where last player(s) left alive win.
- allow_mid_activity_joins = False¶
- announce_player_deaths = True¶
- description = 'Last remaining alive wins.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_available_settings(sessiontype: type[Session]) list[Setting] [source]¶
Return a list of settings relevant to this game type when running under the provided session type.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Elimination'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_player_join(player: Player) None [source]¶
Called when a new bascenev1.Player has joined the Activity.
(including the initial set of Players)
- on_player_leave(player: Player) None [source]¶
Called when a bascenev1.Player is leaving the Activity.
- scoreconfig = ScoreConfig(label='Survived', scoretype=<ScoreType.SECONDS: 's'>, lower_is_better=False, none_is_winner=True, version='')¶
- class bascenev1lib.game.elimination.Icon(player: Player, position: tuple[float, float], scale: float, *, show_lives: bool = True, show_death: bool = True, name_scale: float = 1.0, name_maxwidth: float = 115.0, flatness: float = 1.0, shadow: float = 1.0)[source]¶
Bases:
Actor
Creates in in-game icon on screen.
bascenev1lib.game.football module¶
Implements football games (both co-op and teams varieties).
- class bascenev1lib.game.football.FootballCoopGame(settings: dict)[source]¶
Bases:
CoopGameActivity
[Player
,Team
]Co-op variant of football.
- default_music = 'Football'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_score_type() str [source]¶
Return the score unit this co-op game uses (‘point’, ‘seconds’, etc.)
- name = 'Football'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_transition_in() None [source]¶
Called when the Activity is first becoming visible.
Upon this call, the Activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous Activity up until bascenev1.Activity.on_begin() is called.
- scoreconfig = ScoreConfig(label='Score', scoretype=<ScoreType.MILLISECONDS: 'ms'>, lower_is_better=False, none_is_winner=False, version='B')¶
- spawn_player(player: Player) Actor [source]¶
Spawn something for the provided bascenev1.Player.
The default implementation simply calls spawn_player_spaz().
- tips = ['Use the pick-up button to grab the flag < ${PICKUP} >']¶
- class bascenev1lib.game.football.FootballFlag(position: Sequence[float])[source]¶
Bases:
Flag
Custom flag class for football games.
- class bascenev1lib.game.football.FootballTeamGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Football game for teams mode.
- available_settings = [IntSetting(name='Score to Win', default=21, min_value=7, max_value=9999, increment=7), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- description = 'Get the flag to the enemy end zone.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Football'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
bascenev1lib.game.hockey module¶
Hockey game and support classes.
- class bascenev1lib.game.hockey.HockeyGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Ice hockey game.
- available_settings = [IntSetting(name='Score to Win', default=1, min_value=1, max_value=9999, increment=1), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- description = 'Score some goals.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Hockey'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- class bascenev1lib.game.hockey.Puck(position: Sequence[float] = (0.0, 1.0, 0.0))[source]¶
Bases:
Actor
A lovely giant hockey puck.
bascenev1lib.game.keepaway module¶
Defines a keep-away game type.
- class bascenev1lib.game.keepaway.FlagState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
States our single flag can be in.
- CONTESTED = 2¶
- HELD = 3¶
- NEW = 0¶
- UNCONTESTED = 1¶
- class bascenev1lib.game.keepaway.KeepAwayGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game where you try to keep the flag away from your enemies.
- available_settings = [IntSetting(name='Hold Time', default=30, min_value=10, max_value=9999, increment=10), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- create_team(sessionteam: SessionTeam) Team [source]¶
Create the Team instance for this Activity.
Subclasses can override this if the activity’s team class requires a custom constructor; otherwise it will be called with no args. Note that the team object should not be used at this point as it is not yet fully wired up; wait for on_team_join() for that.
- description = 'Carry the flag for a set length of time.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Keep Away'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- scoreconfig = ScoreConfig(label='Time Held', scoretype=<ScoreType.POINTS: 'p'>, lower_is_better=False, none_is_winner=False, version='')¶
bascenev1lib.game.kingofthehill module¶
Defines the King of the Hill game.
- class bascenev1lib.game.kingofthehill.FlagState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
States our single flag can be in.
- CONTESTED = 2¶
- HELD = 3¶
- NEW = 0¶
- UNCONTESTED = 1¶
- class bascenev1lib.game.kingofthehill.KingOfTheHillGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game where a team wins by holding a ‘hill’ for a set amount of time.
- available_settings = [IntSetting(name='Hold Time', default=30, min_value=10, max_value=9999, increment=10), IntChoiceSetting(name='Time Limit', default=0, choices=[('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200)]), FloatChoiceSetting(name='Respawn Times', default=1.0, choices=[('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0)]), BoolSetting(name='Epic Mode', default=False)]¶
- create_team(sessionteam: SessionTeam) Team [source]¶
Create the Team instance for this Activity.
Subclasses can override this if the activity’s team class requires a custom constructor; otherwise it will be called with no args. Note that the team object should not be used at this point as it is not yet fully wired up; wait for on_team_join() for that.
- description = 'Secure the flag for a set length of time.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'King of the Hill'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- scoreconfig = ScoreConfig(label='Time Held', scoretype=<ScoreType.POINTS: 'p'>, lower_is_better=False, none_is_winner=False, version='')¶
bascenev1lib.game.meteorshower module¶
Defines a bomb-dodging mini-game.
- class bascenev1lib.game.meteorshower.MeteorShowerGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Minigame involving dodging falling bombs.
- allow_mid_activity_joins = False¶
- announce_player_deaths = True¶
- available_settings = [BoolSetting(name='Epic Mode', default=False)]¶
- description = 'Dodge the falling bombs.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Meteor Shower'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_player_leave(player: Player) None [source]¶
Called when a bascenev1.Player is leaving the Activity.
- scoreconfig = ScoreConfig(label='Survived', scoretype=<ScoreType.MILLISECONDS: 'ms'>, lower_is_better=False, none_is_winner=False, version='B')¶
bascenev1lib.game.ninjafight module¶
Provides Ninja Fight mini-game.
- class bascenev1lib.game.ninjafight.NinjaFightGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]A co-op game where you try to defeat a group of Ninjas as fast as possible
- default_music = 'ToTheDeath'¶
- description = 'How fast can you defeat the ninjas?'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Ninja Fight'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- scoreconfig = ScoreConfig(label='Time', scoretype=<ScoreType.MILLISECONDS: 'ms'>, lower_is_better=True, none_is_winner=False, version='')¶
bascenev1lib.game.onslaught module¶
Provides Onslaught Co-op game.
- class bascenev1lib.game.onslaught.Delay(duration: float)[source]¶
Bases:
object
A delay between events in a wave.
- duration: float¶
- class bascenev1lib.game.onslaught.OnslaughtGame(settings: dict)[source]¶
Bases:
CoopGameActivity
[Player
,Team
]Co-op game where players try to survive attacking waves of enemies.
- add_bot_at_angle(angle: float, spaz_type: type[SpazBot], spawn_time: float = 1.0) None [source]¶
Add a new bot at a specified angle (for circular maps).
- add_bot_at_point(point: Point, spaz_type: type[SpazBot], spawn_time: float = 1.0) None [source]¶
Add a new bot at a specified named point.
- announce_player_deaths = True¶
- description = 'Defeat all enemies.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- name = 'Onslaught'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_transition_in() None [source]¶
Called when the Activity is first becoming visible.
Upon this call, the Activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous Activity up until bascenev1.Activity.on_begin() is called.
- spawn_player(player: Player) Actor [source]¶
Spawn something for the provided bascenev1.Player.
The default implementation simply calls spawn_player_spaz().
- tips: list[str | bs.GameTip] = ['Hold any button to run. (Trigger buttons work well if you have them)', 'Try tricking enemies into killing eachother or running off cliffs.', "Try 'Cooking off' bombs for a second or two before throwing them.", "It's easier to win with a friend or two helping.", "If you stay in one place, you're toast. Run and dodge to survive..", 'Practice using your momentum to throw bombs more accurately.', 'Your punches do much more damage if you are running or spinning.']¶
- class bascenev1lib.game.onslaught.Point(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Points on the map we can spawn at.
- BOTTOM = 'bot_spawn_bottom'¶
- BOTTOM_HALF_LEFT = 'bot_spawn_bottom_half_left'¶
- BOTTOM_HALF_RIGHT = 'bot_spawn_bottom_half_right'¶
- BOTTOM_LEFT = 'bot_spawn_bottom_left'¶
- BOTTOM_RIGHT = 'bot_spawn_bottom_right'¶
- LEFT = 'bot_spawn_left'¶
- LEFT_LOWER = 'bot_spawn_left_lower'¶
- LEFT_LOWER_MORE = 'bot_spawn_left_lower_more'¶
- LEFT_UPPER = 'bot_spawn_left_upper'¶
- LEFT_UPPER_MORE = 'bot_spawn_left_upper_more'¶
- RIGHT = 'bot_spawn_right'¶
- RIGHT_LOWER = 'bot_spawn_right_lower'¶
- RIGHT_LOWER_MORE = 'bot_spawn_right_lower_more'¶
- RIGHT_UPPER = 'bot_spawn_right_upper'¶
- RIGHT_UPPER_MORE = 'bot_spawn_right_upper_more'¶
- TOP = 'bot_spawn_top'¶
- TOP_HALF_LEFT = 'bot_spawn_top_half_left'¶
- TOP_HALF_RIGHT = 'bot_spawn_top_half_right'¶
- TOP_LEFT = 'bot_spawn_top_left'¶
- TOP_RIGHT = 'bot_spawn_top_right'¶
- TURRET_BOTTOM_LEFT = 'bot_spawn_turret_bottom_left'¶
- TURRET_BOTTOM_RIGHT = 'bot_spawn_turret_bottom_right'¶
- TURRET_TOP_LEFT = 'bot_spawn_turret_top_left'¶
- TURRET_TOP_MIDDLE = 'bot_spawn_turret_top_middle'¶
- TURRET_TOP_MIDDLE_LEFT = 'bot_spawn_turret_top_middle_left'¶
- TURRET_TOP_MIDDLE_RIGHT = 'bot_spawn_turret_top_middle_right'¶
- TURRET_TOP_RIGHT = 'bot_spawn_turret_top_right'¶
- class bascenev1lib.game.onslaught.Preset(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Game presets we support.
- ENDLESS = 'endless'¶
- ENDLESS_TOURNAMENT = 'endless_tournament'¶
- PRO = 'pro'¶
- PRO_EASY = 'pro_easy'¶
- ROOKIE = 'rookie'¶
- ROOKIE_EASY = 'rookie_easy'¶
- TRAINING = 'training'¶
- TRAINING_EASY = 'training_easy'¶
- UBER = 'uber'¶
- UBER_EASY = 'uber_easy'¶
- class bascenev1lib.game.onslaught.Spacing(spacing: float = 5.0)[source]¶
Bases:
object
Empty space in a wave.
- spacing: float = 5.0¶
bascenev1lib.game.race module¶
Defines Race mini-game.
- class bascenev1lib.game.race.RaceGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game of racing around a track.
- description = 'Run real fast!'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_available_settings(sessiontype: type[Session]) list[Setting] [source]¶
Return a list of settings relevant to this game type when running under the provided session type.
- get_instance_description() str | Sequence [source]¶
Return a description for this game instance, in English.
This is shown in the center of the screen below the game name at the start of a game. It should start with a capital letter and end with a period, and can be a bit more verbose than the version returned by get_instance_description_short().
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘Score 3 goals.’ in English # and can properly translate to ‘Anota 3 goles.’ in Spanish. # If we just returned the string ‘Score 3 Goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘Score ${ARG1} goals.’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- get_instance_description_short() str | Sequence [source]¶
Return a short description for this game instance in English.
This description is used above the game scoreboard in the corner of the screen, so it should be as concise as possible. It should be lowercase and should not contain periods or other punctuation.
Note that translation is applied by looking up the specific returned value as a key, so the number of returned variations should be limited; ideally just one or two. To include arbitrary values in the description, you can return a sequence of values in the following form instead of just a string:
# This will give us something like ‘score 3 goals’ in English # and can properly translate to ‘anota 3 goles’ in Spanish. # If we just returned the string ‘score 3 goals’ here, there would # have to be a translation entry for each specific number. ew. return [‘score ${ARG1} goals’, self.settings_raw[‘Score to Win’]]
This way the first string can be consistently translated, with any arg values then substituted into the result. ${ARG1} will be replaced with the first value, ${ARG2} with the second, etc.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Race'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_player_leave(player: Player) None [source]¶
Called when a bascenev1.Player is leaving the Activity.
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- on_transition_in() None [source]¶
Called when the Activity is first becoming visible.
Upon this call, the Activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous Activity up until bascenev1.Activity.on_begin() is called.
- scoreconfig = ScoreConfig(label='Time', scoretype=<ScoreType.MILLISECONDS: 'ms'>, lower_is_better=True, none_is_winner=False, version='')¶
- class bascenev1lib.game.race.RaceMine(point: Sequence[float], mine: Bomb | None)[source]¶
Bases:
object
Holds info about a mine on the track.
- point: Sequence[float]¶
bascenev1lib.game.runaround module¶
Defines the runaround co-op game.
- class bascenev1lib.game.runaround.Point(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Where we can spawn stuff and the corresponding map attr name.
- BOTTOM_LEFT = 'bot_spawn_bottom_left'¶
- BOTTOM_RIGHT = 'bot_spawn_bottom_right'¶
- START = 'bot_spawn_start'¶
- class bascenev1lib.game.runaround.Preset(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Play presets.
- ENDLESS = 'endless'¶
- ENDLESS_TOURNAMENT = 'endless_tournament'¶
- PRO = 'pro'¶
- PRO_EASY = 'pro_easy'¶
- TOURNAMENT = 'tournament'¶
- TOURNAMENT_UBER = 'tournament_uber'¶
- UBER = 'uber'¶
- UBER_EASY = 'uber_easy'¶
- class bascenev1lib.game.runaround.RunaroundGame(settings: dict)[source]¶
Bases:
CoopGameActivity
[Player
,Team
]Game involving trying to bomb bots as they walk through the map.
- add_bot_at_point(point: Point, spaztype: type[SpazBot], path: int, spawn_time: float = 0.1) None [source]¶
Add the given type bot with the given delay (in seconds).
- default_music = 'Marching'¶
- description = 'Prevent enemies from reaching the exit.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- name = 'Runaround'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_transition_in() None [source]¶
Called when the Activity is first becoming visible.
Upon this call, the Activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous Activity up until bascenev1.Activity.on_begin() is called.
- spawn_player(player: Player) Actor [source]¶
Spawn something for the provided bascenev1.Player.
The default implementation simply calls spawn_player_spaz().
- tips = ["Jump just as you're throwing to get bombs up to the highest levels.", "No, you can't get up on the ledge. You have to throw bombs.", 'Whip back and forth to get more distance on your throws..']¶
- class bascenev1lib.game.runaround.Spacing(duration: float)[source]¶
Bases:
object
Defines spacing between spawns.
- duration: float¶
bascenev1lib.game.targetpractice module¶
Implements Target Practice game.
- class bascenev1lib.game.targetpractice.Target(position: Sequence[float])[source]¶
Bases:
Actor
A target practice target.
- do_hit_at_position(pos: Sequence[float], player: Player) bool [source]¶
Handle a bomb hit at the given position.
- exists() bool [source]¶
Returns whether the Actor is still present in a meaningful way.
Note that a dying character should still return True here as long as their corpse is visible; this is about presence, not being ‘alive’ (see bascenev1.Actor.is_alive() for that).
If this returns False, it is assumed the Actor can be completely deleted without affecting the game; this call is often used when pruning lists of Actors, such as with bascenev1.Actor.autoretain()
The default implementation of this method always return True.
Note that the boolean operator for the Actor class calls this method, so a simple “if myactor” test will conveniently do the right thing even if myactor is set to None.
- class bascenev1lib.game.targetpractice.TargetPracticeGame(settings: dict)[source]¶
Bases:
TeamGameActivity
[Player
,Team
]Game where players try to hit targets with bombs.
- available_settings = [IntSetting(name='Target Count', default=3, min_value=1, max_value=9999, increment=1), BoolSetting(name='Enable Impact Bombs', default=True), BoolSetting(name='Enable Triple Bombs', default=True)]¶
- default_music = 'ForwardMarch'¶
- description = 'Bomb as many targets as you can.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- classmethod get_supported_maps(sessiontype: type[Session]) list[str] [source]¶
Called by the default bascenev1.GameActivity.create_settings_ui() implementation; should return a list of map names valid for this game-type for the given bascenev1.Session type.
- name = 'Target Practice'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_team_join(team: Team) None [source]¶
Called when a new bascenev1.Team joins the Activity.
(including the initial set of Teams)
- spawn_player(player: Player) Actor [source]¶
Spawn something for the provided bascenev1.Player.
The default implementation simply calls spawn_player_spaz().
bascenev1lib.game.thelaststand module¶
Defines the last stand minigame.
- class bascenev1lib.game.thelaststand.SpawnInfo(spawnrate: float, increase: float, dincrease: float)[source]¶
Bases:
object
Spawning info for a particular bot type.
- dincrease: float¶
- increase: float¶
- spawnrate: float¶
- class bascenev1lib.game.thelaststand.TheLastStandGame(settings: dict)[source]¶
Bases:
CoopGameActivity
[Player
,Team
]Slow motion how-long-can-you-last game.
- announce_player_deaths = True¶
- default_music = 'Epic'¶
- description = 'Final glorious epic slow motion battle to the death.'¶
- end_game() None [source]¶
Tell the game to wrap up and call bascenev1.Activity.end().
This method should be overridden by subclasses. A game should always be prepared to end and deliver results, even if there is no ‘winner’ yet; this way things like the standard time-limit (bascenev1.GameActivity.setup_standard_time_limit()) will work with the game.
- name = 'The Last Stand'¶
- on_begin() None [source]¶
Called once the previous Activity has finished transitioning out.
At this point the activity’s initial players and teams are filled in and it should begin its actual game logic.
- on_transition_in() None [source]¶
Called when the Activity is first becoming visible.
Upon this call, the Activity should fade in backgrounds, start playing music, etc. It does not yet have access to players or teams, however. They remain owned by the previous Activity up until bascenev1.Activity.on_begin() is called.
- slow_motion = True¶
- spawn_player(player: Player) Actor [source]¶
Spawn something for the provided bascenev1.Player.
The default implementation simply calls spawn_player_spaz().
- tips = ['This level never ends, but a high score here\nwill earn you eternal respect throughout the world.']¶
Module contents¶
Our lovely collection of game related modules.