[ci] auto-format

This commit is contained in:
brostosjoined 2024-01-18 13:41:11 +00:00 committed by github-actions[bot]
parent d2e9830d8c
commit 87b302a50f
20 changed files with 703 additions and 685 deletions

View file

@ -282,7 +282,8 @@ class RocketLauncher:
direction = [x, 0, z]
direction[1] = 0.0
mag = 10.0 / 1 if babase.Vec3(*direction).length() == 0 else babase.Vec3(*direction).length()
mag = 10.0 / \
1 if babase.Vec3(*direction).length() == 0 else babase.Vec3(*direction).length()
vel = [v * mag for v in direction]
Rocket(position=position,
velocity=vel,

View file

@ -791,7 +791,8 @@ class HotPotato(bs.TeamGameActivity[Player, bs.Team]):
self._end_game_timer = bs.Timer(1.25, babase.Call(self.end_game))
else:
# There's still players remaining, so let's wait a while before marking a new player.
self.new_mark_timer = bs.Timer(2.0 if self.slow_motion else 4.0, babase.Call(self.new_mark))
self.new_mark_timer = bs.Timer(
2.0 if self.slow_motion else 4.0, babase.Call(self.new_mark))
# Another extensively used function that returns all alive players.
def get_alive_players(self) -> Sequence[bs.Player]:
@ -852,7 +853,8 @@ class HotPotato(bs.TeamGameActivity[Player, bs.Team]):
self._round_end_timer = bs.Timer(0.5, self.end_game)
else:
# Pick random player(s) to get marked
self.new_mark_timer = bs.Timer(2.0 if self.slow_motion else 5.2, babase.Call(self.new_mark))
self.new_mark_timer = bs.Timer(
2.0 if self.slow_motion else 5.2, babase.Call(self.new_mark))
self._update_icons() # Create player state icons

View file

@ -206,7 +206,7 @@ class SimonSays(bs.TeamGameActivity[Player, Team]):
if self.has_begun():
bs.broadcastmessage(
babase.Lstr(resource='playerDelayedJoinText',
subs=[('${PLAYER}', player.getname(full=True))]),
subs=[('${PLAYER}', player.getname(full=True))]),
color=(0, 1, 0),)
return
else:
@ -232,7 +232,7 @@ class SimonSays(bs.TeamGameActivity[Player, Team]):
if len(self.players) == 1:
bs.timer(4000/1000, lambda: self.check_end())
else:
bs.timer(6000/1000, self.call_round)
bs.timer(6000/1000, self.call_round)
def spawn_player(self, player: PlayerT) -> bs.Actor:
assert player
@ -310,7 +310,7 @@ class SimonSays(bs.TeamGameActivity[Player, Team]):
if ((self.simon and safe == False) or ((not self.simon) and safe == True)):
player.team.score = self.round_num
player.actor.handlemessage(bs.DieMessage())
bs.timer(1633/1000, self.call_round)
bs.timer(1633/1000, self.call_round)
def in_circle(self, pos) -> None:
circles = []

View file

@ -340,10 +340,10 @@ class SleepRaceGame(bs.TeamGameActivity[Player, Team]):
player.actor.node.connectattr(
'torso_position', mathnode, 'input2')
tstr = babase.Lstr(resource='lapNumberText',
subs=[('${CURRENT}',
str(player.lap + 1)),
('${TOTAL}', str(self._laps))
])
subs=[('${CURRENT}',
str(player.lap + 1)),
('${TOTAL}', str(self._laps))
])
txtnode = bs.newnode('text',
owner=mathnode,
attrs={

View file

@ -349,10 +349,10 @@ class SquidRaceGame(bs.TeamGameActivity[Player, Team]):
player.actor.node.connectattr(
'torso_position', mathnode, 'input2')
tstr = babase.Lstr(resource='lapNumberText',
subs=[('${CURRENT}',
str(player.lap + 1)),
('${TOTAL}', str(self._laps))
])
subs=[('${CURRENT}',
str(player.lap + 1)),
('${TOTAL}', str(self._laps))
])
txtnode = bs.newnode('text',
owner=mathnode,
attrs={
@ -382,7 +382,7 @@ class SquidRaceGame(bs.TeamGameActivity[Player, Team]):
if self.has_begun():
bs.broadcastmessage(
babase.Lstr(resource='playerDelayedJoinText',
subs=[('${PLAYER}', player.getname(full=True))]),
subs=[('${PLAYER}', player.getname(full=True))]),
color=(0, 1, 0),
)
return

View file

@ -253,8 +253,8 @@ class UFO(bs.Actor):
1.0 + i,
lambda: self._bots.spawn_bot(
RoboBot, pos=(self.node.position[0],
self.node.position[1] - 1,
self.node.position[2]), spawn_time=0.0
self.node.position[1] - 1,
self.node.position[2]), spawn_time=0.0
),
)
@ -297,7 +297,6 @@ class UFO(bs.Actor):
node.position[2], 0, 5, 0, 3, 10, 0,
0, 0, 5, 0)
except:
pass
@ -321,7 +320,7 @@ class UFO(bs.Actor):
self.handlemessage(bs.DieMessage())
def _get_target_player_pt(self) -> tuple[
bs.Vec3 | None, bs.Vec3 | None]:
bs.Vec3 | None, bs.Vec3 | None]:
"""Returns the position and velocity of our target.
Both values will be None in the case of no target.
@ -514,7 +513,6 @@ class UFO(bs.Actor):
{0: self.shield_deco.color, 0.2: (5, 0.2, 0.2)})
self.bot_count = 6
def update_ai(self) -> None:
"""Should be called periodically to update the spaz' AI."""
# pylint: disable=too-many-branches
@ -706,8 +704,8 @@ class UFOSet:
+ str(self._ufo_bot_lists[self._ufo_bot_update_list])
)
self._bot_update_list = (
self._ufo_bot_update_list + 1
) % self._ufo_bot_list_count
self._ufo_bot_update_list + 1
) % self._ufo_bot_list_count
# Update our list of player points for the bots to use.
player_pts = []
@ -780,7 +778,7 @@ class UFOSet:
"""Add a bs.SpazBot instance to the set."""
self._ufo_bot_lists[self._ufo_bot_add_list].append(bot)
self._ufo_bot_add_list = (
self._ufo_bot_add_list + 1) % self._ufo_bot_list_count
self._ufo_bot_add_list + 1) % self._ufo_bot_list_count
def have_living_bots(self) -> bool:
"""Return whether any bots in the set are alive or spawning."""
@ -855,18 +853,16 @@ class UFOightGame(bs.TeamGameActivity[Player, Team]):
self._bots = UFOSet()
self._preset = str(settings['preset'])
self._credit = bs.newnode('text',
attrs={
'v_attach': 'bottom',
'h_align': 'center',
'color': (0.4, 0.4, 0.4),
'flatness': 0.5,
'shadow': 0.5,
'position': (0, 20),
'scale': 0.7,
'text': 'By Cross Joy'
})
attrs={
'v_attach': 'bottom',
'h_align': 'center',
'color': (0.4, 0.4, 0.4),
'flatness': 0.5,
'shadow': 0.5,
'position': (0, 20),
'scale': 0.7,
'text': 'By Cross Joy'
})
def on_transition_in(self) -> None:
super().on_transition_in()
@ -878,8 +874,6 @@ class UFOightGame(bs.TeamGameActivity[Player, Team]):
super().on_begin()
self.setup_standard_powerup_drops()
# In pro mode there's no powerups.
# Make our on-screen timer and start it roughly when our bots appear.
@ -987,4 +981,3 @@ class MyUFOFightLevel(babase.Plugin):
preview_texture_name='footballStadiumPreview',
)
)

View file

@ -43,11 +43,11 @@ from bascenev1lib.actor.onscreentimer import OnScreenTimer
from bascenev1lib.actor.scoreboard import Scoreboard
from bascenev1lib.actor.spazfactory import SpazFactory
from bascenev1lib.actor.spazbot import (SpazBot, SpazBotSet, BomberBot,
BomberBotPro, BomberBotProShielded,
BrawlerBot, BrawlerBotPro,
BrawlerBotProShielded, TriggerBot,
TriggerBotPro, TriggerBotProShielded,
ChargerBot, StickyBot, ExplodeyBot)
BomberBotPro, BomberBotProShielded,
BrawlerBot, BrawlerBotPro,
BrawlerBotProShielded, TriggerBot,
TriggerBotPro, TriggerBotProShielded,
ChargerBot, StickyBot, ExplodeyBot)
if TYPE_CHECKING:
from typing import Any, Sequence

View file

@ -122,7 +122,7 @@ class zBotSet(SpazBotSet):
except Exception:
bot_list = []
babase.print_exception('Error updating bot list: ' +
str(self._bot_lists[self._bot_update_list]))
str(self._bot_lists[self._bot_update_list]))
self._bot_update_list = (self._bot_update_list +
1) % self._bot_list_count
@ -286,7 +286,7 @@ class ZombieHorde(bs.TeamGameActivity[Player, Team]):
player.icons = []
bs.broadcastmessage(
babase.Lstr(resource='playerDelayedJoinText',
subs=[('${PLAYER}', player.getname(full=True))]),
subs=[('${PLAYER}', player.getname(full=True))]),
color=(0, 1, 0),
)
return