[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

@ -1,6 +1,6 @@
# Ported to api 8 by brostos using baport.(https://github.com/bombsquad-community/baport)
#BetterDeathMatch
#Made by your friend: @[Just] Freak#4999
# BetterDeathMatch
# Made by your friend: @[Just] Freak#4999
"""Defines a very-customisable DeathMatch mini-game"""
@ -77,7 +77,7 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
bs.BoolSetting('Epic Mode', default=False),
## Add settings ##
## Add settings ##
bs.BoolSetting('Enable Gloves', False),
bs.BoolSetting('Enable Powerups', True),
bs.BoolSetting('Night Mode', False),
@ -85,10 +85,9 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
bs.BoolSetting('One Punch Kill', False),
bs.BoolSetting('Spawn with Shield', False),
bs.BoolSetting('Punching Only', False),
## Add settings ##
## Add settings ##
]
# In teams mode, a suicide gives a point to the other team, but in
# free-for-all it subtracts from your own score. By default we clamp
# this at zero to benefit new players, but pro players might like to
@ -126,7 +125,6 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
self._only_punch = bool(settings['Punching Only'])
## Take applied settings ##
self._epic_mode = bool(settings['Epic Mode'])
self._kills_to_win_per_player = int(
settings['Kills to Win Per Player'])
@ -151,6 +149,8 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
## Run settings related: IcyFloor ##
def on_transition_in(self) -> None:
super().on_transition_in()
activity = bs.getactivity()
@ -160,8 +160,6 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
return
## Run settings related: IcyFloor ##
def on_begin(self) -> None:
super().on_begin()
self.setup_standard_time_limit(self._time_limit)
@ -172,15 +170,14 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
bs.getactivity().globalsnode.tint = (0.5, 0.7, 1)
else:
pass
#-# Tried return here, pfft. Took me 30mins to figure out why pwps spawning only on NightMode
#-# Now its fixed :)
# -# Tried return here, pfft. Took me 30mins to figure out why pwps spawning only on NightMode
# -# Now its fixed :)
if self._enable_powerups:
self.setup_standard_powerup_drops()
else:
pass
## Run settings related: NightMode,Powerups ##
# 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)))
@ -244,6 +241,8 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
## Run settings related: Spaz ##
def spawn_player(self, player: Player) -> bs.Actor:
spaz = self.spawn_player_spaz(player)
if self._boxing_gloves:
@ -258,7 +257,6 @@ class BetterDeathMatchGame(bs.TeamGameActivity[Player, Team]):
return spaz
## Run settings related: Spaz ##
def _update_scoreboard(self) -> None:
for team in self.teams:
self._scoreboard.set_team_value(team, team.score,

View file

@ -1,8 +1,8 @@
# Ported to api 8 by brostos using baport.(https://github.com/bombsquad-community/baport)
#BetterElimination
#Made by your friend: @[Just] Freak#4999
# BetterElimination
# Made by your friend: @[Just] Freak#4999
#Huge Thx to Nippy for "Live Team Balance"
# Huge Thx to Nippy for "Live Team Balance"
"""Defines a very-customisable Elimination mini-game"""
@ -222,7 +222,7 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
bs.BoolSetting('Epic Mode', default=False),
## Add settings ##
## Add settings ##
bs.BoolSetting('Live Team Balance (by Nippy#2677)', True),
bs.BoolSetting('Enable Gloves', False),
bs.BoolSetting('Enable Powerups', True),
@ -231,7 +231,7 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
bs.BoolSetting('One Punch Kill', False),
bs.BoolSetting('Spawn with Shield', False),
bs.BoolSetting('Punching Only', False),
## Add settings ##
## Add settings ##
]
if issubclass(sessiontype, bs.DualTeamSession):
settings.append(bs.BoolSetting('Solo Mode', default=False))
@ -321,6 +321,8 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
## Run settings related: IcyFloor ##
def on_transition_in(self) -> None:
super().on_transition_in()
activity = bs.getactivity()
@ -330,8 +332,6 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
return
## Run settings related: IcyFloor ##
def on_begin(self) -> None:
super().on_begin()
self._start_time = bs.time()
@ -343,15 +343,14 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
bs.getactivity().globalsnode.tint = (0.5, 0.7, 1)
else:
pass
#-# Tried return here, pfft. Took me 30mins to figure out why pwps spawning only on NightMode
#-# Now its fixed :)
# -# Tried return here, pfft. Took me 30mins to figure out why pwps spawning only on NightMode
# -# Now its fixed :)
if self._enable_powerups:
self.setup_standard_powerup_drops()
else:
pass
## Run settings related: NightMode,Powerups ##
if self._solo_mode:
self._vs_text = bs.NodeActor(
bs.newnode('text',
@ -526,7 +525,6 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
return actor
## Run settings related: Spaz ##
def _print_lives(self, player: Player) -> None:
from bascenev1lib.actor import popuptext
@ -542,24 +540,25 @@ class BetterEliminationGame(bs.TeamGameActivity[Player, Team]):
position=player.node.position).autoretain()
def on_player_leave(self, player: Player) -> None:
########################################################Nippy#2677
team_count=1 #Just initiating
if player.lives>0 and self._live_team_balance:
team_mem=[]
# Nippy#2677
team_count = 1 # Just initiating
if player.lives > 0 and self._live_team_balance:
team_mem = []
for teamer in player.team.players:
if player!=teamer:
team_mem.append(teamer) #Got Dead players Team
live=player.lives
team_count=len(team_mem)
for i in range(int((live if live%2==0 else live+1)/2)): #Extending Player List for Sorted Players
if player != teamer:
team_mem.append(teamer) # Got Dead players Team
live = player.lives
team_count = len(team_mem)
# Extending Player List for Sorted Players
for i in range(int((live if live % 2 == 0 else live+1)/2)):
team_mem.extend(team_mem)
if team_count>0:
if team_count > 0:
for i in range(live):
team_mem[i].lives+=1
team_mem[i].lives += 1
if team_count<=0 : #Draw if Player Leaves
if team_count <= 0: # Draw if Player Leaves
self.end_game()
########################################################Nippy#2677
# Nippy#2677
super().on_player_leave(player)
player.icons = []

View file

@ -147,7 +147,8 @@ class BotShowerGame(bs.TeamGameActivity[Player, Team]):
def _spawn_bot(self) -> None:
assert self._bots is not None
self._bots.spawn_bot(random.choice(self._bot_type), pos=(random.uniform(-11, 11), (9.8 if self.map.getname() == 'Football Stadium' else 5.0), random.uniform(-5, 5)))
self._bots.spawn_bot(random.choice(self._bot_type), pos=(
random.uniform(-11, 11), (9.8 if self.map.getname() == 'Football Stadium' else 5.0), random.uniform(-5, 5)))
def _check_end_game(self) -> None:
living_team_count = 0

View file

@ -123,12 +123,14 @@ class AbyssMap(bs.Map):
gnode.vr_near_clip = 1.0
self.is_flying = True
register_map(AbyssMap)
class SpazTouchFoothold:
pass
class BombToDieMessage:
pass
@ -262,7 +264,7 @@ class Foothold(bs.Actor):
if abs(self.node.position[0]) > 10:
self.lrSig *= -1
self.node.velocity = (
self.lrSig * speed * self.lrSpeedPlus,speed, 0)
self.lrSig * speed * self.lrSpeedPlus, speed, 0)
bs.timer(0.1, bs.WeakCall(self.keep_vel))
else:
self.node.velocity = (0, speed, 0)
@ -443,7 +445,6 @@ class AbyssPlayerSpaz(PlayerSpaz):
and not opposingnode.shattered and opposingbody == 4):
opposingbody = 1
# Special case - if we're holding a flag, don't replace it
# (hmm - should make this customizable or more low level).
held = self.node.hold_node

View file

@ -17,20 +17,23 @@ from bascenev1lib.actor.onscreentimer import OnScreenTimer
if TYPE_CHECKING:
from typing import Any, Type, Dict, List, Optional
def ba_get_api_version():
return 8
def ba_get_levels():
return [bs._level.Level(
'Explodo Run',
gametype=ExplodoRunGame,
settings={},
preview_texture_name='rampagePreview'),bs._level.Level(
preview_texture_name='rampagePreview'), bs._level.Level(
'Epic Explodo Run',
gametype=ExplodoRunGame,
settings={'Epic Mode':True},
settings={'Epic Mode': True},
preview_texture_name='rampagePreview')]
class Player(bs.Player['Team']):
"""Our player type for this game."""
@ -39,6 +42,8 @@ class Team(bs.Team[Player]):
"""Our team type for this game."""
# ba_meta export bascenev1.GameActivity
class ExplodoRunGame(bs.TeamGameActivity[Player, Team]):
name = "Explodo Run"
description = "Run For Your Life :))"
@ -48,7 +53,7 @@ class ExplodoRunGame(bs.TeamGameActivity[Player, Team]):
lower_is_better=False)
default_music = bs.MusicType.TO_THE_DEATH
def __init__(self, settings:dict):
def __init__(self, settings: dict):
settings['map'] = "Rampage"
self._epic_mode = settings.get('Epic Mode', False)
if self._epic_mode:
@ -66,20 +71,21 @@ class ExplodoRunGame(bs.TeamGameActivity[Player, Team]):
self._timer = OnScreenTimer()
bs.timer(2.5, self._timer.start)
#Bots Hehe
bs.timer(2.5,self.street)
# Bots Hehe
bs.timer(2.5, self.street)
def street(self):
for a in range(self.wave):
p1 = random.choice([-5,-2.5,0,2.5,5])
p3 = random.choice([-4.5,-4.14,-5,-3])
time = random.choice([1,1.5,2.5,2])
self._bots.spawn_bot(ExplodeyBot, pos=(p1,5.5,p3),spawn_time = time)
p1 = random.choice([-5, -2.5, 0, 2.5, 5])
p3 = random.choice([-4.5, -4.14, -5, -3])
time = random.choice([1, 1.5, 2.5, 2])
self._bots.spawn_bot(ExplodeyBot, pos=(p1, 5.5, p3), spawn_time=time)
self.wave += 1
def botrespawn(self):
if not self._bots.have_living_bots():
self.street()
def handlemessage(self, msg: Any) -> Any:
# A player has died.
@ -128,5 +134,3 @@ class ExplodoRunGame(bs.TeamGameActivity[Player, Team]):
# Ends the activity.
self.end(results)

