[ci] auto-format

This commit is contained in:
TheMikirog 2023-01-01 20:03:15 +00:00 committed by Rikko
parent 5e0280df5b
commit 23314581cc

View file

@ -70,6 +70,8 @@ if TYPE_CHECKING:
"""
# ba_meta export plugin
class AutoRun(ba.Plugin):
# During my research and prototyping I figured I'd have to do some linear algebgra.
@ -138,7 +140,8 @@ class AutoRun(ba.Plugin):
# Notice how it's the capital T Timer instead of the small letter.
# That's important, because big T returns a timer object we can manipulate.
# We need it assigned to a variable, because we have to delete it once it stops being relevant.
args[0].autorun_timer = ba.Timer(0.1, spaz_autorun_update, timetype=TimeType.SIM, repeat=True)
args[0].autorun_timer = ba.Timer(
0.1, spaz_autorun_update, timetype=TimeType.SIM, repeat=True)
return wrapper
# Let's replace the original function with our modified version.
@ -186,7 +189,8 @@ class AutoRun(ba.Plugin):
dot = (dot + 1) / 2
# Let's read how far our player pushed his stick. 1 being full tilt, 0 being neutral.
run_power = math.hypot(movement_vector[0], movement_vector[1]) # Heres our homie Pythagoras once again
# Heres our homie Pythagoras once again
run_power = math.hypot(movement_vector[0], movement_vector[1])
# I noticed the player starts running too fast if the stick is pushed half-way.
# I changed the linear scale to be exponential.
@ -237,7 +241,8 @@ class AutoRun(ba.Plugin):
if not args[0].autorun_override and args[0].source_player:
AutoRun.run_update(args[0])
return wrapper
bastd.actor.spaz.Spaz.on_move_left_right = new_leftright(bastd.actor.spaz.Spaz.on_move_left_right)
bastd.actor.spaz.Spaz.on_move_left_right = new_leftright(
bastd.actor.spaz.Spaz.on_move_left_right)
# There's one downside to the looping timer - it runs constantly even if the player is dead.
# We don't want to waste computational power on something like that.