mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2026-08-15 13:03:08 +00:00
[ci] apply-plugin-metadata-and-formatting
This commit is contained in:
parent
4804a55ca0
commit
0749053077
2 changed files with 25 additions and 25 deletions
|
|
@ -1694,8 +1694,8 @@
|
||||||
"external_url": "https://discord.gg/sQGDsztQcy",
|
"external_url": "https://discord.gg/sQGDsztQcy",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Mr.Paradox",
|
"name": "Mr.ghosty",
|
||||||
"email": "microsoftusergame@gmail.com",
|
"email": "",
|
||||||
"discord": "gaurangbroyo"
|
"discord": "gaurangbroyo"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1705,6 +1705,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"versions": {
|
"versions": {
|
||||||
|
"2.1.0": null,
|
||||||
"1.0.2": {
|
"1.0.2": {
|
||||||
"api_version": 9,
|
"api_version": 9,
|
||||||
"commit_sha": "edaed70",
|
"commit_sha": "edaed70",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
# ba_meta require api 9
|
# ba_meta require api 9
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from bascenev1lib.gameutils import SharedObjects
|
||||||
|
import bascenev1 as bs
|
||||||
|
import babase
|
||||||
|
import random
|
||||||
|
from typing import Optional, List, Dict, Any
|
||||||
|
|
||||||
# Vanishing Tiles - BombSquad Minigame
|
# Vanishing Tiles - BombSquad Minigame
|
||||||
# Tiles disappear one by one. Survive all rounds to win.
|
# Tiles disappear one by one. Survive all rounds to win.
|
||||||
|
|
@ -16,12 +21,6 @@ plugman = dict(
|
||||||
version="2.1.0",
|
version="2.1.0",
|
||||||
)
|
)
|
||||||
|
|
||||||
from typing import Optional, List, Dict, Any
|
|
||||||
import random
|
|
||||||
import babase
|
|
||||||
import bascenev1 as bs
|
|
||||||
from bascenev1lib.gameutils import SharedObjects
|
|
||||||
|
|
||||||
|
|
||||||
class Player(bs.Player['Team']):
|
class Player(bs.Player['Team']):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
|
@ -36,7 +35,7 @@ class Team(bs.Team[Player]):
|
||||||
# ba_meta export bascenev1.GameActivity
|
# ba_meta export bascenev1.GameActivity
|
||||||
class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
|
|
||||||
name = 'Vanishing Tiles'
|
name = 'Vanishing Tiles'
|
||||||
description = 'Tiles disappear one by one. Be the last one standing!'
|
description = 'Tiles disappear one by one. Be the last one standing!'
|
||||||
scoreconfig = bs.ScoreConfig(label='Survived', scoretype=bs.ScoreType.MILLISECONDS)
|
scoreconfig = bs.ScoreConfig(label='Survived', scoretype=bs.ScoreType.MILLISECONDS)
|
||||||
announce_player_deaths = True
|
announce_player_deaths = True
|
||||||
|
|
@ -58,17 +57,17 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
|
|
||||||
def __init__(self, settings: dict) -> None:
|
def __init__(self, settings: dict) -> None:
|
||||||
super().__init__(settings)
|
super().__init__(settings)
|
||||||
self._epic_mode: bool = bool(settings.get('Epic Mode', False))
|
self._epic_mode: bool = bool(settings.get('Epic Mode', False))
|
||||||
self._show_credits: bool = bool(settings.get('Show Credits', True))
|
self._show_credits: bool = bool(settings.get('Show Credits', True))
|
||||||
self.default_music = bs.MusicType.EPIC if self._epic_mode else bs.MusicType.SURVIVAL
|
self.default_music = bs.MusicType.EPIC if self._epic_mode else bs.MusicType.SURVIVAL
|
||||||
|
|
||||||
self._round: int = 1
|
self._round: int = 1
|
||||||
self._removing: bool = False
|
self._removing: bool = False
|
||||||
self._game_start_time: Optional[float] = None
|
self._game_start_time: Optional[float] = None
|
||||||
|
|
||||||
self._tile_nodes: Dict[int, bs.Node] = {}
|
self._tile_nodes: Dict[int, bs.Node] = {}
|
||||||
self._region_nodes: Dict[int, bs.Node] = {}
|
self._region_nodes: Dict[int, bs.Node] = {}
|
||||||
self._present_tile_ids: set[int] = set()
|
self._present_tile_ids: set[int] = set()
|
||||||
|
|
||||||
self._remove_speed: float = 1.8
|
self._remove_speed: float = 1.8
|
||||||
|
|
||||||
|
|
@ -78,8 +77,8 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
self._no_collide_mat.add_actions(actions=(('modify_part_collision', 'collide', False),))
|
self._no_collide_mat.add_actions(actions=(('modify_part_collision', 'collide', False),))
|
||||||
|
|
||||||
self._default_tex = bs.gettexture('powerupHealth')
|
self._default_tex = bs.gettexture('powerupHealth')
|
||||||
self._warn_tex = bs.gettexture('powerupCurse')
|
self._warn_tex = bs.gettexture('powerupCurse')
|
||||||
self._final_tex = bs.gettexture('powerupPunch')
|
self._final_tex = bs.gettexture('powerupPunch')
|
||||||
|
|
||||||
self._hud_round: Optional[bs.Node] = None
|
self._hud_round: Optional[bs.Node] = None
|
||||||
self._hud_players: Optional[bs.Node] = None
|
self._hud_players: Optional[bs.Node] = None
|
||||||
|
|
@ -163,7 +162,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
self._hud_players.text = f'Players alive: {alive}'
|
self._hud_players.text = f'Players alive: {alive}'
|
||||||
if self._hud_tiles:
|
if self._hud_tiles:
|
||||||
self._hud_tiles.color = (1.0, 0.3, 0.3, 1) if urgent else (0.5, 1.0, 0.5, 1)
|
self._hud_tiles.color = (1.0, 0.3, 0.3, 1) if urgent else (0.5, 1.0, 0.5, 1)
|
||||||
self._hud_tiles.text = f'Tiles left: {tiles}'
|
self._hud_tiles.text = f'Tiles left: {tiles}'
|
||||||
|
|
||||||
def _show_round_banner(self) -> None:
|
def _show_round_banner(self) -> None:
|
||||||
node = bs.newnode('text', attrs={
|
node = bs.newnode('text', attrs={
|
||||||
|
|
@ -195,7 +194,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
(-1.5, 2, -9), (-1.5, 2, -6), (-1.5, 2, -3), (-1.5, 2, 0),
|
(-1.5, 2, -9), (-1.5, 2, -6), (-1.5, 2, -3), (-1.5, 2, 0),
|
||||||
(-4.5, 2, -9), (-4.5, 2, -6), (-4.5, 2, -3), (-4.5, 2, 0),
|
(-4.5, 2, -9), (-4.5, 2, -6), (-4.5, 2, -3), (-4.5, 2, 0),
|
||||||
]
|
]
|
||||||
model = bs.getmesh('buttonSquareOpaque')
|
model = bs.getmesh('buttonSquareOpaque')
|
||||||
shared = SharedObjects.get()
|
shared = SharedObjects.get()
|
||||||
for i, pos in enumerate(positions):
|
for i, pos in enumerate(positions):
|
||||||
tile = bs.newnode('prop', attrs={
|
tile = bs.newnode('prop', attrs={
|
||||||
|
|
@ -208,7 +207,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
'position': pos, 'scale': (3.5, 0.1, 3.5), 'type': 'box',
|
'position': pos, 'scale': (3.5, 0.1, 3.5), 'type': 'box',
|
||||||
'materials': [self._collide_mat, shared.footing_material],
|
'materials': [self._collide_mat, shared.footing_material],
|
||||||
})
|
})
|
||||||
self._tile_nodes[i] = tile
|
self._tile_nodes[i] = tile
|
||||||
self._region_nodes[i] = region
|
self._region_nodes[i] = region
|
||||||
self._present_tile_ids.add(i)
|
self._present_tile_ids.add(i)
|
||||||
self._refresh_hud()
|
self._refresh_hud()
|
||||||
|
|
@ -221,7 +220,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
def _make_final_tile(self) -> None:
|
def _make_final_tile(self) -> None:
|
||||||
try:
|
try:
|
||||||
tile_id = list(self._present_tile_ids)[0]
|
tile_id = list(self._present_tile_ids)[0]
|
||||||
tile = self._tile_nodes.get(tile_id)
|
tile = self._tile_nodes.get(tile_id)
|
||||||
if tile and tile.exists():
|
if tile and tile.exists():
|
||||||
tile.color_texture = self._final_tex
|
tile.color_texture = self._final_tex
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
@ -248,7 +247,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
bs.timer(self._remove_speed, self._remove_next_tile)
|
bs.timer(self._remove_speed, self._remove_next_tile)
|
||||||
|
|
||||||
def _remove_tile(self, tile_id: int) -> None:
|
def _remove_tile(self, tile_id: int) -> None:
|
||||||
tile = self._tile_nodes.get(tile_id)
|
tile = self._tile_nodes.get(tile_id)
|
||||||
region = self._region_nodes.get(tile_id)
|
region = self._region_nodes.get(tile_id)
|
||||||
if tile is None or not tile.exists():
|
if tile is None or not tile.exists():
|
||||||
self._present_tile_ids.discard(tile_id)
|
self._present_tile_ids.discard(tile_id)
|
||||||
|
|
@ -345,12 +344,12 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
if self.has_ended():
|
if self.has_ended():
|
||||||
return
|
return
|
||||||
cur_time = bs.time()
|
cur_time = bs.time()
|
||||||
start = self._game_start_time or cur_time
|
start = self._game_start_time or cur_time
|
||||||
results = bs.GameResults()
|
results = bs.GameResults()
|
||||||
for team in self.teams:
|
for team in self.teams:
|
||||||
longest = 0.0
|
longest = 0.0
|
||||||
for p in team.players:
|
for p in team.players:
|
||||||
death = p.death_time or (cur_time + 1)
|
death = p.death_time or (cur_time + 1)
|
||||||
longest = max(longest, death - start)
|
longest = max(longest, death - start)
|
||||||
results.set_team_score(team, int(longest * 1000))
|
results.set_team_score(team, int(longest * 1000))
|
||||||
|
|
||||||
|
|
@ -378,7 +377,7 @@ class VanishingTilesGame(bs.TeamGameActivity[Player, Team]):
|
||||||
|
|
||||||
class VanishingTilesMapDefs:
|
class VanishingTilesMapDefs:
|
||||||
points = {'spawn1': (0, 3, -5)}
|
points = {'spawn1': (0, 3, -5)}
|
||||||
boxes = {
|
boxes = {
|
||||||
'area_of_interest_bounds': (0, 4, -5, 0, 0, 0, 16, 8, 16),
|
'area_of_interest_bounds': (0, 4, -5, 0, 0, 0, 16, 8, 16),
|
||||||
'map_bounds': (0, 4, -5, 0, 0, 0, 30, 14, 30),
|
'map_bounds': (0, 4, -5, 0, 0, 0, 30, 14, 30),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue