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