mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-31 11:46:58 +08:00
adding comments
This commit is contained in:
parent
1f3d9ef0f8
commit
18f89a0904
@ -243,24 +243,20 @@ class AssaultGame(bs.TeamGameActivity[Player, Team]):
|
||||
)
|
||||
bs.timer(0.5, light.delete)
|
||||
bs.animate(light, 'intensity', {0: 0, 0.1: 1.0, 0.5: 0})
|
||||
def teleport(
|
||||
client: Player,
|
||||
pos: Sequence[float],
|
||||
num: float
|
||||
) -> None:
|
||||
if client.actor:
|
||||
client.actor.handlemessage(
|
||||
bs.StandMessage(pos,num)
|
||||
)
|
||||
if player.actor:
|
||||
random_num = random.uniform(0, 360)
|
||||
# A simple hack to work around the chaos caused by
|
||||
# any sticky bomb's sticky material, if present and
|
||||
# is sticking to the players.
|
||||
player.actor.handlemessage(
|
||||
bs.StandMessage(new_pos, random_num)
|
||||
)
|
||||
bs.timer(
|
||||
0.01,
|
||||
bs.Call(teleport, player, new_pos, random_num)
|
||||
)
|
||||
bs.timer(0.01, bs.Call(
|
||||
self.teleport,
|
||||
player,
|
||||
new_pos,
|
||||
random_num
|
||||
))
|
||||
|
||||
# Have teammates celebrate.
|
||||
for player in player_team.players:
|
||||
@ -272,6 +268,15 @@ class AssaultGame(bs.TeamGameActivity[Player, Team]):
|
||||
if player_team.score >= self._score_to_win:
|
||||
self.end_game()
|
||||
|
||||
def teleport(
|
||||
self,
|
||||
client: Player,
|
||||
pos: Sequence[float],
|
||||
num: float
|
||||
) -> None:
|
||||
if client.actor:
|
||||
client.actor.handlemessage(bs.StandMessage(pos,num))
|
||||
|
||||
@override
|
||||
def end_game(self) -> None:
|
||||
results = bs.GameResults()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user