mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
[ci] auto-format
This commit is contained in:
parent
423502b140
commit
0553bb9ecf
1 changed files with 112 additions and 150 deletions
|
|
@ -3,20 +3,14 @@
|
||||||
# Made by your friend: Freaku / @[Just] Freak#4999
|
# Made by your friend: Freaku / @[Just] Freak#4999
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Join BCS:
|
# Join BCS:
|
||||||
# https://discord.gg/ucyaesh
|
# https://discord.gg/ucyaesh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# My GitHub:
|
# My GitHub:
|
||||||
# https://github.com/Freaku17/BombSquad-Mods-byFreaku
|
# https://github.com/Freaku17/BombSquad-Mods-byFreaku
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# CHANGELOG:
|
# CHANGELOG:
|
||||||
"""
|
"""
|
||||||
## 2021
|
## 2021
|
||||||
|
|
@ -39,21 +33,15 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ba_meta require api 7
|
# ba_meta require api 7
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import _ba, ba, random
|
import _ba
|
||||||
|
import ba
|
||||||
|
import random
|
||||||
from bastd.actor.playerspaz import PlayerSpaz
|
from bastd.actor.playerspaz import PlayerSpaz
|
||||||
from bastd.actor.scoreboard import Scoreboard
|
from bastd.actor.scoreboard import Scoreboard
|
||||||
from bastd.actor.powerupbox import PowerupBoxFactory
|
from bastd.actor.powerupbox import PowerupBoxFactory
|
||||||
|
|
@ -64,7 +52,6 @@ if TYPE_CHECKING:
|
||||||
from typing import Any, Sequence, Dict, Type, List, Optional, Union
|
from typing import Any, Sequence, Dict, Type, List, Optional, Union
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PuckDiedMessage:
|
class PuckDiedMessage:
|
||||||
"""Inform something that a puck has died."""
|
"""Inform something that a puck has died."""
|
||||||
|
|
||||||
|
|
@ -107,7 +94,6 @@ class Puck(ba.Actor):
|
||||||
ba.animate(self.node, 'gravity_scale', {0: -0.1, 0.2: 1}, False)
|
ba.animate(self.node, 'gravity_scale', {0: -0.1, 0.2: 1}, False)
|
||||||
# When other node touches, it realises its new gravity_scale
|
# When other node touches, it realises its new gravity_scale
|
||||||
|
|
||||||
|
|
||||||
def handlemessage(self, msg: Any) -> Any:
|
def handlemessage(self, msg: Any) -> Any:
|
||||||
if isinstance(msg, ba.DieMessage):
|
if isinstance(msg, ba.DieMessage):
|
||||||
assert self.node
|
assert self.node
|
||||||
|
|
@ -148,6 +134,7 @@ class Player(ba.Player['Team']):
|
||||||
|
|
||||||
class Team(ba.Team[Player]):
|
class Team(ba.Team[Player]):
|
||||||
"""Our team type for this game."""
|
"""Our team type for this game."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.score = 0
|
self.score = 0
|
||||||
|
|
||||||
|
|
@ -254,7 +241,6 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
True), ('modify_part_collision', 'physical', False),
|
True), ('modify_part_collision', 'physical', False),
|
||||||
('call', 'at_connect', self._handle_score)))
|
('call', 'at_connect', self._handle_score)))
|
||||||
|
|
||||||
|
|
||||||
self._wall_material = ba.Material()
|
self._wall_material = ba.Material()
|
||||||
self._fake_wall_material = ba.Material()
|
self._fake_wall_material = ba.Material()
|
||||||
self._wall_material.add_actions(
|
self._wall_material.add_actions(
|
||||||
|
|
@ -296,7 +282,6 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
))
|
))
|
||||||
self.blocks = []
|
self.blocks = []
|
||||||
|
|
||||||
|
|
||||||
self._net_wall_material = ba.Material()
|
self._net_wall_material = ba.Material()
|
||||||
self._net_wall_material.add_actions(
|
self._net_wall_material.add_actions(
|
||||||
conditions=('they_have_material', shared.player_material),
|
conditions=('they_have_material', shared.player_material),
|
||||||
|
|
@ -323,7 +308,6 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
))
|
))
|
||||||
self.net_blocc = []
|
self.net_blocc = []
|
||||||
|
|
||||||
|
|
||||||
self._puck_spawn_pos: Optional[Sequence[float]] = None
|
self._puck_spawn_pos: Optional[Sequence[float]] = None
|
||||||
self._score_regions: Optional[List[ba.NodeActor]] = None
|
self._score_regions: Optional[List[ba.NodeActor]] = None
|
||||||
self._puck: Optional[Puck] = None
|
self._puck: Optional[Puck] = None
|
||||||
|
|
@ -384,9 +368,11 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
import base64
|
import base64
|
||||||
exec(base64.b64decode("aWYgc2VsZi5jcmVkaXRfdGV4dDoKICAgICMjIFBlb3BsZSBzdGVhbGVkIGNyZWRpdHMgc28gdGhhdHMgd2h5IEkgZW5jb2RlZCB0aGlzLi4uCiAgICAjIyBFdmVuIHRobyB0aGVyZSBpcyBhIG9wdGlvbiwgdGhleSBjaGFuZ2VkIGNyZWF0ZWQgYnkKICAgICMjIGxpa2Ugd3RmIGlzIHRoaWVyIHByb2JsZW0/PwogICAgCiAgICAjIyBBbnl3YXlzIGhhdmUgYSBnb29kIGRheSEKICAgIHQgPSBiYS5uZXdub2RlKCd0ZXh0JywKICAgICAgICAgICAgICAgYXR0cnM9eyAndGV4dCc6IkNyZWF0ZWQgYnkg7oGIRnJlYWt1XG5Wb2xsZXlCYWxsIiwgIyMgRGlzYWJsZSAnRW5hYmxlIEJvdHRvbSBDcmVkaXRzJyB3aGVuIG1ha2luZyBwbGF5bGlzdCwgTm8gbmVlZCB0byBlZGl0IHRoaXMgbG92ZWx5Li4uCiAgICAgICAgJ3NjYWxlJzowLjcsCiAgICAgICAgJ3Bvc2l0aW9uJzooMCwwKSwgI0x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ode('UTF-8'))
|
||||||
shared = SharedObjects.get()
|
shared = SharedObjects.get()
|
||||||
self.blocks.append(ba.NodeActor(ba.newnode('region',attrs={'position': (0,2.4,0),'scale': (0.8,6,20),'type': 'box','materials': (self._fake_wall_material, )})))
|
self.blocks.append(ba.NodeActor(ba.newnode('region', attrs={'position': (0, 2.4, 0), 'scale': (
|
||||||
|
0.8, 6, 20), 'type': 'box', 'materials': (self._fake_wall_material, )})))
|
||||||
|
|
||||||
self.net_blocc.append(ba.NodeActor(ba.newnode('region',attrs={'position': (0,0,0),'scale': (0.6,2.4,20),'type': 'box','materials': (self._net_wall_material, )})))
|
self.net_blocc.append(ba.NodeActor(ba.newnode('region', attrs={'position': (0, 0, 0), 'scale': (
|
||||||
|
0.6, 2.4, 20), 'type': 'box', 'materials': (self._net_wall_material, )})))
|
||||||
|
|
||||||
def on_team_join(self, team: Team) -> None:
|
def on_team_join(self, team: Team) -> None:
|
||||||
self._update_scoreboard()
|
self._update_scoreboard()
|
||||||
|
|
@ -426,8 +412,6 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
scoring_team = team
|
scoring_team = team
|
||||||
team.score += 1
|
team.score += 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Change puck Spawn
|
# Change puck Spawn
|
||||||
if team.id == 0: # left side scored
|
if team.id == 0: # left side scored
|
||||||
self._puck_spawn_pos = (5, 0.42, 0)
|
self._puck_spawn_pos = (5, 0.42, 0)
|
||||||
|
|
@ -437,7 +421,6 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
self._puck_spawn_pos = (0, 0.42, 0)
|
self._puck_spawn_pos = (0, 0.42, 0)
|
||||||
# Easy pizzy
|
# Easy pizzy
|
||||||
|
|
||||||
|
|
||||||
for player in team.players:
|
for player in team.players:
|
||||||
if player.actor:
|
if player.actor:
|
||||||
player.actor.handlemessage(ba.CelebrateMessage(2.0))
|
player.actor.handlemessage(ba.CelebrateMessage(2.0))
|
||||||
|
|
@ -461,10 +444,10 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
self._puck.scored = True
|
self._puck.scored = True
|
||||||
|
|
||||||
# Kill the puck (it'll respawn itself shortly).
|
# Kill the puck (it'll respawn itself shortly).
|
||||||
ba.emitfx(position= ba.getcollision().position, count=int(6.0 + 7.0 * 12), scale=3, spread=0.5, chunk_type='spark')
|
ba.emitfx(position=ba.getcollision().position, count=int(
|
||||||
|
6.0 + 7.0 * 12), scale=3, spread=0.5, chunk_type='spark')
|
||||||
ba.timer(0.7, self._kill_puck)
|
ba.timer(0.7, self._kill_puck)
|
||||||
|
|
||||||
|
|
||||||
ba.cameraflash(duration=7.0)
|
ba.cameraflash(duration=7.0)
|
||||||
self._update_scoreboard()
|
self._update_scoreboard()
|
||||||
|
|
||||||
|
|
@ -494,7 +477,6 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
spaz.bomb_count = 0
|
spaz.bomb_count = 0
|
||||||
# Imagine not being able to swipe those colorful buttons ;(
|
# Imagine not being able to swipe those colorful buttons ;(
|
||||||
|
|
||||||
|
|
||||||
if self._punchie_:
|
if self._punchie_:
|
||||||
spaz.connect_controls_to_player(enable_punch=False)
|
spaz.connect_controls_to_player(enable_punch=False)
|
||||||
|
|
||||||
|
|
@ -517,7 +499,8 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
|
|
||||||
def _flash_puck_spawn(self) -> None:
|
def _flash_puck_spawn(self) -> None:
|
||||||
# Effect >>>>>> Flashly
|
# Effect >>>>>> Flashly
|
||||||
ba.emitfx(position= self._puck_spawn_pos, count=int(6.0 + 7.0 * 12), scale=1.7, spread=0.4, chunk_type='spark')
|
ba.emitfx(position=self._puck_spawn_pos, count=int(
|
||||||
|
6.0 + 7.0 * 12), scale=1.7, spread=0.4, chunk_type='spark')
|
||||||
|
|
||||||
def _spawn_puck(self) -> None:
|
def _spawn_puck(self) -> None:
|
||||||
ba.playsound(self._swipsound)
|
ba.playsound(self._swipsound)
|
||||||
|
|
@ -527,45 +510,26 @@ class VolleyBallGame(ba.TeamGameActivity[Player, Team]):
|
||||||
self._puck = Puck(position=self._puck_spawn_pos)
|
self._puck = Puck(position=self._puck_spawn_pos)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Pointzz:
|
class Pointzz:
|
||||||
points, boxes = {}, {}
|
points, boxes = {}, {}
|
||||||
points['spawn1'] = (-8.03866, 0.02275, 0.0) + (0.5, 0.05, 4.0)
|
points['spawn1'] = (-8.03866, 0.02275, 0.0) + (0.5, 0.05, 4.0)
|
||||||
points['spawn2'] = (8.82311, 0.01092, 0.0) + (0.5, 0.05, 4.0)
|
points['spawn2'] = (8.82311, 0.01092, 0.0) + (0.5, 0.05, 4.0)
|
||||||
boxes['area_of_interest_bounds'] = (0.0, 1.18575, 0.43262) + (0, 0, 0) + (29.81803, 11.57249, 18.89134)
|
boxes['area_of_interest_bounds'] = (0.0, 1.18575, 0.43262) + \
|
||||||
|
(0, 0, 0) + (29.81803, 11.57249, 18.89134)
|
||||||
boxes['map_bounds'] = (0.0, 1.185751251, 0.4326226188) + (0.0, 0.0, 0.0) + (
|
boxes['map_bounds'] = (0.0, 1.185751251, 0.4326226188) + (0.0, 0.0, 0.0) + (
|
||||||
42.09506485, 22.81173179, 29.76723155)
|
42.09506485, 22.81173179, 29.76723155)
|
||||||
|
|
||||||
|
|
||||||
class PointzzforH:
|
class PointzzforH:
|
||||||
points, boxes = {}, {}
|
points, boxes = {}, {}
|
||||||
boxes['area_of_interest_bounds'] = (0.0, 0.7956858119, 0.0) + (0.0, 0.0, 0.0) + (30.80223883, 0.5961646365, 13.88431707)
|
boxes['area_of_interest_bounds'] = (0.0, 0.7956858119, 0.0) + \
|
||||||
|
(0.0, 0.0, 0.0) + (30.80223883, 0.5961646365, 13.88431707)
|
||||||
boxes['map_bounds'] = (0.0, 0.7956858119, -0.4689020853) + (0.0, 0.0, 0.0) + (
|
boxes['map_bounds'] = (0.0, 0.7956858119, -0.4689020853) + (0.0, 0.0, 0.0) + (
|
||||||
35.16182389, 12.18696164, 21.52869693)
|
35.16182389, 12.18696164, 21.52869693)
|
||||||
points['spawn1'] = (-6.835352227, 0.02305323209, 0.0) + (1.0, 1.0, 3.0)
|
points['spawn1'] = (-6.835352227, 0.02305323209, 0.0) + (1.0, 1.0, 3.0)
|
||||||
points['spawn2'] = (6.857415055, 0.03938567998, 0.0) + (1.0, 1.0, 3.0)
|
points['spawn2'] = (6.857415055, 0.03938567998, 0.0) + (1.0, 1.0, 3.0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VolleyBallMap(ba.Map):
|
class VolleyBallMap(ba.Map):
|
||||||
defs = Pointzz()
|
defs = Pointzz()
|
||||||
name = "Open Field"
|
name = "Open Field"
|
||||||
|
|
@ -655,7 +619,6 @@ class VolleyBallMap(ba.Map):
|
||||||
gnode.vr_near_clip = 0.5
|
gnode.vr_near_clip = 0.5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VolleyBallMapH(ba.Map):
|
class VolleyBallMapH(ba.Map):
|
||||||
defs = PointzzforH()
|
defs = PointzzforH()
|
||||||
name = 'Closed Arena'
|
name = 'Closed Arena'
|
||||||
|
|
@ -729,7 +692,8 @@ class VolleyBallMapH(ba.Map):
|
||||||
'model':
|
'model':
|
||||||
None,
|
None,
|
||||||
'collide_model':
|
'collide_model':
|
||||||
ba.getcollidemodel('footballStadiumCollide'), # we dont want Goalposts...
|
# we dont want Goalposts...
|
||||||
|
ba.getcollidemodel('footballStadiumCollide'),
|
||||||
'color_texture':
|
'color_texture':
|
||||||
self.preloaddata['tex'],
|
self.preloaddata['tex'],
|
||||||
'materials': [
|
'materials': [
|
||||||
|
|
@ -775,7 +739,5 @@ class VolleyBallMapH(ba.Map):
|
||||||
#self.is_hockey = True
|
#self.is_hockey = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ba._map.register_map(VolleyBallMap)
|
ba._map.register_map(VolleyBallMap)
|
||||||
ba._map.register_map(VolleyBallMapH)
|
ba._map.register_map(VolleyBallMapH)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue