[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

@ -297,7 +297,6 @@ class UFO(bs.Actor):
node.position[2], 0, 5, 0, 3, 10, 0,
0, 0, 5, 0)
except:
pass
@ -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
@ -866,8 +864,6 @@ class UFOightGame(bs.TeamGameActivity[Player, Team]):
'text': 'By Cross Joy'
})
def on_transition_in(self) -> None:
super().on_transition_in()
gnode = bs.getactivity().globalsnode
@ -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

@ -284,7 +284,8 @@ def replay(player, stunt_name):
else:
bs.timer(
move["time"],
babase.Call(player.actor.move_map[move["move"]["action"]], move["move"]["value"])
babase.Call(player.actor.move_map[move["move"]
["action"]], move["move"]["value"])
)
last_move_time = move["time"]
time_to_hide_controls = last_move_time + 1

View file

@ -40,7 +40,6 @@ class _cmds:
except:
pass
def _handle():
messages = get_chat_messages()
if len(messages) > 1:
@ -544,6 +543,7 @@ class _cmds:
cmsg(u'\U0001F95A Nazz are past/present/future \U0001F95A')
cmsg(u'\U0001F95A everything is Nazz \U0001F95A')
class NewMainMenuWindow(mainmenu.MainMenuWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@ -551,6 +551,8 @@ class NewMainMenuWindow(mainmenu.MainMenuWindow):
bui.set_party_icon_always_visible(True)
# bs.timer(0.05, _update, repeat=True)
def same():
# bs.timer(0.5, _cmds._process_cmd, True)
_cmds._process_cmd()
@ -562,6 +564,3 @@ class _enableee(babase.Plugin):
def on_app_running(self):
mainmenu.MainMenuWindow = NewMainMenuWindow

View file

@ -55,7 +55,8 @@ def is_game_version_lower_than(version):
version is lower than the passed version. Useful for addressing
any breaking changes within game versions.
"""
game_version = tuple(map(int, babase.app.version if build_number < 21282 else babase.app.env.split(".")))
game_version = tuple(map(int, babase.app.version if build_number <
21282 else babase.app.env.split(".")))
version = tuple(map(int, version.split(".")))
return game_version < version
@ -268,12 +269,14 @@ def new_chat_message(msg: Union[str, babase.Lstr], clients: Sequence[int] = None
if msg == '/disco off':
stop()
class NewMainMenuWindow(mainmenu.MainMenuWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Display chat icon, but if user open/close gather it may disappear
bui.set_party_icon_always_visible(True)
# Replace new chat func to the original game codes.
bs.chatmessage = new_chat_message
@ -282,4 +285,3 @@ bs.chatmessage = new_chat_message
class ByCrossJoy(babase.Plugin):
def on_app_running(self):
mainmenu.MainMenuWindow = NewMainMenuWindow

View file

@ -370,7 +370,8 @@ def get_event_loop(force_fresh=False):
def _generate_join_secret(self):
# resp = requests.get('https://legacy.ballistica.net/bsAccessCheck').text
connection_info = bs.get_connection_to_host_info() if build_number < 21697 else bs.get_connection_to_host_info_2()
connection_info = bs.get_connection_to_host_info(
) if build_number < 21697 else bs.get_connection_to_host_info_2()
if connection_info:
addr = _last_server_addr
port = _last_server_port
@ -870,7 +871,8 @@ class DiscordRP(babase.Plugin):
def update_status(self) -> None:
roster = bs.get_game_roster()
connection_info = bs.get_connection_to_host_info() if build_number < 21697 else bs.get_connection_to_host_info_2()
connection_info = bs.get_connection_to_host_info(
) if build_number < 21697 else bs.get_connection_to_host_info_2()
self.rpc_thread.large_image_key = "bombsquadicon"
self.rpc_thread.large_image_text = "BombSquad"

View file

@ -233,8 +233,10 @@ class SettingWindow(bui.Window):
left_widget=decrease_button, right_widget=decrease_button)
# --------------------------------------------------------------------------------------------------
bui.textwidget(edit=self.upper_text, on_activate_call=babase.Call(self.on_text_click, "upper"))
bui.textwidget(edit=self.lower_text, on_activate_call=babase.Call(self.on_text_click, "lower"))
bui.textwidget(edit=self.upper_text, on_activate_call=babase.Call(
self.on_text_click, "upper"))
bui.textwidget(edit=self.lower_text, on_activate_call=babase.Call(
self.on_text_click, "lower"))
def on_enableButton_press(self):
global loop
@ -275,12 +277,14 @@ def new_chat_message(msg: Union[str, babase.Lstr], clients: Sequence[int] = None
except Exception as err:
Print(err, "-from new_chat_message")
class NewMainMenuWindow(MainMenuWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Display chat icon, but if user open/close gather it may disappear
bui.set_party_icon_always_visible(True)
old_fcm = bs.chatmessage
bs.chatmessage = new_chat_message
Map._old_init = Map.__init__

View file

@ -132,7 +132,8 @@ class Quickturn(babase.Plugin):
func(*args, **kwargs)
return wrapper
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(bascenev1lib.actor.spaz.Spaz.handlemessage)
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(
bascenev1lib.actor.spaz.Spaz.handlemessage)
def new_on_run(func):
def wrapper(*args, **kwargs):

View file

@ -119,4 +119,5 @@ class RagdollBGone(babase.Plugin):
# Finally we """travel through the game files""" to replace the function we want with our own version.
# We transplant the old function's arguments into our version.
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(bascenev1lib.actor.spaz.Spaz.handlemessage)
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(
bascenev1lib.actor.spaz.Spaz.handlemessage)

View file

@ -129,7 +129,8 @@ class TNTRespawnText(babase.Plugin):
args[0]._tnt.node.add_death_action(tnt_callback)
return wrapper
# Let's replace the original init function with our modified version.
bascenev1lib.actor.bomb.TNTSpawner.__init__ = new_init(bascenev1lib.actor.bomb.TNTSpawner.__init__)
bascenev1lib.actor.bomb.TNTSpawner.__init__ = new_init(
bascenev1lib.actor.bomb.TNTSpawner.__init__)
# Our modified update function.
# This gets called every 1.1s. Check the TNTSpawner class in the game's code for details.
@ -215,4 +216,5 @@ class TNTRespawnText(babase.Plugin):
return wrapper
# Let's replace the original update function with our modified version.
bascenev1lib.actor.bomb.TNTSpawner._update = new_update(bascenev1lib.actor.bomb.TNTSpawner._update)
bascenev1lib.actor.bomb.TNTSpawner._update = new_update(
bascenev1lib.actor.bomb.TNTSpawner._update)

View file

@ -302,7 +302,8 @@ def _get_local_time(utctime):
def update_status():
if messenger.logged_in:
if babase.app.config['Self Status'] == 'online':
host = bs.get_connection_to_host_info().get('name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().get('name', '')
host = bs.get_connection_to_host_info().get(
'name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().get('name', '')
if host:
my_status = f'Playing in {host}'
else:
@ -1073,9 +1074,11 @@ class PartyWindow(bui.Window):
color=self.bg_color,
iconscale=1.2)
try:
info = bs.get_connection_to_host_info().get('name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
info = bs.get_connection_to_host_info().get(
'name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
if info != '':
self.title = babase.Lstr(value=info['name']) if build_number < 21697 else babase.Lstr(value=info)
self.title = babase.Lstr(
value=info['name']) if build_number < 21697 else babase.Lstr(value=info)
except AttributeError:
self.title = babase.Lstr(resource=self._r + '.titleText')
@ -1143,7 +1146,8 @@ class PartyWindow(bui.Window):
bui.containerwidget(edit=self._root_widget, selected_child=txt)
self._send_button = btn = bui.buttonwidget(parent=self._root_widget,
size=(50, 35),
label=babase.Lstr(resource=self._r + '.sendText'),
label=babase.Lstr(
resource=self._r + '.sendText'),
button_type='square',
autoselect=True,
color=self.bg_color,
@ -1188,7 +1192,8 @@ class PartyWindow(bui.Window):
on_activate_call=self._copy_to_clipboard)
self._ping_button = None
try:
info = bs.get_connection_to_host_info().get('name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
info = bs.get_connection_to_host_info().get(
'name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
if info != '':
if babase.app.config['ping button']:
self._ping_button = bui.buttonwidget(
@ -1859,7 +1864,8 @@ class PartyWindow(bui.Window):
bs.chatmessage(f"My Unique ID : {myid}")
elif msg == '/save':
try:
info = bs.get_connection_to_host_info().get('name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
info = bs.get_connection_to_host_info().get(
'name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
config = babase.app.config
if info != '':
title = info['name']
@ -1983,7 +1989,8 @@ class PartyWindow(bui.Window):
def ping_server(self):
try:
info = bs.get_connection_to_host_info().get('name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
info = bs.get_connection_to_host_info().get(
'name', '') if build_number < 21697 else bs.get_connection_to_host_info_2().name
if info != '':
self.pingThread = PingThread(_ip, _port)
self.pingThread.start()
@ -2745,6 +2752,7 @@ def _get_store_char_tex(self) -> str:
'storeCharacterEaster' if bui.app.plus.get_v1_account_misc_read_val(
'easter', False) else 'storeCharacter')
class NewMainMenuWindow(mainmenu.MainMenuWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@ -2752,6 +2760,8 @@ class NewMainMenuWindow(mainmenu.MainMenuWindow):
bui.set_party_icon_always_visible(True)
# ba_meta export plugin
class InitalRun(babase.Plugin):
def __init__(self):
if build_number >= 21140: