mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-08 08:45:43 +08:00
Merge branch 'master' of github.com:efroemling/ballistica
This commit is contained in:
commit
b12ac84f70
@ -97,7 +97,6 @@ class Session:
|
|||||||
instances; one for each ba.Activity the session may potentially run.
|
instances; one for each ba.Activity the session may potentially run.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=too-many-statements
|
# pylint: disable=too-many-statements
|
||||||
# pylint: disable=too-many-branches
|
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from ba._lobby import Lobby
|
from ba._lobby import Lobby
|
||||||
@ -146,11 +145,6 @@ class Session:
|
|||||||
# print('Would set host-session asset-reqs to:',
|
# print('Would set host-session asset-reqs to:',
|
||||||
# required_asset_packages)
|
# required_asset_packages)
|
||||||
|
|
||||||
if team_names is None:
|
|
||||||
team_names = ['Good Guys']
|
|
||||||
if team_colors is None:
|
|
||||||
team_colors = [(0.6, 0.2, 1.0)]
|
|
||||||
|
|
||||||
# First thing, wire up our internal engine data.
|
# First thing, wire up our internal engine data.
|
||||||
self._sessiondata = _ba.register_session(self)
|
self._sessiondata = _ba.register_session(self)
|
||||||
|
|
||||||
@ -197,6 +191,8 @@ class Session:
|
|||||||
self.max_players = max_players
|
self.max_players = max_players
|
||||||
|
|
||||||
if self._use_teams:
|
if self._use_teams:
|
||||||
|
assert team_names is not None
|
||||||
|
assert team_colors is not None
|
||||||
for i, color in enumerate(team_colors):
|
for i, color in enumerate(team_colors):
|
||||||
team = Team(team_id=self._next_team_id,
|
team = Team(team_id=self._next_team_id,
|
||||||
name=GameActivity.get_team_display_string(
|
name=GameActivity.get_team_display_string(
|
||||||
|
|||||||
@ -290,6 +290,9 @@ class CaptureTheFlagGame(ba.TeamGameActivity):
|
|||||||
if (not team.gamedata['home_flag_at_base']
|
if (not team.gamedata['home_flag_at_base']
|
||||||
and flag.held_count == 0):
|
and flag.held_count == 0):
|
||||||
time_out_counting_down = True
|
time_out_counting_down = True
|
||||||
|
if flag.time_out_respawn_time is None:
|
||||||
|
flag.reset_return_times()
|
||||||
|
assert flag.time_out_respawn_time is not None
|
||||||
flag.time_out_respawn_time -= 1
|
flag.time_out_respawn_time -= 1
|
||||||
if flag.time_out_respawn_time <= 0:
|
if flag.time_out_respawn_time <= 0:
|
||||||
flag.handlemessage(ba.DieMessage())
|
flag.handlemessage(ba.DieMessage())
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class Icon(ba.Actor):
|
|||||||
|
|
||||||
icon = player.get_icon()
|
icon = player.get_icon()
|
||||||
self.node = ba.newnode('image',
|
self.node = ba.newnode('image',
|
||||||
owner=self,
|
delegate=self,
|
||||||
attrs={
|
attrs={
|
||||||
'texture': icon['texture'],
|
'texture': icon['texture'],
|
||||||
'tint_texture': icon['tint_texture'],
|
'tint_texture': icon['tint_texture'],
|
||||||
|
|||||||
@ -69,6 +69,7 @@ class Puck(ba.Actor):
|
|||||||
'position': self._spawn_pos,
|
'position': self._spawn_pos,
|
||||||
'materials': pmats
|
'materials': pmats
|
||||||
})
|
})
|
||||||
|
ba.animate(self.node, "model_scale", {0: 0, 0.2: 1.3, 0.26: 1})
|
||||||
|
|
||||||
def handlemessage(self, msg: Any) -> Any:
|
def handlemessage(self, msg: Any) -> Any:
|
||||||
if isinstance(msg, ba.DieMessage):
|
if isinstance(msg, ba.DieMessage):
|
||||||
|
|||||||
@ -430,11 +430,11 @@ class OnslaughtGame(ba.CoopGameActivity):
|
|||||||
{'entries': [
|
{'entries': [
|
||||||
{'type': spazbot.ChargerBotProShielded,
|
{'type': spazbot.ChargerBotProShielded,
|
||||||
'point': 'bottom_right'},
|
'point': 'bottom_right'},
|
||||||
{'type': spazbot.ChargerBotProShielded, 'point': 'Bottom'}
|
{'type': spazbot.ChargerBotProShielded, 'point': 'bottom'}
|
||||||
if player_count > 2 else None,
|
if player_count > 2 else None,
|
||||||
{'type': spazbot.ChargerBotProShielded,
|
{'type': spazbot.ChargerBotProShielded,
|
||||||
'point': 'bottom_left'},
|
'point': 'bottom_left'},
|
||||||
{'type': spazbot.ChargerBotProShielded, 'point': 'Top'}
|
{'type': spazbot.ChargerBotProShielded, 'point': 'top'}
|
||||||
if hard else None,
|
if hard else None,
|
||||||
{'type': spazbot.BomberBotProStatic,
|
{'type': spazbot.BomberBotProStatic,
|
||||||
'point': 'turret_top_middle'},
|
'point': 'turret_top_middle'},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user