Rename & update volley_ball.py for 1.7.37+ (API 9)

• Removed base64 encoded text (trusting the community that they won't change the name & steal credits)
• Properly formatted for readability
This commit is contained in:
! Freaku 2025-02-08 11:16:39 +05:30 committed by GitHub
parent 24d1fad594
commit 98304c6db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
# ba_meta require api 9
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."""
@ -107,7 +93,6 @@ class Puck(bs.Actor):
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,7 +240,6 @@ 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.add_actions(
@ -296,7 +281,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
))
self.blocks = []
self._net_wall_material = bs.Material()
self._net_wall_material.add_actions(
conditions=('they_have_material', shared.player_material),
@ -323,7 +307,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
))
self.net_blocc = []
self._puck_spawn_pos: Optional[Sequence[float]] = None
self._score_regions: Optional[List[bs.NodeActor]] = None
self._puck: Optional[Puck] = None
@ -381,12 +364,22 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
})))
self._update_scoreboard()
self._chant_sound.play()
import base64
exec(base64.b64decode("aWYgc2VsZi5jcmVkaXRfdGV4dDoKICAgICMjIFBlb3BsZSBzdGVhbGVkIGNyZWRpdHMgc28gdGhhdHMgd2h5IEkgZW5jb2RlZCB0aGlzLi4uCiAgICAjIyBFdmVuIHRobyB0aGVyZSBpcyBhIG9wdGlvbiwgdGhleSBjaGFuZ2VkIGNyZWF0ZWQgYnkKICAgICMjIGxpa2Ugd3RmIGlzIHRoaWVyIHByb2JsZW0/PwogICAgCiAgICAjIyBBbnl3YXlzIGhhdmUgYSBnb29kIGRheSEKICAgIHQgPSBicy5uZXdub2RlKCd0ZXh0JywKICAgICAgICAgICAgICAgYXR0cnM9eyAndGV4dCc6IkNyZWF0ZWQgYnkg7oGIRnJlYWt1XG5Wb2xsZXlCYWxsIiwgIyMgRGlzYWJsZSAnRW5hYmxlIEJvdHRvbSBDcmVkaXRzJyB3aGVuIG1ha2luZyBwbGF5bGlzdCwgTm8gbmVlZCB0byBlZGl0IHRoaXMgbG92ZWx5Li4uCiAgICAgICAgJ3NjYWxlJzowLjcsCiAgICAgICAgJ3Bvc2l0aW9uJzooMCwwKSwgI0xldHMgaG9wZSBoZSB1c2VzIFRWIGJvcmRlciBvZiBzZXR0aW5ncz5HcmFwaGljcwogICAgICAgICdzaGFkb3cnOjAuNSwKICAgICAgICAnZmxhdG5lc3MnOjEuMiwKICAgICAgICAnY29sb3InOigxLCAxLCAxKSwKICAgICAgICAnaF9hbGlnbic6J2NlbnRlcicsCiAgICAgICAgJ3ZfYXR0YWNoJzonYm90dG9tJ30p").decode('UTF-8'))
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'})
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()
@ -426,8 +419,6 @@ 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)
@ -437,7 +428,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
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))
@ -461,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()
@ -494,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)
@ -517,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()
@ -527,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"
@ -655,7 +626,6 @@ class VolleyBallMap(bs.Map):
gnode.vr_near_clip = 0.5
class VolleyBallMapH(bs.Map):
defs = PointzzforH()
name = 'Closed Arena'
@ -729,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': [
@ -775,8 +746,6 @@ class VolleyBallMapH(bs.Map):
# self.is_hockey = True
bs._map.register_map(VolleyBallMap)
bs._map.register_map(VolleyBallMapH)