[ci] auto-format

This commit is contained in:
brostosjoined 2024-02-01 08:58:54 +00:00 committed by github-actions[bot]
parent 35d4e45915
commit e7158a0878
8 changed files with 824 additions and 808 deletions

View file

@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - -
# - Fat-Pigs! by Zacker Tz || Zacker#5505 -
# - Version 0.01 :v -
# - Version 0.01 :v -
# - - - - - - - - - - - - - - - - - - - - -
from __future__ import annotations
@ -24,12 +24,13 @@ if TYPE_CHECKING:
# - - - - - - - Mini - Settings - - - - - - - - - - - - - - - - #
zkBombs_limit = 3 # Number of bombs you can use | Default = 3
zkPunch = False # Enable/Disable punchs | Default = False
zkPickup = False # Enable/Disable pickup | Default = False
zkBombs_limit = 3 # Number of bombs you can use | Default = 3
zkPunch = False # Enable/Disable punchs | Default = False
zkPickup = False # Enable/Disable pickup | Default = False
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
class Player(bs.Player['Team']):
"""Our player type for this game."""
@ -40,7 +41,9 @@ class Team(bs.Team[Player]):
def __init__(self) -> None:
self.score = 0
# ba_meta export bascenev1.GameActivity
# ba_meta export bascenev1.GameActivity
class FatPigs(bs.TeamGameActivity[Player, Team]):
"""A game type based on acquiring kills."""
@ -139,20 +142,18 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
super().on_begin()
self.setup_standard_time_limit(self._time_limit)
# self.setup_standard_powerup_drops()
#Ambiente
# Ambiente
gnode = bs.getactivity().globalsnode
gnode.tint = (0.8, 1.2, 0.8)
gnode.ambient_color = (0.7, 1.0, 0.6)
gnode.vignette_outer = (0.4, 0.6, 0.4) #C
gnode.vignette_outer = (0.4, 0.6, 0.4) # C
# gnode.vignette_inner = (0.9, 0.9, 0.9)
# Base kills needed to win on the size of the largest team.
self._score_to_win = (self._kills_to_win_per_player *
max(1, max(len(t.players) for t in self.teams)))
self._update_scoreboard()
delay = 5.0 if len(self.players) > 2 else 2.5
if self._epic_mode:
delay *= 0.25
@ -169,18 +170,17 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
# Check for immediate end (if we've only got 1 player, etc).
bs.timer(5.0, self._check_end_game)
t = bs.newnode('text',
attrs={ 'text':"Minigame by Zacker Tz",
'scale':0.7,
'position':(0.001,625),
'shadow':0.5,
'opacity':0.7,
'flatness':1.2,
'color':(0.6, 1, 0.6),
'h_align':'center',
'v_attach':'bottom'})
attrs={'text': "Minigame by Zacker Tz",
'scale': 0.7,
'position': (0.001, 625),
'shadow': 0.5,
'opacity': 0.7,
'flatness': 1.2,
'color': (0.6, 1, 0.6),
'h_align': 'center',
'v_attach': 'bottom'})
def spawn_player(self, player: Player) -> bs.Actor:
spaz = self.spawn_player_spaz(player)
@ -190,13 +190,13 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
spaz.connect_controls_to_player(enable_punch=zkPunch,
enable_bomb=True,
enable_pickup=zkPickup)
spaz.bomb_count = zkBombs_limit
spaz._max_bomb_count = zkBombs_limit
spaz.bomb_type_default = 'sticky'
spaz.bomb_type = 'sticky'
#cerdo gordo
# cerdo gordo
spaz.node.color_mask_texture = bs.gettexture('melColorMask')
spaz.node.color_texture = bs.gettexture('melColor')
spaz.node.head_mesh = bs.getmesh('melHead')
@ -210,19 +210,19 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
spaz.node.toes_mesh = bs.getmesh('melToes')
spaz.node.style = 'mel'
# Sounds cerdo gordo
mel_sounds = [bs.getsound('mel01'), bs.getsound('mel02'),bs.getsound('mel03'),bs.getsound('mel04'),bs.getsound('mel05'),
bs.getsound('mel06'),bs.getsound('mel07'),bs.getsound('mel08'),bs.getsound('mel09'),bs.getsound('mel10')]
mel_sounds = [bs.getsound('mel01'), bs.getsound('mel02'), bs.getsound('mel03'), bs.getsound('mel04'), bs.getsound('mel05'),
bs.getsound('mel06'), bs.getsound('mel07'), bs.getsound('mel08'), bs.getsound('mel09'), bs.getsound('mel10')]
spaz.node.jump_sounds = mel_sounds
spaz.node.attack_sounds = mel_sounds
spaz.node.impact_sounds = mel_sounds
spaz.node.pickup_sounds = mel_sounds
spaz.node.death_sounds = [bs.getsound('melDeath01')]
spaz.node.fall_sounds = [bs.getsound('melFall01')]
def _set_meteor_timer(self) -> None:
bs.timer((1.0 + 0.2 * random.random()) * self._meteor_time,
self._drop_bomb_cluster)
self._drop_bomb_cluster)
def _drop_bomb_cluster(self) -> None:
# Random note: code like this is a handy way to plot out extents
@ -245,15 +245,14 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
vel = ((-5.0 + random.random() * 30.0) * dropdir, -4.0, 0)
bs.timer(delay, babase.Call(self._drop_bomb, pos, vel))
delay += 0.1
self._set_meteor_timer()
self._set_meteor_timer()
def _drop_bomb(self, position: Sequence[float],
velocity: Sequence[float]) -> None:
Bomb(position=position, velocity=velocity,bomb_type='sticky').autoretain()
Bomb(position=position, velocity=velocity, bomb_type='sticky').autoretain()
def _decrement_meteor_time(self) -> None:
self._meteor_time = max(0.01, self._meteor_time * 0.9)
def handlemessage(self, msg: Any) -> Any:
@ -326,7 +325,7 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
self.end_game()
else:
if living_team_count <= 1:
self.end_game()
self.end_game()
def _update_scoreboard(self) -> None:
for team in self.teams: