[ci] auto-format

This commit is contained in:
Freaku17 2023-07-28 11:37:09 +00:00 committed by github-actions[bot]
parent 3f65846527
commit 7dcf3c711e
9 changed files with 553 additions and 564 deletions

View file

@ -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
@ -49,16 +47,18 @@ class State:
return (self.name)
states = [ State(bomb='normal', name='Basic Bombs'),
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) ]
State(curse=True, name='Cursed', final=True)]
class Player(bs.Player['Team']):
"""Our player type for this game."""
def __init__(self):
self.state = None

View file

@ -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)))
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)))

View file

@ -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')
@ -196,10 +192,10 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._image = bs.newnode('image',
attrs={'texture': self._imageTextDefault,
'position':(0,-100),
'scale':(100,100),
'position': (0, -100),
'scale': (100, 100),
'opacity': 0.0,
'attach':'topCenter'})
'attach': 'topCenter'})
self._textCounter = bs.newnode('text',
attrs={'text': '10',
@ -229,26 +225,25 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._imageCircle = bs.newnode('image',
attrs={'texture': self._circleTex,
'position': (75, -75),
'scale': (20,20),
'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),
'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),
'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()
self._bellLow = bs.getsound('bellLow')
@ -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():
@ -367,7 +363,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
bs.broadcastmessage(
babase.Lstr(resource='playerDelayedJoinText',
subs=[('${PLAYER}', player.getname(full=True))]),
color=(0, 1, 0),transient=True,clients=[player.sessionplayer.inputdevice.client_id])
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
@ -399,13 +396,13 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._textureSelected = random.choice([self._mapFGIceTex,
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._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,
@ -436,6 +433,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
def _stop(self):
self._textureSelected = self._randomSelect()
def circle():
def circle2():
def circle3():
@ -455,7 +453,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
def _randomPlatform(self):
if self._levelStage == 1:
randomTexture=[self._mapFGMinesTex,
randomTexture = [self._mapFGMinesTex,
self._mapFGMinesTex,
self._mapFGMinesTex,
self._mapFGMinesTex,
@ -472,7 +470,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._mapFGStickyTex,
self._mapFGStickyTex]
elif self._levelStage == 2:
randomTexture=[self._mapFGIceTex,
randomTexture = [self._mapFGIceTex,
self._mapFGIceTex,
self._mapFGIceTex,
self._mapFGIceTex,
@ -488,8 +486,8 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._mapFGShieldTex,
self._mapFGShieldTex,
self._mapFGShieldTex]
elif self._levelStage in [3,4,5]:
randomTexture=[self._mapFGStickyTex,
elif self._levelStage in [3, 4, 5]:
randomTexture = [self._mapFGStickyTex,
self._mapFGStickyTex,
self._mapFGStickyTex,
self._mapFGStickyTex,
@ -505,8 +503,8 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._mapFGMinesTex,
self._mapFGMinesTex,
self._mapFGMinesTex]
elif self._levelStage in [6,7,8,9]:
randomTexture=[self._mapFGHealthTex,
elif self._levelStage in [6, 7, 8, 9]:
randomTexture = [self._mapFGHealthTex,
self._mapFGShieldTex,
self._mapFGCurseTex,
self._mapFGCurseTex,
@ -523,7 +521,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self._mapFGShieldTex,
self._mapFGShieldTex]
elif self._levelStage >= 10:
randomTexture=[self._mapFGSpaz,
randomTexture = [self._mapFGSpaz,
self._mapFGZoe,
self._mapFGSnake,
self._mapFGKronk,
@ -544,7 +542,7 @@ class MGgame(bs.TeamGameActivity[Player, Team]):
self.mapFGP3Tex, self.mapFGP4Tex,
self.mapFGP5Tex, self.mapFGP6Tex,
self.mapFGP7Tex, self.mapFGP8Tex,
self.mapFGP9Tex,self.mapFGP10Tex,
self.mapFGP9Tex, self.mapFGP10Tex,
self.mapFGP11Tex, self.mapFGP12Tex,
self.mapFGP13Tex, self.mapFGP14Tex,
self.mapFGP15Tex, self.mapFGP16Tex) = (
@ -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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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]})
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'))
babase.app.classic.add_coop_practice_level(bs.Level(
name='Memory Game', displayname='${GAME}', gametype=MGgame, settings={}, preview_texture_name='achievementOffYouGo'))

View file

@ -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
@ -89,7 +89,7 @@ class MFGame(bs.TeamGameActivity[Player, Team]):
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)})
'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
@ -232,9 +243,9 @@ class MFGame(bs.TeamGameActivity[Player, Team]):
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})
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:

View file

@ -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."""
@ -104,10 +90,9 @@ class Puck(bs.Actor):
# 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
@ -254,9 +240,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
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=(
@ -271,12 +256,12 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
self._wall_material.add_actions(
conditions=(('we_are_younger_than', 100),
'and',
('they_have_material',shared.object_material)),
('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),
))
@ -294,10 +279,9 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
('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=(
@ -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.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.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)
self._puck_spawn_pos = (5, 0.42, 0)
elif team.id == 1: # right side scored
self._puck_spawn_pos= (-5, 0.42, 0)
self._puck_spawn_pos = (-5, 0.42, 0)
else: # normally shouldn't occur
self._puck_spawn_pos= (0, 0.42, 0)
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)
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)
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"
@ -600,42 +563,42 @@ class VolleyBallMap(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',
@ -663,7 +626,6 @@ class VolleyBallMap(bs.Map):
gnode.vr_near_clip = 0.5
class VolleyBallMapH(bs.Map):
defs = PointzzforH()
name = 'Closed Arena'
@ -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)

View file

@ -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

View file

@ -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