mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
[ci] auto-format
This commit is contained in:
parent
25e60eaa8c
commit
2aa1e50877
4 changed files with 122 additions and 99 deletions
|
|
@ -26,9 +26,12 @@ if TYPE_CHECKING:
|
|||
from typing import Any, Sequence, Dict, Type, List, Optional, Union
|
||||
|
||||
# ba_meta export game
|
||||
|
||||
|
||||
class ChooseQueen(KeepAwayGame):
|
||||
name = 'FCUK The Queen'
|
||||
description = 'Carry the queen for a set length of time'
|
||||
|
||||
@classmethod
|
||||
def supports_session_type(cls, sessiontype: Type[ba.Session]) -> bool:
|
||||
return issubclass(sessiontype, ba.DualTeamSession)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ if TYPE_CHECKING:
|
|||
from typing import Any, Sequence
|
||||
|
||||
# ba_meta export game
|
||||
|
||||
|
||||
class DemolitionWar(EliminationGame):
|
||||
name = 'DemolitionWar'
|
||||
description = 'Last remaining alive wins.'
|
||||
|
|
@ -186,7 +188,6 @@ class DemolitionWar(EliminationGame):
|
|||
return ud_1_r
|
||||
|
||||
|
||||
|
||||
class mapdefs:
|
||||
points = {}
|
||||
# noinspection PyDictCreation
|
||||
|
|
@ -215,6 +216,8 @@ class mapdefs:
|
|||
points['spawn1'] = (-10.03866341, 0.02275111462, 0.0) + (0.5, 1.0, 4.0)
|
||||
points['spawn2'] = (9.823107149, 0.01092306765, 0.0) + (0.5, 1.0, 4.0)
|
||||
points['tnt1'] = (-0.08421587483, 0.9515026107, -0.7762602271)
|
||||
|
||||
|
||||
class WoodenFloor(ba.Map):
|
||||
"""Stadium map for football games."""
|
||||
defs = mapdefs
|
||||
|
|
@ -276,7 +279,6 @@ class WoodenFloor(ba.Map):
|
|||
gnode.vr_camera_offset = (0, -0.8, -1.1)
|
||||
gnode.vr_near_clip = 0.5
|
||||
|
||||
|
||||
def is_point_near_edge(self,
|
||||
point: ba.Vec3,
|
||||
running: bool = False) -> bool:
|
||||
|
|
@ -296,7 +298,6 @@ class WoodenFloor(ba.Map):
|
|||
player.shatter(True)
|
||||
|
||||
|
||||
|
||||
try:
|
||||
ba._map.register_map(WoodenFloor)
|
||||
except:
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ STORAGE_ATTR_NAME = f'_shared_{__name__}_factory'
|
|||
|
||||
# SMoothy's Drone (fixed version of floater) with rocket launcher
|
||||
# use drone as long as you want , unlike floater which dies after being idle.
|
||||
|
||||
|
||||
class Drone(ba.Actor):
|
||||
def __init__(self, spaz):
|
||||
super().__init__()
|
||||
|
|
@ -105,11 +107,15 @@ class Drone(ba.Actor):
|
|||
})
|
||||
|
||||
self._rcombine.connectattr('output', self.node, 'position')
|
||||
|
||||
def set_rocket_launcher(self, launcher: RocketLauncher):
|
||||
self.rocket_launcher = launcher
|
||||
|
||||
def fire(self):
|
||||
if hasattr(self.grab_node, "position"):
|
||||
self.rocket_launcher.shot(self.spaz, self.x_direction, self.z_direction , (self.grab_node.position[0], self.grab_node.position[1] -1, self.grab_node.position[2]))
|
||||
self.rocket_launcher.shot(self.spaz, self.x_direction, self.z_direction, (
|
||||
self.grab_node.position[0], self.grab_node.position[1] - 1, self.grab_node.position[2]))
|
||||
|
||||
def ascend(self):
|
||||
def loop():
|
||||
if self.node.exists():
|
||||
|
|
@ -122,6 +128,7 @@ class Drone(ba.Actor):
|
|||
|
||||
def pause_movement(self):
|
||||
self.loop_ascend = None
|
||||
|
||||
def decend(self):
|
||||
def loop():
|
||||
if self.node.exists():
|
||||
|
|
@ -131,10 +138,13 @@ class Drone(ba.Actor):
|
|||
})
|
||||
loop()
|
||||
self.loop_ascend = ba.Timer(1, loop, repeat=True)
|
||||
|
||||
def pause_lr(self):
|
||||
self.loop_lr = None
|
||||
|
||||
def pause_ud(self):
|
||||
self.loop_ud = None
|
||||
|
||||
def left_(self, value=-1):
|
||||
def loop():
|
||||
if self.node.exists():
|
||||
|
|
@ -149,6 +159,7 @@ class Drone(ba.Actor):
|
|||
self.z_direction = 0
|
||||
loop()
|
||||
self.loop_lr = ba.Timer(1, loop, repeat=True)
|
||||
|
||||
def right_(self, value=1):
|
||||
def loop():
|
||||
if self.node.exists():
|
||||
|
|
@ -163,6 +174,7 @@ class Drone(ba.Actor):
|
|||
self.z_direction = 0
|
||||
loop()
|
||||
self.loop_lr = ba.Timer(1, loop, repeat=True)
|
||||
|
||||
def up_(self, value=1):
|
||||
def loop():
|
||||
if self.node.exists():
|
||||
|
|
@ -177,6 +189,7 @@ class Drone(ba.Actor):
|
|||
self.z_direction = - value
|
||||
loop()
|
||||
self.loop_ud = ba.Timer(1, loop, repeat=True)
|
||||
|
||||
def down_(self, value=-1):
|
||||
def loop():
|
||||
if self.node.exists():
|
||||
|
|
@ -191,6 +204,7 @@ class Drone(ba.Actor):
|
|||
self.z_direction = - value
|
||||
loop()
|
||||
self.loop_ud = ba.Timer(1, loop, repeat=True)
|
||||
|
||||
def handlemessage(self, msg):
|
||||
if isinstance(msg, ba.DieMessage):
|
||||
self.node.delete()
|
||||
|
|
@ -204,6 +218,8 @@ class Drone(ba.Actor):
|
|||
super().handlemessage(msg)
|
||||
|
||||
# =============================================Copied from Quake Game - Dliwk =====================================================================
|
||||
|
||||
|
||||
class RocketFactory:
|
||||
"""Quake Rocket factory"""
|
||||
|
||||
|
|
@ -391,7 +407,8 @@ class ChooseQueen(DeathMatchGame):
|
|||
),
|
||||
)
|
||||
pos = (0, 0.1, -5)
|
||||
self.main_region=ba.newnode('region',attrs={'position': pos,'scale': (30,0.001,23),'type': 'box','materials': [shared.footing_material,self.ground_material]})
|
||||
self.main_region = ba.newnode('region', attrs={'position': pos, 'scale': (
|
||||
30, 0.001, 23), 'type': 'box', 'materials': [shared.footing_material, self.ground_material]})
|
||||
|
||||
def _handle_player_collide(self):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ if TYPE_CHECKING:
|
|||
CHARACTER = 'Spaz'
|
||||
|
||||
# ba_meta export game
|
||||
|
||||
|
||||
class TheSpazGame(EliminationGame):
|
||||
name = 'TheSpazGame'
|
||||
description = 'Enemy Spaz AmongUs. Kill them all'
|
||||
|
|
@ -94,6 +96,7 @@ class TheSpazGame(EliminationGame):
|
|||
return (
|
||||
'Enemy Spaz AmongUs. Kill them all'
|
||||
)
|
||||
|
||||
def __init__(self, settings: dict):
|
||||
super().__init__(settings)
|
||||
self._solo_mode = False
|
||||
|
|
@ -119,4 +122,3 @@ class TheSpazGame(EliminationGame):
|
|||
setattr(spaz.node, field, value)
|
||||
spaz.node.style = factory.get_style(character)
|
||||
spaz.node.name = ''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue