From 7dcf3c711e859dbe7ada70685e7bf82deb9ab9d7 Mon Sep 17 00:00:00 2001 From: Freaku17 Date: Fri, 28 Jul 2023 11:37:09 +0000 Subject: [PATCH] [ci] auto-format --- plugins/minigames/arms_race.py | 26 +- plugins/minigames/frozen_one.py | 2 +- plugins/minigames/icy_emits.py | 24 +- plugins/minigames/memory_game.py | 507 ++++++++++++++-------------- plugins/minigames/musical_flags.py | 156 +++++---- plugins/minigames/volleyball.py | 281 +++++++-------- plugins/utilities/floater.py | 52 ++- plugins/utilities/icons_keyboard.py | 67 ++-- plugins/utilities/unlock_TowerD.py | 2 +- 9 files changed, 553 insertions(+), 564 deletions(-) diff --git a/plugins/minigames/arms_race.py b/plugins/minigames/arms_race.py index 7710c2a..475811a 100644 --- a/plugins/minigames/arms_race.py +++ b/plugins/minigames/arms_race.py @@ -1,10 +1,9 @@ # Ported by your friend: Freaku -#Join BCS: +# Join BCS: # https://discord.gg/ucyaesh - # ba_meta require api 8 from __future__ import annotations @@ -19,7 +18,6 @@ if TYPE_CHECKING: from typing import Any, Type, List, Dict, Tuple, Union, Sequence, Optional - class State: def __init__(self, bomb=None, grab=False, punch=False, curse=False, required=False, final=False, name=''): self.bomb = bomb @@ -36,8 +34,8 @@ class State: def apply(self, spaz): spaz.disconnect_controls_from_player() spaz.connect_controls_to_player(enable_punch=self.punch, - enable_bomb=self.bomb, - enable_pickup=self.grab) + enable_bomb=self.bomb, + enable_pickup=self.grab) if self.curse: spaz.curse_time = -1 spaz.curse() @@ -49,16 +47,18 @@ class State: return (self.name) -states = [ State(bomb='normal', name='Basic Bombs'), - State(bomb='ice', name='Frozen Bombs'), - State(bomb='sticky', name='Sticky Bombs'), - State(bomb='impact', name='Impact Bombs'), - State(grab=True, name='Grabbing only'), - State(punch=True, name='Punching only'), - State(curse=True, name='Cursed', final=True) ] +states = [State(bomb='normal', name='Basic Bombs'), + State(bomb='ice', name='Frozen Bombs'), + State(bomb='sticky', name='Sticky Bombs'), + State(bomb='impact', name='Impact Bombs'), + State(grab=True, name='Grabbing only'), + State(punch=True, name='Punching only'), + State(curse=True, name='Cursed', final=True)] + class Player(bs.Player['Team']): """Our player type for this game.""" + def __init__(self): self.state = None @@ -192,4 +192,4 @@ class ArmsRaceGame(bs.TeamGameActivity[Player, Team]): results = bs.GameResults() for team in self.teams: results.set_team_score(team, team.score) - self.end(results=results) \ No newline at end of file + self.end(results=results) diff --git a/plugins/minigames/frozen_one.py b/plugins/minigames/frozen_one.py index 7bfbe65..9b0c9ba 100644 --- a/plugins/minigames/frozen_one.py +++ b/plugins/minigames/frozen_one.py @@ -15,4 +15,4 @@ class FrozenOneGame(ChosenOneGame): super()._set_chosen_one_player(player) if hasattr(player, 'actor'): player.actor.frozen = True - player.actor.node.frozen = 1 \ No newline at end of file + player.actor.node.frozen = 1 diff --git a/plugins/minigames/icy_emits.py b/plugins/minigames/icy_emits.py index 50a883c..f5467e3 100644 --- a/plugins/minigames/icy_emits.py +++ b/plugins/minigames/icy_emits.py @@ -2,7 +2,8 @@ import babase -import bascenev1 as bs, random +import bascenev1 as bs +import random from bascenev1lib.actor.bomb import Bomb from bascenev1lib.game.meteorshower import Player, MeteorShowerGame @@ -14,7 +15,7 @@ class IcyEmitsGame(MeteorShowerGame): @classmethod def get_supported_maps(cls, sessiontype): - return ['Lake Frigid','Hockey Stadium'] + return ['Lake Frigid', 'Hockey Stadium'] def _drop_bomb_cluster(self) -> None: delay = 0.0 @@ -24,23 +25,24 @@ class IcyEmitsGame(MeteorShowerGame): pos = (-7.3 + 15.3 * random.random(), 5.3, -5.5 + 2.1 * random.random()) dropdir = (-1.0 if pos[0] > 0 else 1.0) - vel = (0,10,0) + vel = (0, 10, 0) bs.timer(delay, babase.Call(self._drop_bomb, pos, vel)) delay += 0.1 self._set_meteor_timer() def _drop_bomb(self, position, velocity): - random_xpositions = [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10] - random_zpositions = [-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5] - bomb_position = (random.choice(random_xpositions), 0.2,random.choice(random_zpositions)) - Bomb(position=bomb_position, velocity=velocity, bomb_type = 'ice').autoretain() - - + random_xpositions = [-10, -9, -8, -7, -6, -5, - + 4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + random_zpositions = [-5, -4.5, -4, -3.5, -3, -2.5, -2, - + 1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5] + bomb_position = (random.choice(random_xpositions), 0.2, random.choice(random_zpositions)) + Bomb(position=bomb_position, velocity=velocity, bomb_type='ice').autoretain() # ba_meta export plugin class byFreaku(babase.Plugin): def __init__(self): ## Campaign support ## - randomPic = ['lakeFrigidPreview','hockeyStadiumPreview'] - babase.app.classic.add_coop_practice_level(bs.Level(name='Icy Emits', displayname='${GAME}', gametype=IcyEmitsGame, settings={}, preview_texture_name=random.choice(randomPic))) \ No newline at end of file + randomPic = ['lakeFrigidPreview', 'hockeyStadiumPreview'] + babase.app.classic.add_coop_practice_level(bs.Level( + name='Icy Emits', displayname='${GAME}', gametype=IcyEmitsGame, settings={}, preview_texture_name=random.choice(randomPic))) diff --git a/plugins/minigames/memory_game.py b/plugins/minigames/memory_game.py index a433eec..5ab2502 100644 --- a/plugins/minigames/memory_game.py +++ b/plugins/minigames/memory_game.py @@ -12,32 +12,29 @@ from __future__ import annotations # (& some improvements) - - - - # incase someone is wondering how is map floating. Check out # def spawnAllMap(self) - # ba_meta require api 8 from typing import TYPE_CHECKING, overload -import _babase, babase, random +import _babase +import babase +import random import bascenev1 as bs from bascenev1lib.gameutils import SharedObjects if TYPE_CHECKING: from typing import Any, Sequence, Optional, List, Dict, Type, Union, Any, Literal - - class OnTimer(bs.Actor): """Timer which counts but doesn't show on-screen""" + def __init__(self) -> None: super().__init__() self._starttime_ms: int | None = None - self.node = bs.newnode('text', attrs={ 'v_attach': 'top', 'h_attach': 'center', 'h_align': 'center', 'color': (1, 1, 0.5, 1), 'flatness': 0.5, 'shadow': 0.5, 'position': (0, -70), 'scale': 0, 'text': ''}) + self.node = bs.newnode('text', attrs={'v_attach': 'top', 'h_attach': 'center', 'h_align': 'center', 'color': ( + 1, 1, 0.5, 1), 'flatness': 0.5, 'shadow': 0.5, 'position': (0, -70), 'scale': 0, 'text': ''}) self.inputnode = bs.newnode( 'timedisplay', attrs={'timemin': 0, 'showsubseconds': True} ) @@ -101,8 +98,6 @@ class OnTimer(bs.Actor): self.node.delete() - - class Player(bs.Player['Team']): """Our player type for this game.""" @@ -120,7 +115,8 @@ class MGgame(bs.TeamGameActivity[Player, Team]): name = 'Memory Game' description = 'Memories tiles and survive till the end!' - available_settings = [bs.BoolSetting('Epic Mode', default=False), bs.BoolSetting('Enable Bottom Credits', True)] + available_settings = [bs.BoolSetting( + 'Epic Mode', default=False), bs.BoolSetting('Enable Bottom Credits', True)] scoreconfig = bs.ScoreConfig(label='Survived', scoretype=bs.ScoreType.MILLISECONDS, version='B') # Print messages when players die (since its meaningful in this game). @@ -152,9 +148,9 @@ class MGgame(bs.TeamGameActivity[Player, Team]): if self._epic_mode: self.slow_motion = True shared = SharedObjects.get() - self._collide_with_player=bs.Material() + self._collide_with_player = bs.Material() self._collide_with_player.add_actions(actions=(('modify_part_collision', 'collide', True))) - self.dont_collide=bs.Material() + self.dont_collide = bs.Material() self.dont_collide.add_actions(actions=(('modify_part_collision', 'collide', False))) self._levelStage = 0 @@ -177,7 +173,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]): self._mapFGSpaz = bs.gettexture('neoSpazIcon') self._mapFGZoe = bs.gettexture('zoeIcon') self._mapFGSnake = bs.gettexture('ninjaIcon') - self._mapFGKronk= bs.gettexture('kronkIcon') + self._mapFGKronk = bs.gettexture('kronkIcon') self._mapFGMel = bs.gettexture('melIcon') self._mapFGJack = bs.gettexture('jackIcon') self._mapFGSanta = bs.gettexture('santaIcon') @@ -195,59 +191,58 @@ class MGgame(bs.TeamGameActivity[Player, Team]): self._circleTex = bs.gettexture('circleShadow') self._image = bs.newnode('image', - attrs={'texture': self._imageTextDefault, - 'position':(0,-100), - 'scale':(100,100), - 'opacity': 0.0, - 'attach':'topCenter'}) + attrs={'texture': self._imageTextDefault, + 'position': (0, -100), + 'scale': (100, 100), + 'opacity': 0.0, + 'attach': 'topCenter'}) self._textCounter = bs.newnode('text', - attrs={'text': '10', - 'position': (0, -100), - 'scale': 2.3, - 'shadow': 1.0, - 'flatness': 1.0, - 'opacity': 0.0, - 'v_attach': 'top', - 'h_attach': 'center', - 'h_align': 'center', - 'v_align': 'center'}) + attrs={'text': '10', + 'position': (0, -100), + 'scale': 2.3, + 'shadow': 1.0, + 'flatness': 1.0, + 'opacity': 0.0, + 'v_attach': 'top', + 'h_attach': 'center', + 'h_align': 'center', + 'v_align': 'center'}) self._textLevel = bs.newnode('text', - attrs={'text': 'Level ' + str(self._levelStage), - 'position': (0, -28), - 'scale': 1.3, - 'shadow': 1.0, - 'flatness': 1.0, - 'color': (1.0, 0.0, 1.0), - 'opacity': 0.0, - 'v_attach': 'top', - 'h_attach': 'center', - 'h_align': 'center', - 'v_align': 'center'}) + attrs={'text': 'Level ' + str(self._levelStage), + 'position': (0, -28), + 'scale': 1.3, + 'shadow': 1.0, + 'flatness': 1.0, + 'color': (1.0, 0.0, 1.0), + 'opacity': 0.0, + 'v_attach': 'top', + 'h_attach': 'center', + 'h_align': 'center', + 'v_align': 'center'}) self._imageCircle = bs.newnode('image', - attrs={'texture': self._circleTex, - 'position': (75, -75), - 'scale': (20,20), - 'color': (0.2, 0.2, 0.2), - 'opacity': 0.0, - 'attach': 'topCenter'}) + attrs={'texture': self._circleTex, + 'position': (75, -75), + 'scale': (20, 20), + 'color': (0.2, 0.2, 0.2), + 'opacity': 0.0, + 'attach': 'topCenter'}) self._imageCircle2 = bs.newnode('image', - attrs={'texture': self._circleTex, - 'position': (75, -100), - 'scale': (20,20), - 'color': (0.2, 0.2, 0.2), - 'opacity': 0.0, - 'attach': 'topCenter'}) + attrs={'texture': self._circleTex, + 'position': (75, -100), + 'scale': (20, 20), + 'color': (0.2, 0.2, 0.2), + 'opacity': 0.0, + 'attach': 'topCenter'}) self._imageCircle3 = bs.newnode('image', - attrs={'texture': self._circleTex, - 'position': (75, -125), - 'scale': (20,20), - 'color': (0.2, 0.2, 0.2), - 'opacity': 0.0, - 'attach': 'topCenter'}) - + attrs={'texture': self._circleTex, + 'position': (75, -125), + 'scale': (20, 20), + 'color': (0.2, 0.2, 0.2), + 'opacity': 0.0, + 'attach': 'topCenter'}) def on_transition_in(self) -> None: super().on_transition_in() @@ -300,14 +295,14 @@ class MGgame(bs.TeamGameActivity[Player, Team]): self.coldel16 = True if self.credit_text: t = bs.newnode('text', - attrs={ 'text':"Made by Freaku\nOriginally for 1.4: byANG3L", ## Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely... - 'scale':0.7, - 'position':(0,0), - 'shadow':0.5, - 'flatness':1.2, - 'color':(1, 1, 1), - 'h_align':'center', - 'v_attach':'bottom'}) + attrs={'text': "Made by Freaku\nOriginally for 1.4: byANG3L", # Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely... + 'scale': 0.7, + 'position': (0, 0), + 'shadow': 0.5, + 'flatness': 1.2, + 'color': (1, 1, 1), + 'h_align': 'center', + 'v_attach': 'bottom'}) self.spawnAllMap() self.flashHide() @@ -318,6 +313,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]): def startCounter(self): self._textCounter.text = '10' + def count9(): def count8(): def count7(): @@ -366,8 +362,8 @@ class MGgame(bs.TeamGameActivity[Player, Team]): if self.has_begun(): bs.broadcastmessage( babase.Lstr(resource='playerDelayedJoinText', - subs=[('${PLAYER}', player.getname(full=True))]), - color=(0, 1, 0),transient=True,clients=[player.sessionplayer.inputdevice.client_id]) + subs=[('${PLAYER}', player.getname(full=True))]), + color=(0, 1, 0), transient=True, clients=[player.sessionplayer.inputdevice.client_id]) # For score purposes, mark them as having died right as the # game started. assert self._timer is not None @@ -385,7 +381,8 @@ class MGgame(bs.TeamGameActivity[Player, Team]): # overriding the default character spawning.. def spawn_player(self, player: Player) -> bs.Actor: spaz = self.spawn_player_spaz(player) - pos = (self._spawnCenter[0] + random.uniform(-1.5, 2.5), self._spawnCenter[1], self._spawnCenter[2] + random.uniform(-2.5, 1.5)) + pos = (self._spawnCenter[0] + random.uniform(-1.5, 2.5), + self._spawnCenter[1], self._spawnCenter[2] + random.uniform(-2.5, 1.5)) spaz.connect_controls_to_player(enable_punch=False, enable_bomb=False, enable_pickup=False) spaz.handlemessage(bs.StandMessage(pos)) return spaz @@ -393,49 +390,50 @@ class MGgame(bs.TeamGameActivity[Player, Team]): def _randomSelect(self): if self._levelStage == 1: self._textureSelected = random.choice([self._mapFGMinesTex, - self._mapFGStickyTex]) + self._mapFGStickyTex]) self._image.texture = self._textureSelected elif self._levelStage == 2: self._textureSelected = random.choice([self._mapFGIceTex, - self._mapFGShieldTex]) + self._mapFGShieldTex]) self._image.texture = self._textureSelected - elif self._levelStage in [3,4,5]: + elif self._levelStage in [3, 4, 5]: self._textureSelected = random.choice([self._mapFGStickyTex, - self._mapFGIceTex, - self._mapFGImpactTex, - self._mapFGMinesTex]) + self._mapFGIceTex, + self._mapFGImpactTex, + self._mapFGMinesTex]) self._image.texture = self._textureSelected - elif self._levelStage in [6,7,8,9]: + elif self._levelStage in [6, 7, 8, 9]: self._textureSelected = random.choice([self._mapFGCurseTex, - self._mapFGHealthTex, - self._mapFGIceTex, - self._mapFGImpactTex, - self._mapFGMinesTex, - self._mapFGPunchTex, - self._mapFGShieldTex]) + self._mapFGHealthTex, + self._mapFGIceTex, + self._mapFGImpactTex, + self._mapFGMinesTex, + self._mapFGPunchTex, + self._mapFGShieldTex]) self._image.texture = self._textureSelected elif self._levelStage >= 10: self._textureSelected = random.choice([self._mapFGSpaz, - self._mapFGZoe, - self._mapFGSnake, - self._mapFGKronk, - self._mapFGMel, - self._mapFGJack, - self._mapFGSanta, - self._mapFGFrosty, - self._mapFGBones, - self._mapFGBernard, - self._mapFGPascal, - self._mapFGAli, - self._mapFGRobot, - self._mapFGAgent, - self._mapFGGrumbledorf, - self._mapFGPixel]) + self._mapFGZoe, + self._mapFGSnake, + self._mapFGKronk, + self._mapFGMel, + self._mapFGJack, + self._mapFGSanta, + self._mapFGFrosty, + self._mapFGBones, + self._mapFGBernard, + self._mapFGPascal, + self._mapFGAli, + self._mapFGRobot, + self._mapFGAgent, + self._mapFGGrumbledorf, + self._mapFGPixel]) self._image.texture = self._textureSelected return self._textureSelected def _stop(self): self._textureSelected = self._randomSelect() + def circle(): def circle2(): def circle3(): @@ -455,100 +453,100 @@ class MGgame(bs.TeamGameActivity[Player, Team]): def _randomPlatform(self): if self._levelStage == 1: - randomTexture=[self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex] + randomTexture = [self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex] elif self._levelStage == 2: - randomTexture=[self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGShieldTex, - self._mapFGShieldTex, - self._mapFGShieldTex, - self._mapFGShieldTex, - self._mapFGShieldTex, - self._mapFGShieldTex, - self._mapFGShieldTex, - self._mapFGShieldTex] - elif self._levelStage in [3,4,5]: - randomTexture=[self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGStickyTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGImpactTex, - self._mapFGImpactTex, - self._mapFGImpactTex, - self._mapFGImpactTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGMinesTex] - elif self._levelStage in [6,7,8,9]: - randomTexture=[self._mapFGHealthTex, - self._mapFGShieldTex, - self._mapFGCurseTex, - self._mapFGCurseTex, - self._mapFGHealthTex, - self._mapFGHealthTex, - self._mapFGIceTex, - self._mapFGIceTex, - self._mapFGImpactTex, - self._mapFGImpactTex, - self._mapFGMinesTex, - self._mapFGMinesTex, - self._mapFGPunchTex, - self._mapFGPunchTex, - self._mapFGShieldTex, - self._mapFGShieldTex] + randomTexture = [self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGShieldTex, + self._mapFGShieldTex, + self._mapFGShieldTex, + self._mapFGShieldTex, + self._mapFGShieldTex, + self._mapFGShieldTex, + self._mapFGShieldTex, + self._mapFGShieldTex] + elif self._levelStage in [3, 4, 5]: + randomTexture = [self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGStickyTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGImpactTex, + self._mapFGImpactTex, + self._mapFGImpactTex, + self._mapFGImpactTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGMinesTex] + elif self._levelStage in [6, 7, 8, 9]: + randomTexture = [self._mapFGHealthTex, + self._mapFGShieldTex, + self._mapFGCurseTex, + self._mapFGCurseTex, + self._mapFGHealthTex, + self._mapFGHealthTex, + self._mapFGIceTex, + self._mapFGIceTex, + self._mapFGImpactTex, + self._mapFGImpactTex, + self._mapFGMinesTex, + self._mapFGMinesTex, + self._mapFGPunchTex, + self._mapFGPunchTex, + self._mapFGShieldTex, + self._mapFGShieldTex] elif self._levelStage >= 10: - randomTexture=[self._mapFGSpaz, - self._mapFGZoe, - self._mapFGSnake, - self._mapFGKronk, - self._mapFGMel, - self._mapFGJack, - self._mapFGSanta, - self._mapFGFrosty, - self._mapFGBones, - self._mapFGBernard, - self._mapFGPascal, - self._mapFGAli, - self._mapFGRobot, - self._mapFGAgent, - self._mapFGGrumbledorf, - self._mapFGPixel] + randomTexture = [self._mapFGSpaz, + self._mapFGZoe, + self._mapFGSnake, + self._mapFGKronk, + self._mapFGMel, + self._mapFGJack, + self._mapFGSanta, + self._mapFGFrosty, + self._mapFGBones, + self._mapFGBernard, + self._mapFGPascal, + self._mapFGAli, + self._mapFGRobot, + self._mapFGAgent, + self._mapFGGrumbledorf, + self._mapFGPixel] (self.mapFGPTex, self.mapFGP2Tex, self.mapFGP3Tex, self.mapFGP4Tex, - self.mapFGP5Tex, self.mapFGP6Tex, - self.mapFGP7Tex, self.mapFGP8Tex, - self.mapFGP9Tex,self.mapFGP10Tex, - self.mapFGP11Tex, self.mapFGP12Tex, - self.mapFGP13Tex, self.mapFGP14Tex, - self.mapFGP15Tex, self.mapFGP16Tex) = ( - random.sample(randomTexture, 16)) + self.mapFGP5Tex, self.mapFGP6Tex, + self.mapFGP7Tex, self.mapFGP8Tex, + self.mapFGP9Tex, self.mapFGP10Tex, + self.mapFGP11Tex, self.mapFGP12Tex, + self.mapFGP13Tex, self.mapFGP14Tex, + self.mapFGP15Tex, self.mapFGP16Tex) = ( + random.sample(randomTexture, 16)) self._mixPlatform() def _mixPlatform(self): @@ -685,114 +683,130 @@ class MGgame(bs.TeamGameActivity[Player, Team]): shared = SharedObjects.get() if self.coldel: self.mapFGP = bs.newnode('prop', - attrs={'body': 'puck', 'position': (4.5,2,-9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + attrs={'body': 'puck', 'position': (4.5, 2, -9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGPTex = None - self.mapFGPcol = bs.newnode('region',attrs={'position': (4.5,2,-9),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGPcol = bs.newnode('region', attrs={'position': (4.5, 2, -9), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel = False if self.coldel2: - self.mapFGP2 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (4.5,2,-6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP2 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (4.5, 2, -6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP2Tex = None - self.mapFGP2col = bs.newnode('region',attrs={'position': (4.5,2,-6),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP2col = bs.newnode('region', attrs={'position': (4.5, 2, -6), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel2 = False if self.coldel3: - self.mapFGP3 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (4.5,2,-3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP3 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (4.5, 2, -3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP3Tex = None - self.mapFGP3col = bs.newnode('region',attrs={'position': (4.5,2,-3),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP3col = bs.newnode('region', attrs={'position': (4.5, 2, -3), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel3 = False if self.coldel4: - self.mapFGP4 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (4.5,2,0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP4 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (4.5, 2, 0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP4Tex = None - self.mapFGP4col = bs.newnode('region',attrs={'position': (4.5,2,0),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP4col = bs.newnode('region', attrs={'position': (4.5, 2, 0), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel4 = False if self.coldel5: - self.mapFGP5 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (1.5,2,-9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP5 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (1.5, 2, -9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP5Tex = None - self.mapFGP5col = bs.newnode('region',attrs={'position': (1.5,2,-9),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP5col = bs.newnode('region', attrs={'position': (1.5, 2, -9), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel5 = False if self.coldel6: - self.mapFGP6 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (1.5,2,-6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP6 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (1.5, 2, -6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP6Tex = None - self.mapFGP6col = bs.newnode('region',attrs={'position': (1.5,2,-6),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP6col = bs.newnode('region', attrs={'position': (1.5, 2, -6), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel6 = False if self.coldel7: - self.mapFGP7 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (1.5,2,-3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP7 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (1.5, 2, -3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP7Tex = None - self.mapFGP7col = bs.newnode('region',attrs={'position': (1.5,2,-3),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP7col = bs.newnode('region', attrs={'position': (1.5, 2, -3), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel7 = False if self.coldel8: - self.mapFGP8 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (1.5,2,0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP8 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (1.5, 2, 0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP8Tex = None - self.mapFGP8col = bs.newnode('region',attrs={'position': (1.5,2,0),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP8col = bs.newnode('region', attrs={'position': (1.5, 2, 0), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel8 = False if self.coldel9: - self.mapFGP9 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-1.5,2,-9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP9 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-1.5, 2, -9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP9Tex = None - self.mapFGP9col = bs.newnode('region',attrs={'position': (-1.5,2,-9),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP9col = bs.newnode('region', attrs={'position': (-1.5, 2, -9), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel9 = False if self.coldel10: - self.mapFGP10 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-1.5,2,-6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP10 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-1.5, 2, -6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP10Tex = None - self.mapFGP10col = bs.newnode('region',attrs={'position': (-1.5,2,-6),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP10col = bs.newnode('region', attrs={'position': (-1.5, 2, -6), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel10 = False if self.coldel11: - self.mapFGP11 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-1.5,2,-3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP11 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-1.5, 2, -3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP11Tex = None - self.mapFGP11col = bs.newnode('region',attrs={'position': (-1.5,2,-3),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP11col = bs.newnode('region', attrs={'position': (-1.5, 2, -3), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel11 = False if self.coldel12: - self.mapFGP12 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-1.5,2,0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP12 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-1.5, 2, 0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP12Tex = None - self.mapFGP12col = bs.newnode('region',attrs={'position': (-1.5,2,0),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP12col = bs.newnode('region', attrs={'position': (-1.5, 2, 0), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel12 = False if self.coldel13: - self.mapFGP13 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-4.5,2,-9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP13 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-4.5, 2, -9), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP13Tex = None - self.mapFGP13col = bs.newnode('region',attrs={'position': (-4.5,2,-9),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP13col = bs.newnode('region', attrs={'position': (-4.5, 2, -9), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel13 = False if self.coldel14: - self.mapFGP14 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-4.5,2,-6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP14 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-4.5, 2, -6), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP14Tex = None - self.mapFGP14col = bs.newnode('region',attrs={'position': (-4.5,2,-6),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP14col = bs.newnode('region', attrs={'position': (-4.5, 2, -6), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel14 = False if self.coldel15: - self.mapFGP15 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-4.5,2,-3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP15 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-4.5, 2, -3), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP15Tex = None - self.mapFGP15col = bs.newnode('region',attrs={'position': (-4.5,2,-3),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP15col = bs.newnode('region', attrs={'position': (-4.5, 2, -3), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel15 = False if self.coldel16: - self.mapFGP16 = bs.newnode('prop', - attrs={'body': 'puck', 'position': (-4.5,2,0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale':0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) + self.mapFGP16 = bs.newnode('prop', + attrs={'body': 'puck', 'position': (-4.5, 2, 0), 'mesh': self._mapFGPModel, 'mesh_scale': 3.73, 'body_scale': 3.73, 'shadow_size': 0.5, 'gravity_scale': 0.0, 'color_texture': self._mapFGPDefaultTex, 'reflection': 'soft', 'reflection_scale': [1.0], 'is_area_of_interest': True, 'materials': [self.dont_collide]}) self.mapFGP16Tex = None - self.mapFGP16col = bs.newnode('region',attrs={'position': (-4.5,2,0),'scale': (3.5,0.1,3.5),'type': 'box','materials': (self._collide_with_player, shared.footing_material)}) + self.mapFGP16col = bs.newnode('region', attrs={'position': (-4.5, 2, 0), 'scale': ( + 3.5, 0.1, 3.5), 'type': 'box', 'materials': (self._collide_with_player, shared.footing_material)}) self.coldel16 = False def _platformTexDefault(self): @@ -876,7 +890,6 @@ class MGgame(bs.TeamGameActivity[Player, Team]): if living_team_count <= 1: self.end_game() - def end_game(self) -> None: cur_time = bs.time() assert self._timer is not None @@ -929,18 +942,14 @@ class MGgame(bs.TeamGameActivity[Player, Team]): self.end(results=results) - - - - - - - class MGdefs(): points = {} boxes = {} - boxes['area_of_interest_bounds'] = (0.3544110667, 4.493562578, -2.518391331) + (0.0, 0.0, 0.0) + (16.64754831, 8.06138989, 18.5029888) - boxes['map_bounds'] = (0.2608783669, 4.899663734, -3.543675157) + (0.0, 0.0, 0.0) + (29.23565494, 14.19991443, 29.92689344) + boxes['area_of_interest_bounds'] = ( + 0.3544110667, 4.493562578, -2.518391331) + (0.0, 0.0, 0.0) + (16.64754831, 8.06138989, 18.5029888) + boxes['map_bounds'] = (0.2608783669, 4.899663734, -3.543675157) + \ + (0.0, 0.0, 0.0) + (29.23565494, 14.19991443, 29.92689344) + class MGmap(bs.Map): defs = MGdefs() @@ -983,16 +992,12 @@ class MGmap(bs.Map): gnode.vr_near_clip = 0.5 - - - bs._map.register_map(MGmap) - - # ba_meta export plugin class byFreaku(babase.Plugin): def __init__(self): ## Campaign support ## - babase.app.classic.add_coop_practice_level(bs.Level(name='Memory Game', displayname='${GAME}', gametype=MGgame, settings={}, preview_texture_name='achievementOffYouGo')) \ No newline at end of file + babase.app.classic.add_coop_practice_level(bs.Level( + name='Memory Game', displayname='${GAME}', gametype=MGgame, settings={}, preview_texture_name='achievementOffYouGo')) diff --git a/plugins/minigames/musical_flags.py b/plugins/minigames/musical_flags.py index 41828b3..7934c10 100644 --- a/plugins/minigames/musical_flags.py +++ b/plugins/minigames/musical_flags.py @@ -1,31 +1,31 @@ -## Made by MattZ45986 on GitHub -## Ported by your friend: Freaku +# Made by MattZ45986 on GitHub +# Ported by your friend: Freaku -#Bug Fixes & Improvements as well... +# Bug Fixes & Improvements as well... -#Join BCS: +# Join BCS: # https://discord.gg/ucyaesh - - from __future__ import annotations from typing import TYPE_CHECKING -import _babase, random, math +import _babase +import random +import math import bascenev1 as bs -from bascenev1lib.actor.flag import Flag,FlagPickedUpMessage +from bascenev1lib.actor.flag import Flag, FlagPickedUpMessage from bascenev1lib.actor.playerspaz import PlayerSpaz if TYPE_CHECKING: from typing import Any, Type, List, Dict, Tuple, Union, Sequence, Optional - class Player(bs.Player['Team']): def __init__(self) -> None: self.done: bool = False self.survived: bool = True + class Team(bs.Team[Player]): def __init__(self) -> None: self.score = 0 @@ -73,23 +73,23 @@ class MFGame(bs.TeamGameActivity[Player, Team]): self.is_run = bool(settings['Enable Running']) self._textRound = bs.newnode('text', - attrs={'text': '', - 'position': (0, -38), - 'scale': 1, - 'shadow': 1.0, - 'flatness': 1.0, - 'color': (1.0, 0.0, 1.0), - 'opacity': 1, - 'v_attach': 'top', - 'h_attach': 'center', - 'h_align': 'center', - 'v_align': 'center'}) + attrs={'text': '', + 'position': (0, -38), + 'scale': 1, + 'shadow': 1.0, + 'flatness': 1.0, + 'color': (1.0, 0.0, 1.0), + 'opacity': 1, + 'v_attach': 'top', + 'h_attach': 'center', + 'h_align': 'center', + 'v_align': 'center'}) self.round_time = int(settings['Max Round Time']) self.reset_round_time = int(settings['Max Round Time']) self.should_die_occur = True self.round_time_textnode = bs.newnode('text', - attrs={ - 'text': "",'flatness':1.0,'h_align':'center','h_attach':'center','v_attach':'top','v_align':'center','position':(0,-15),'scale':0.9,'color':(1,0.7,0.9)}) + attrs={ + 'text': "", 'flatness': 1.0, 'h_align': 'center', 'h_attach': 'center', 'v_attach': 'top', 'v_align': 'center', 'position': (0, -15), 'scale': 0.9, 'color': (1, 0.7, 0.9)}) self.slow_motion = self._epic_mode # A cool music, matching our gamemode theme @@ -106,7 +106,7 @@ class MFGame(bs.TeamGameActivity[Player, Team]): bs.broadcastmessage( bs.Lstr(resource='playerDelayedJoinText', subs=[('${PLAYER}', player.getname(full=True))]), - color=(0, 1, 0),transient=True) + color=(0, 1, 0), transient=True) player.survived = False return self.spawn_player(player) @@ -125,14 +125,14 @@ class MFGame(bs.TeamGameActivity[Player, Team]): self.spawned = [] if self.credit_text: t = bs.newnode('text', - attrs={ 'text':"Ported by Freaku\nMade by MattZ45986", ## Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely... - 'scale':0.7, - 'position':(0,0), - 'shadow':0.5, - 'flatness':1.2, - 'color':(1, 1, 1), - 'h_align':'center', - 'v_attach':'bottom'}) + attrs={'text': "Ported by Freaku\nMade by MattZ45986", # Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely... + 'scale': 0.7, + 'position': (0, 0), + 'shadow': 0.5, + 'flatness': 1.2, + 'color': (1, 1, 1), + 'h_align': 'center', + 'v_attach': 'bottom'}) self.makeRound() self._textRound.text = 'Round ' + str(self.roundNum) bs.timer(3, self.checkEnd) @@ -147,14 +147,15 @@ class MFGame(bs.TeamGameActivity[Player, Team]): if not player.done: try: player.survived = False - player.actor.handlemessage(bs.StandMessage((0,3,-2))) - bs.timer(0.5,bs.Call(player.actor.handlemessage, bs.FreezeMessage())) - bs.timer(1.5,bs.Call(player.actor.handlemessage, bs.FreezeMessage())) - bs.timer(2.5,bs.Call(player.actor.handlemessage, bs.FreezeMessage())) - bs.timer(3,bs.Call(player.actor.handlemessage, bs.ShouldShatterMessage())) - except: pass - bs.timer(3.5,self.killRound) - bs.timer(3.55,self.makeRound) + player.actor.handlemessage(bs.StandMessage((0, 3, -2))) + bs.timer(0.5, bs.Call(player.actor.handlemessage, bs.FreezeMessage())) + bs.timer(1.5, bs.Call(player.actor.handlemessage, bs.FreezeMessage())) + bs.timer(2.5, bs.Call(player.actor.handlemessage, bs.FreezeMessage())) + bs.timer(3, bs.Call(player.actor.handlemessage, bs.ShouldShatterMessage())) + except: + pass + bs.timer(3.5, self.killRound) + bs.timer(3.55, self.makeRound) self.round_time_textnode.opacity = 0 self.round_time = self.reset_round_time else: @@ -163,7 +164,8 @@ class MFGame(bs.TeamGameActivity[Player, Team]): def makeRound(self): for player in self.players: - if player.survived: player.team.score += 1 + if player.survived: + player.team.score += 1 self.roundNum += 1 self._textRound.text = 'Round ' + str(self.roundNum) self.flags = [] @@ -171,48 +173,57 @@ class MFGame(bs.TeamGameActivity[Player, Team]): self.should_die_occur = True self.round_time = self.reset_round_time self.round_time_textnode.opacity = 1 - angle = random.randint(0,359) - c=0 + angle = random.randint(0, 359) + c = 0 for player in self.players: - if player.survived: c+=1 + if player.survived: + c += 1 spacing = 10 for player in self.players: player.done = False if player.survived: if not player.is_alive(): - self.spawn_player(player,(.5,5,-4)) + self.spawn_player(player, (.5, 5, -4)) self.spawned.append(player) - try: spacing = 360 // (c) - except: self.checkEnd() - colors = [(1,0,0),(0,1,0),(0,0,1),(1,1,0),(1,0,1),(0,1,1),(0,0,0),(0.5,0.8,0),(0,0.8,0.5),(0.8,0.25,0.7),(0,0.27,0.55),(2,2,0.6),(0.4,3,0.85)] - + try: + spacing = 360 // (c) + except: + self.checkEnd() + colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (1, 0, 1), (0, 1, 1), (0, 0, 0), + (0.5, 0.8, 0), (0, 0.8, 0.5), (0.8, 0.25, 0.7), (0, 0.27, 0.55), (2, 2, 0.6), (0.4, 3, 0.85)] + # Add support for more than 13 players if c > 12: for i in range(c-12): - colors.append((random.uniform(0.1, 1), random.uniform(0.1, 1), random.uniform(0.1, 1))) - + colors.append((random.uniform(0.1, 1), random.uniform( + 0.1, 1), random.uniform(0.1, 1))) + # Smart Mathematics: # All Flags spawn same distance from the players for i in range(c-1): angle += spacing angle %= 360 - x=6 * math.sin(math.degrees(angle)) - z=6 * math.cos(math.degrees(angle)) - flag = Flag(position=(x+.5,5,z-4), color=colors[i]).autoretain() + x = 6 * math.sin(math.degrees(angle)) + z = 6 * math.cos(math.degrees(angle)) + flag = Flag(position=(x+.5, 5, z-4), color=colors[i]).autoretain() self.flags.append(flag) def killRound(self): self.numPickedUp = 0 for player in self.players: - if player.is_alive(): player.actor.handlemessage(bs.DieMessage()) - for flag in self.flags: flag.node.delete() - for light in self.nodes: light.delete() + if player.is_alive(): + player.actor.handlemessage(bs.DieMessage()) + for flag in self.flags: + flag.node.delete() + for light in self.nodes: + light.delete() - def spawn_player(self, player: Player, pos: tuple = (0,0,0)) -> bs.Actor: + def spawn_player(self, player: Player, pos: tuple = (0, 0, 0)) -> bs.Actor: spaz = self.spawn_player_spaz(player) - if pos == (0,0,0): - pos = (-.5+random.random()*2,3+random.random()*2,-5+random.random()*2) - spaz.connect_controls_to_player(enable_punch=self.is_punch, enable_bomb=False, enable_run=self.is_run) + if pos == (0, 0, 0): + pos = (-.5+random.random()*2, 3+random.random()*2, -5+random.random()*2) + spaz.connect_controls_to_player(enable_punch=self.is_punch, + enable_bomb=False, enable_run=self.is_run) spaz.handlemessage(bs.StandMessage(pos)) return spaz @@ -231,10 +242,10 @@ class MFGame(bs.TeamGameActivity[Player, Team]): self.numPickedUp += 1 msg.node.getdelegate(PlayerSpaz, True).getplayer(Player, True).done = True l = bs.newnode('light', - owner=None, - attrs={'color':msg.node.color, - 'position':(msg.node.position_center), - 'intensity':1}) + owner=None, + attrs={'color': msg.node.color, + 'position': (msg.node.position_center), + 'intensity': 1}) self.nodes.append(l) msg.flag.handlemessage(bs.DieMessage()) msg.node.handlemessage(bs.DieMessage()) @@ -247,12 +258,13 @@ class MFGame(bs.TeamGameActivity[Player, Team]): try: player.survived = False bs.broadcastmessage("No Flag? "+player.getname()) - player.actor.handlemessage(bs.StandMessage((0,3,-2))) - bs.timer(0.5,bs.Call(player.actor.handlemessage, bs.FreezeMessage())) - bs.timer(3,bs.Call(player.actor.handlemessage, bs.ShouldShatterMessage())) - except: pass - bs.timer(3.5,self.killRound) - bs.timer(3.55,self.makeRound) + player.actor.handlemessage(bs.StandMessage((0, 3, -2))) + bs.timer(0.5, bs.Call(player.actor.handlemessage, bs.FreezeMessage())) + bs.timer(3, bs.Call(player.actor.handlemessage, bs.ShouldShatterMessage())) + except: + pass + bs.timer(3.5, self.killRound) + bs.timer(3.55, self.makeRound) else: return super().handlemessage(msg) return None @@ -261,7 +273,7 @@ class MFGame(bs.TeamGameActivity[Player, Team]): i = 0 for player in self.players: if player.survived: - i+=1 + i += 1 if i <= 1: for player in self.players: if player.survived: @@ -272,4 +284,4 @@ class MFGame(bs.TeamGameActivity[Player, Team]): results = bs.GameResults() for team in self.teams: results.set_team_score(team, team.score) - self.end(results=results) \ No newline at end of file + self.end(results=results) diff --git a/plugins/minigames/volleyball.py b/plugins/minigames/volleyball.py index b255950..df4c19a 100644 --- a/plugins/minigames/volleyball.py +++ b/plugins/minigames/volleyball.py @@ -3,20 +3,14 @@ # Made by your friend: Freaku - - # Join BCS: # https://discord.gg/ucyaesh - - # My GitHub: # https://github.com/Freaku17/BombSquad-Mods-byFreaku - - # CHANGELOG: """ ## 2021 @@ -38,21 +32,14 @@ """ - - - - - - - - # ba_meta require api 8 from __future__ import annotations from typing import TYPE_CHECKING -import babase, random +import babase +import random import bascenev1 as bs from bascenev1lib.actor.playerspaz import PlayerSpaz from bascenev1lib.actor.scoreboard import Scoreboard @@ -64,7 +51,6 @@ if TYPE_CHECKING: from typing import Any, Sequence, Dict, Type, List, Optional, Union - class PuckDiedMessage: """Inform something that a puck has died.""" @@ -100,14 +86,13 @@ class Puck(bs.Actor): 'position': self._spawn_pos, 'materials': pmats }) - + # Since it rolls on spawn, lets make gravity # to 0, and when another node (bomb/spaz) # touches it. It'll act back as our normie puck! - bs.animate(self.node, 'gravity_scale', {0:-0.1, 0.2:1}, False) + bs.animate(self.node, 'gravity_scale', {0: -0.1, 0.2: 1}, False) # When other node touches, it realises its new gravity_scale - def handlemessage(self, msg: Any) -> Any: if isinstance(msg, bs.DieMessage): assert self.node @@ -148,6 +133,7 @@ class Player(bs.Player['Team']): class Team(bs.Team[Player]): """Our team type for this game.""" + def __init__(self) -> None: self.score = 0 @@ -253,15 +239,14 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): actions=(('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', False), ('call', 'at_connect', self._handle_score))) - - - self._wall_material=bs.Material() - self._fake_wall_material=bs.Material() + + self._wall_material = bs.Material() + self._fake_wall_material = bs.Material() self._wall_material.add_actions( - + actions=( ('modify_part_collision', 'friction', 100000), - )) + )) self._wall_material.add_actions( conditions=('they_have_material', shared.pickup_material), actions=( @@ -270,13 +255,13 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): self._wall_material.add_actions( conditions=(('we_are_younger_than', 100), - 'and', - ('they_have_material',shared.object_material)), + 'and', + ('they_have_material', shared.object_material)), actions=( ('modify_part_collision', 'collide', False), )) self._wall_material.add_actions( - conditions=('they_have_material',shared.footing_material), + conditions=('they_have_material', shared.footing_material), actions=( ('modify_part_collision', 'friction', 9999.5), )) @@ -285,25 +270,24 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): actions=( ('modify_part_collision', 'collide', False), ('modify_part_collision', 'physical', False) - + )) self._fake_wall_material.add_actions( conditions=('they_have_material', shared.player_material), actions=( ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', True) - + )) - self.blocks=[] + self.blocks = [] - - self._net_wall_material=bs.Material() + self._net_wall_material = bs.Material() self._net_wall_material.add_actions( conditions=('they_have_material', shared.player_material), actions=( ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', True) - + )) self._net_wall_material.add_actions( @@ -321,8 +305,7 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): actions=( ('modify_part_collision', 'collide', True), )) - self.net_blocc=[] - + self.net_blocc = [] self._puck_spawn_pos: Optional[Sequence[float]] = None self._score_regions: Optional[List[bs.NodeActor]] = None @@ -365,7 +348,7 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): bs.NodeActor( bs.newnode('region', attrs={ - 'position':(5.7, 0, -0.065), + 'position': (5.7, 0, -0.065), 'scale': (10.7, 0.001, 8), 'type': 'box', 'materials': [self._score_region_material] @@ -374,7 +357,7 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): bs.NodeActor( bs.newnode('region', attrs={ - 'position':(-5.7, 0, -0.065), + 'position': (-5.7, 0, -0.065), 'scale': (10.7, 0.001, 8), 'type': 'box', 'materials': [self._score_region_material] @@ -383,18 +366,20 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): self._chant_sound.play() if self.credit_text: t = bs.newnode('text', - attrs={ 'text':"Created by Freaku\nVolleyBall", ## Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely... - 'scale':0.7, - 'position':(0,0), - 'shadow':0.5, - 'flatness':1.2, - 'color':(1, 1, 1), - 'h_align':'center', - 'v_attach':'bottom'}) + attrs={'text': "Created by Freaku\nVolleyBall", # Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely... + 'scale': 0.7, + 'position': (0, 0), + 'shadow': 0.5, + 'flatness': 1.2, + 'color': (1, 1, 1), + 'h_align': 'center', + 'v_attach': 'bottom'}) shared = SharedObjects.get() - self.blocks.append(bs.NodeActor(bs.newnode('region',attrs={'position': (0,2.4,0),'scale': (0.8,6,20),'type': 'box','materials': (self._fake_wall_material, )}))) - - self.net_blocc.append(bs.NodeActor(bs.newnode('region',attrs={'position': (0,0,0),'scale': (0.6,2.4,20),'type': 'box','materials': (self._net_wall_material, )}))) + self.blocks.append(bs.NodeActor(bs.newnode('region', attrs={'position': (0, 2.4, 0), 'scale': ( + 0.8, 6, 20), 'type': 'box', 'materials': (self._fake_wall_material, )}))) + + self.net_blocc.append(bs.NodeActor(bs.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: self._update_scoreboard() @@ -434,18 +419,15 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): scoring_team = team team.score += 1 - - # Change puck Spawn - if team.id == 0: # left side scored - self._puck_spawn_pos= (5, 0.42, 0) - elif team.id == 1: # right side scored - self._puck_spawn_pos= (-5, 0.42, 0) - else: # normally shouldn't occur - self._puck_spawn_pos= (0, 0.42, 0) + if team.id == 0: # left side scored + self._puck_spawn_pos = (5, 0.42, 0) + elif team.id == 1: # right side scored + self._puck_spawn_pos = (-5, 0.42, 0) + else: # normally shouldn't occur + self._puck_spawn_pos = (0, 0.42, 0) # Easy pizzy - - + for player in team.players: if player.actor: player.actor.handlemessage(bs.CelebrateMessage(2.0)) @@ -469,10 +451,10 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): self._puck.scored = True # Kill the puck (it'll respawn itself shortly). - bs.emitfx(position= bs.getcollision().position, count=int(6.0 + 7.0 * 12), scale=3, spread=0.5, chunk_type='spark') + bs.emitfx(position=bs.getcollision().position, count=int( + 6.0 + 7.0 * 12), scale=3, spread=0.5, chunk_type='spark') bs.timer(0.7, self._kill_puck) - bs.cameraflash(duration=7.0) self._update_scoreboard() @@ -502,7 +484,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): spaz.bomb_count = 0 # Imagine not being able to swipe those colorful buttons ;( - if self._punchie_: spaz.connect_controls_to_player(enable_punch=False) @@ -525,7 +506,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): def _flash_puck_spawn(self) -> None: # Effect >>>>>> Flashly - bs.emitfx(position= self._puck_spawn_pos, count=int(6.0 + 7.0 * 12), scale=1.7, spread=0.4, chunk_type='spark') + bs.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: self._swipsound.play() @@ -535,45 +517,26 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]): self._puck = Puck(position=self._puck_spawn_pos) - - - - - - - - - - - - - - - - - - - - - class Pointzz: points, boxes = {}, {} 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) - 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) + ( - 42.09506485, 22.81173179, 29.76723155) + 42.09506485, 22.81173179, 29.76723155) + class PointzzforH: 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) + ( - 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['spawn2'] = (6.857415055, 0.03938567998, 0.0) + (1.0, 1.0, 3.0) - class VolleyBallMap(bs.Map): defs = Pointzz() name = "Open Field" @@ -595,47 +558,47 @@ class VolleyBallMap(bs.Map): 'tex': bs.gettexture('footballStadium') } return data - + def __init__(self): super().__init__() shared = SharedObjects.get() x = -5 - while x<5: - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,0,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.25,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.5,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.75,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,1,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) + while x < 5: + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 0, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .25, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .5, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .75, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 1, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) x = x + 0.5 y = -1 - while y>-11: - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,4), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,-4), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,4), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,-4), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - y-=1 + while y > -11: + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, 4), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, -4), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, 4), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, -4), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + y -= 1 z = 0 - while z<5: - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,z), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,-z), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,z), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,-z), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - z+=1 + while z < 5: + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, z), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, -z), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, z), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, -z), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + z += 1 self.node = bs.newnode( 'terrain', @@ -663,7 +626,6 @@ class VolleyBallMap(bs.Map): gnode.vr_near_clip = 0.5 - class VolleyBallMapH(bs.Map): defs = PointzzforH() name = 'Closed Arena' @@ -680,7 +642,7 @@ class VolleyBallMapH(bs.Map): def on_preload(cls) -> Any: data: Dict[str, Any] = { 'meshs': (bs.getmesh('hockeyStadiumOuter'), - bs.getmesh('hockeyStadiumInner')), + bs.getmesh('hockeyStadiumInner')), 'vr_fill_mesh': bs.getmesh('footballStadiumVRFill'), 'collision_mesh': bs.getcollisionmesh('hockeyStadiumCollide'), 'tex': bs.gettexture('hockeyStadium'), @@ -694,42 +656,42 @@ class VolleyBallMapH(bs.Map): super().__init__() shared = SharedObjects.get() x = -5 - while x<5: - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,0,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.25,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.5,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.75,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,1,x), - 'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) + while x < 5: + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 0, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .25, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .5, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .75, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 1, x), + 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) x = x + 0.5 y = -1 - while y>-11: - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,4), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,-4), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,4), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,-4), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - y-=1 + while y > -11: + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, 4), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, -4), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, 4), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, -4), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + y -= 1 z = 0 - while z<5: - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,z), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,-z), - 'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,z), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,-z), - 'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) - z+=1 + while z < 5: + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, z), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, -z), + 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, z), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, -z), + 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]}) + z += 1 self.node = bs.newnode('terrain', delegate=self, @@ -737,7 +699,8 @@ class VolleyBallMapH(bs.Map): 'mesh': None, 'collision_mesh': - bs.getcollisionmesh('footballStadiumCollide'), # we dont want Goalposts... + # we dont want Goalposts... + bs.getcollisionmesh('footballStadiumCollide'), 'color_texture': self.preloaddata['tex'], 'materials': [ @@ -758,7 +721,7 @@ class VolleyBallMapH(bs.Map): 'opacity': 0.92, 'opacity_in_low_or_medium_quality': 1.0, 'materials': mats, - 'color': (0.4,0.9,0) + 'color': (0.4, 0.9, 0) }) self.background = bs.newnode( @@ -767,7 +730,7 @@ class VolleyBallMapH(bs.Map): 'mesh': bs.getmesh('natureBackground'), 'lighting': False, 'background': True, - 'color': (0.5,0.30,0.4) + 'color': (0.5, 0.30, 0.4) }) gnode = bs.getactivity().globalsnode @@ -783,8 +746,6 @@ class VolleyBallMapH(bs.Map): #self.is_hockey = True - - bs._map.register_map(VolleyBallMap) bs._map.register_map(VolleyBallMapH) @@ -798,4 +759,4 @@ class byFreaku(babase.Plugin): # Then why not include function here? # On server upon first launch, plugins are not activated, # (same can be case for user if disabled auto-enable plugins) - pass \ No newline at end of file + pass diff --git a/plugins/utilities/floater.py b/plugins/utilities/floater.py index c05b3a5..28e943e 100644 --- a/plugins/utilities/floater.py +++ b/plugins/utilities/floater.py @@ -1,18 +1,20 @@ # Ported by your friend: Freaku -#Join BCS: +# Join BCS: # https://discord.gg/ucyaesh -#My GitHub: +# My GitHub: # https://github.com/Freaku17/BombSquad-Mods-byFreaku - # ba_meta require api 8 from __future__ import annotations from typing import TYPE_CHECKING -import _babase, babase, random, math +import _babase +import babase +import random +import math import bauiv1 as bui import bascenev1 as bs from bascenev1lib.gameutils import SharedObjects @@ -110,7 +112,8 @@ class Floater(bs.Actor): }) self.node.connectattr('position', self.node2, 'position') - def pop(self): PopupText(text="Ported by \ue048Freaku", scale=1.3, position=(self.node.position[0],self.node.position[1]-1,self.node.position[2]), color=(0,1,1)).autoretain() + def pop(self): PopupText(text="Ported by \ue048Freaku", scale=1.3, position=( + self.node.position[0], self.node.position[1]-1, self.node.position[2]), color=(0, 1, 1)).autoretain() def checkCanControl(self): if not self.node.exists(): @@ -186,7 +189,8 @@ class Floater(bs.Actor): np = self.node.position except: np = (0, 0, 0) - self.b = Bomb(bomb_type=random.choice(['normal', 'ice', 'sticky', 'impact', 'land_mine', 'tnt']), source_player=self.source_player, position=(np[0], np[1] - 1, np[2]), velocity=(0, -1, 0)).autoretain() + self.b = Bomb(bomb_type=random.choice(['normal', 'ice', 'sticky', 'impact', 'land_mine', 'tnt']), + source_player=self.source_player, position=(np[0], np[1] - 1, np[2]), velocity=(0, -1, 0)).autoretain() if self.b.bomb_type in ['impact', 'land_mine']: self.b.arm() @@ -198,7 +202,7 @@ class Floater(bs.Actor): pn = self.node.position dist = self.distance(pn[0], pn[1], pn[2], px, py, pz) self.node.velocity = ((px - pn[0]) / dist, (py - pn[1]) / dist, (pz - pn[2]) / dist) - bs.timer(dist-1, bs.WeakCall(self.move)) #suppress_format_warning=True) + bs.timer(dist-1, bs.WeakCall(self.move)) # suppress_format_warning=True) def handlemessage(self, msg): if isinstance(msg, bs.DieMessage): @@ -211,21 +215,21 @@ class Floater(bs.Actor): super().handlemessage(msg) - - - - def assignFloInputs(clientID: int): activity = bs.get_foreground_host_activity() with activity.context: if not hasattr(activity, 'flo') or not activity.flo.node.exists(): - try: activity.flo = Floater(activity.map.get_def_bound_box('map_bounds')) - except: return #Perhaps using in main-menu/score-screen + try: + activity.flo = Floater(activity.map.get_def_bound_box('map_bounds')) + except: + return # Perhaps using in main-menu/score-screen floater = activity.flo if floater.controlled: - bs.broadcastmessage('Floater is already being controlled', color=(1, 0, 0), transient=True, clients=[clientID]) + bs.broadcastmessage('Floater is already being controlled', + color=(1, 0, 0), transient=True, clients=[clientID]) return - bs.broadcastmessage('You Gained Control Over The Floater!\n Press Bomb to Throw Bombs and Punch to leave!', clients=[clientID], transient=True, color=(0, 1, 1)) + bs.broadcastmessage('You Gained Control Over The Floater!\n Press Bomb to Throw Bombs and Punch to leave!', clients=[ + clientID], transient=True, color=(0, 1, 1)) for i in activity.players: if i.sessionplayer.inputdevice.client_id == clientID: @@ -259,20 +263,32 @@ bui.set_party_icon_always_visible(True) old_piv = bui.set_party_icon_always_visible + + def new_piv(*args, **kwargs): # Do not let chat icon go away old_piv(True) + + bui.set_party_icon_always_visible = new_piv old_fcm = bs.chatmessage + + def new_chat_message(*args, **kwargs): old_fcm(*args, **kwargs) if args[0] == '/floater': - try: assignFloInputs(-1) - except: pass + try: + assignFloInputs(-1) + except: + pass + + bs.chatmessage = new_chat_message # ba_meta export plugin + + class byFreaku(babase.Plugin): - def __init__(self): pass \ No newline at end of file + def __init__(self): pass diff --git a/plugins/utilities/icons_keyboard.py b/plugins/utilities/icons_keyboard.py index bbb48ab..7447660 100644 --- a/plugins/utilities/icons_keyboard.py +++ b/plugins/utilities/icons_keyboard.py @@ -6,8 +6,6 @@ # Double tap the space to change between keyboards... - - # ba_meta require api 8 from __future__ import annotations @@ -19,12 +17,7 @@ import bascenev1 as bs from babase import charstr as uwu if TYPE_CHECKING: - from typing import Any, Optional, Dict, List, Tuple,Type, Iterable - - - - - + from typing import Any, Optional, Dict, List, Tuple, Type, Iterable # ba_meta export keyboard @@ -32,33 +25,33 @@ class IconKeyboard_byFreaku(babase.Keyboard): """Keyboard go brrrrrrr""" name = 'Icons by \ue048Freaku' chars = [(uwu(babase.SpecialChar.TICKET), - uwu(babase.SpecialChar.CROWN), - uwu(babase.SpecialChar.DRAGON), - uwu(babase.SpecialChar.SKULL), - uwu(babase.SpecialChar.HEART), - uwu(babase.SpecialChar.FEDORA), - uwu(babase.SpecialChar.HAL), - uwu(babase.SpecialChar.YIN_YANG), - uwu(babase.SpecialChar.EYE_BALL), - uwu(babase.SpecialChar.HELMET), - uwu(babase.SpecialChar.OUYA_BUTTON_U)), - (uwu(babase.SpecialChar.MUSHROOM), - uwu(babase.SpecialChar.NINJA_STAR), - uwu(babase.SpecialChar.VIKING_HELMET), - uwu(babase.SpecialChar.MOON), - uwu(babase.SpecialChar.SPIDER), - uwu(babase.SpecialChar.FIREBALL), - uwu(babase.SpecialChar.MIKIROG), - uwu(babase.SpecialChar.OUYA_BUTTON_O), - uwu(babase.SpecialChar.LOCAL_ACCOUNT), - uwu(babase.SpecialChar.LOGO)), - (uwu(babase.SpecialChar.TICKET), - uwu(babase.SpecialChar.FLAG_INDIA), - uwu(babase.SpecialChar.OCULUS_LOGO), - uwu(babase.SpecialChar.STEAM_LOGO), - uwu(babase.SpecialChar.NVIDIA_LOGO), - uwu(babase.SpecialChar.GAME_CENTER_LOGO), - uwu(babase.SpecialChar.GOOGLE_PLAY_GAMES_LOGO), - uwu(babase.SpecialChar.EXPLODINARY_LOGO))] + uwu(babase.SpecialChar.CROWN), + uwu(babase.SpecialChar.DRAGON), + uwu(babase.SpecialChar.SKULL), + uwu(babase.SpecialChar.HEART), + uwu(babase.SpecialChar.FEDORA), + uwu(babase.SpecialChar.HAL), + uwu(babase.SpecialChar.YIN_YANG), + uwu(babase.SpecialChar.EYE_BALL), + uwu(babase.SpecialChar.HELMET), + uwu(babase.SpecialChar.OUYA_BUTTON_U)), + (uwu(babase.SpecialChar.MUSHROOM), + uwu(babase.SpecialChar.NINJA_STAR), + uwu(babase.SpecialChar.VIKING_HELMET), + uwu(babase.SpecialChar.MOON), + uwu(babase.SpecialChar.SPIDER), + uwu(babase.SpecialChar.FIREBALL), + uwu(babase.SpecialChar.MIKIROG), + uwu(babase.SpecialChar.OUYA_BUTTON_O), + uwu(babase.SpecialChar.LOCAL_ACCOUNT), + uwu(babase.SpecialChar.LOGO)), + (uwu(babase.SpecialChar.TICKET), + uwu(babase.SpecialChar.FLAG_INDIA), + uwu(babase.SpecialChar.OCULUS_LOGO), + uwu(babase.SpecialChar.STEAM_LOGO), + uwu(babase.SpecialChar.NVIDIA_LOGO), + uwu(babase.SpecialChar.GAME_CENTER_LOGO), + uwu(babase.SpecialChar.GOOGLE_PLAY_GAMES_LOGO), + uwu(babase.SpecialChar.EXPLODINARY_LOGO))] nums = [] - pages: Dict[str, Tuple[str, ...]] = {} \ No newline at end of file + pages: Dict[str, Tuple[str, ...]] = {} diff --git a/plugins/utilities/unlock_TowerD.py b/plugins/utilities/unlock_TowerD.py index 6a219f1..172e8c0 100644 --- a/plugins/utilities/unlock_TowerD.py +++ b/plugins/utilities/unlock_TowerD.py @@ -16,4 +16,4 @@ def new_play_types(cls): # ba_meta export plugin class byFreaku(babase.Plugin): def on_app_running(self): - TowerD.get_play_types = new_play_types \ No newline at end of file + TowerD.get_play_types = new_play_types