View file

@ -21,6 +21,7 @@ if TYPE_CHECKING:
def ba_get_api_version():
return 8
def ba_get_levels():
return [babase._level.Level(
'Extinction',
@ -33,6 +34,7 @@ def ba_get_levels():
settings={'Epic Mode': True},
preview_texture_name='footballStadiumPreview')]
class Meteor(bs.Actor):
"""A giant meteor instead of bombs."""
@ -91,6 +93,7 @@ class Player(bs.Player['Team']):
super().__init__()
self.death_time: Optional[float] = None
class Team(bs.Team[Player]):
"""Our team type for this game."""

View file

@ -30,6 +30,7 @@ zkPickup = False # Enable/Disable pickup | Default = False
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
class Player(bs.Player['Team']):
"""Our player type for this game."""
@ -41,6 +42,8 @@ class Team(bs.Team[Player]):
self.score = 0
# ba_meta export bascenev1.GameActivity
class FatPigs(bs.TeamGameActivity[Player, Team]):
"""A game type based on acquiring kills."""
@ -139,15 +142,13 @@ 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)))
@ -171,16 +172,15 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
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)
@ -196,7 +196,7 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
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,8 +210,8 @@ 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
@ -249,12 +249,11 @@ class FatPigs(bs.TeamGameActivity[Player, Team]):
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:
if isinstance(msg, bs.PlayerDiedMessage):

View file

@ -20,6 +20,8 @@ DECIMAL_LIMIT = 7
PlayerSpaz.supershit = PlayerSpaz.__init__
def ShitInit(self,
player: bs.Player,
color: Sequence[float] = (1.0, 1.0, 1.0),
@ -27,20 +29,25 @@ def ShitInit(self,
character: str = 'Spaz',
powerups_expire: bool = True) -> None:
self.supershit(player, color, highlight, character, powerups_expire)
self.offt = bs.newnode('math', owner=self.node, attrs={'input1': (1.2, 1.8, -0.7),'operation': 'add'})
self.offt = bs.newnode('math', owner=self.node, attrs={
'input1': (1.2, 1.8, -0.7), 'operation': 'add'})
self.node.connectattr('torso_position', self.offt, 'input2')
self.txt = bs.newnode('text', owner=self.node, attrs={'text': '3.0','in_world': True,'text':'0','shadow': 1.0,'color': (1,0,0),'flatness': 0.5,'scale': 0.01,'h_align': 'right'})
self.txt = bs.newnode('text', owner=self.node, attrs={'text': '3.0', 'in_world': True, 'text': '0', 'shadow': 1.0, 'color': (
1, 0, 0), 'flatness': 0.5, 'scale': 0.01, 'h_align': 'right'})
p = self.node.position
self.xyz = 0
self.txt.text = "X: " + str(p[0]) + "\nY: " + str(p[1]) + "\nZ: " + str(p[2])
self.offt.connectattr('output', self.txt, 'position')
def update():
p = self.node.position
is_moving = abs(self.node.move_up_down) >= 0.01 or abs(self.node.move_left_right) >= 0.01
if is_moving:
self.xyz = (p[0],p[1],p[2])
self.txt.text = "X: " + str(round(self.xyz[0],DECIMAL_LIMIT)) + "\nY: " + str(round(self.xyz[1],DECIMAL_LIMIT)) + "\nZ: " + str(round(self.xyz[2],DECIMAL_LIMIT))
bs.timer(0.1,update,repeat=True)
self.xyz = (p[0], p[1], p[2])
self.txt.text = "X: " + str(round(self.xyz[0], DECIMAL_LIMIT)) + "\nY: " + str(
round(self.xyz[1], DECIMAL_LIMIT)) + "\nZ: " + str(round(self.xyz[2], DECIMAL_LIMIT))
bs.timer(0.1, update, repeat=True)
def replaceable_punch(self) -> None:
"""
@ -55,7 +62,8 @@ def replaceable_punch(self) -> None:
index += len(files)
c27 = str(index + 1)
with open(path_aid + '/coords' + c27 + '.txt', 'w') as gg:
gg.write("X: " + str(round(self.xyz[0],DECIMAL_LIMIT)) + "\nY: " + str(round(self.xyz[1],DECIMAL_LIMIT)) + "\nZ: " + str(round(self.xyz[2],DECIMAL_LIMIT)) + '\n\n' + '(' + str(round(self.xyz[0],DECIMAL_LIMIT)) + ', ' + str(round(self.xyz[1],DECIMAL_LIMIT)) + ', ' + str(round(self.xyz[2],DECIMAL_LIMIT)) + ')')
gg.write("X: " + str(round(self.xyz[0], DECIMAL_LIMIT)) + "\nY: " + str(round(self.xyz[1], DECIMAL_LIMIT)) + "\nZ: " + str(round(self.xyz[2], DECIMAL_LIMIT)) +
'\n\n' + '(' + str(round(self.xyz[0], DECIMAL_LIMIT)) + ', ' + str(round(self.xyz[1], DECIMAL_LIMIT)) + ', ' + str(round(self.xyz[2], DECIMAL_LIMIT)) + ')')
bui.screenmessage("Coordinates saved in: " + "BombSquad/Saved XYZ/" + "coords" + c27)
if _babase.app.classic.platform == 'android':
_babase.android_media_scan_file(path_aid)
@ -75,11 +83,14 @@ def replaceable_punch(self) -> None:
self._turbo_filter_add_press('punch')
# ba_meta export plugin
class ragingspeedhorn(babase.Plugin):
try:
oath = _babase.env()['python_directory_user'] + '/Saved XYZ'
os.makedirs(oath,exist_ok=False)
except: pass
os.makedirs(oath, exist_ok=False)
except:
pass
PlayerSpaz.on_punch_press = replaceable_punch
PlayerSpaz.__init__ = ShitInit
PlayerSpaz.xyz = 0