mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2026-08-15 13:03:08 +00:00
[ci] apply-plugin-metadata-and-formatting
This commit is contained in:
parent
9a74e81ec7
commit
576a9c0304
2 changed files with 135 additions and 129 deletions
|
|
@ -1663,6 +1663,20 @@
|
|||
"md5sum": "33e6b93420cf6115e992aca534d76bfd"
|
||||
}
|
||||
}
|
||||
},
|
||||
"volley_punch": {
|
||||
"description": "Have fun with your friends in this new volley game !",
|
||||
"external_url": "https://github.com/Scriptz1/Learn.py-Installer/blob/main/volleypunch.py",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Learn.py",
|
||||
"email": "phillipians36@gmail.com",
|
||||
"discord": "Learning .py"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"1.0.0": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,8 +10,10 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import babase, _babase
|
||||
import math, random
|
||||
import babase
|
||||
import _babase
|
||||
import math
|
||||
import random
|
||||
import bascenev1 as bs
|
||||
import bauiv1 as bui
|
||||
import math
|
||||
|
|
@ -37,6 +39,7 @@ plugman = dict(
|
|||
version="1.0.0",
|
||||
)
|
||||
|
||||
|
||||
class PuckDiedMessage:
|
||||
"""Inform something that a puck has died."""
|
||||
|
||||
|
|
@ -78,9 +81,6 @@ class Puck(bs.Actor):
|
|||
'materials': pmats
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
def handlemessage(self, msg: Any) -> Any:
|
||||
if isinstance(msg, bs.DieMessage):
|
||||
assert self.node
|
||||
|
|
@ -263,9 +263,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
'friction', -10),
|
||||
('call', 'at_connect', self.slow_down)))
|
||||
|
||||
|
||||
|
||||
|
||||
self._puck_spawn_pos: Optional[Sequence[float]] = None
|
||||
self._score_regions: Optional[List[bs.NodeActor]] = None
|
||||
self._puck: Optional[Puck] = None
|
||||
|
|
@ -274,12 +271,10 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
self.credit_text = bool(settings['Enable Credits']) # i did the freaku credit thing
|
||||
self._epic_mode = bool(settings['Epic Mode'])
|
||||
|
||||
|
||||
# the ball is too fast for the players and the map is soo huge its a good poc - brostos
|
||||
self.ball_size = float(settings['Ball size (m)'])
|
||||
self.ball_speed = float(settings['Ball Average Speed'])
|
||||
|
||||
|
||||
# Base class overrides.
|
||||
self.slow_motion = self._epic_mode
|
||||
self.default_music = (bs.MusicType.EPIC if self._epic_mode else
|
||||
|
|
@ -364,8 +359,10 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
h_attach='center',
|
||||
v_attach='top',
|
||||
))
|
||||
bs.animate_array(self.guide, 'color',4, {0: (1,1,1,0.5), 1: (1,1,1,1), 2: (1,1,1,0.5)}, loop=True)
|
||||
self.interactions_timer = bs.Timer(1 / 120, self.interactions, repeat=True) # time, function, repeat
|
||||
bs.animate_array(self.guide, 'color', 4, {0: (1, 1, 1, 0.5), 1: (
|
||||
1, 1, 1, 1), 2: (1, 1, 1, 0.5)}, loop=True)
|
||||
self.interactions_timer = bs.Timer(
|
||||
1 / 120, self.interactions, repeat=True) # time, function, repeat
|
||||
self._score_regions.append(
|
||||
bs.NodeActor(
|
||||
bs.newnode('region',
|
||||
|
|
@ -419,7 +416,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
},
|
||||
)
|
||||
|
||||
|
||||
self.s.append(bs.NodeActor(bs.newnode('region', attrs={'position': (0, 2.4, 0), 'scale': (
|
||||
0.8, 6, 20), 'type': 'box', 'materials': (self._fake_wall_material, )})))
|
||||
|
||||
|
|
@ -468,7 +464,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
if self.commentary_text.exists():
|
||||
self.commentary_text.text = text[:index]
|
||||
|
||||
self._timers.append(bs.Timer(0.9 + 3.0 + (0.015 * (total_chars - i)), hide, repeat=False))
|
||||
self._timers.append(
|
||||
bs.Timer(0.9 + 3.0 + (0.015 * (total_chars - i)), hide, repeat=False))
|
||||
|
||||
start_clear()
|
||||
|
||||
|
|
@ -476,7 +473,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
"""Aesthetic reasons."""
|
||||
glb = bs.getactivity().globalsnode
|
||||
base_color = (0.57, 0.57, 0.57)
|
||||
bs.animate_array(glb, 'vignette_outer', 3, {0: base_color, 0.1: (final_color[0] / 1.2, final_color[1] / 1.2, final_color[2] / 1.2), (1 if longer else 0.5): base_color})
|
||||
bs.animate_array(glb, 'vignette_outer', 3, {0: base_color, 0.1: (
|
||||
final_color[0] / 1.2, final_color[1] / 1.2, final_color[2] / 1.2), (1 if longer else 0.5): base_color})
|
||||
|
||||
def interactions(self):
|
||||
"""Some personalized stuff and my deepest secrets.
|
||||
|
|
@ -686,8 +684,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
v_attach='top',
|
||||
))
|
||||
|
||||
|
||||
|
||||
everything = bs.getnodes()
|
||||
everyone = []
|
||||
closest_distance = 9999
|
||||
|
|
@ -696,7 +692,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
# i won't explain what "curve" is... look by yourself
|
||||
if not self.curve and not self._puck.scored:
|
||||
if bs.time() < self.smashed:
|
||||
random_pos = (random.uniform(0.1, 0.7) + self._puck.node.position[0],self._puck.node.position[1],random.uniform(0.1, 0.7) + self._puck.node.position[2])
|
||||
random_pos = (random.uniform(
|
||||
0.1, 0.7) + self._puck.node.position[0], self._puck.node.position[1], random.uniform(0.1, 0.7) + self._puck.node.position[2])
|
||||
e = bs.newnode(
|
||||
'explosion',
|
||||
attrs={
|
||||
|
|
@ -750,8 +747,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
if not player_node.exists(): # why wouldn't u exist at first
|
||||
continue
|
||||
|
||||
|
||||
distance = math.dist(player_node.position, self._puck.node.position) # not wanting to do that Euclidean thingy
|
||||
# not wanting to do that Euclidean thingy
|
||||
distance = math.dist(player_node.position, self._puck.node.position)
|
||||
player_node.hold_node = None
|
||||
player_node.getdelegate(object).impact_scale = 0
|
||||
if distance < closest_distance:
|
||||
|
|
@ -763,10 +760,10 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
not self._puck.scored)
|
||||
# bs.time() is the current bombsquad time :) bs for bombsquad.
|
||||
|
||||
|
||||
delegate = closest_player.getdelegate(object)
|
||||
now = bs.time()
|
||||
can_jump = (delegate.last_jump_time_ms > delegate._jump_cooldown and closest_player.position[1] < 1)
|
||||
can_jump = (delegate.last_jump_time_ms >
|
||||
delegate._jump_cooldown and closest_player.position[1] < 1)
|
||||
|
||||
if closest_player.jump_pressed and can_jump:
|
||||
ppos = closest_player.position
|
||||
|
|
@ -782,19 +779,19 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
50, # small force
|
||||
)
|
||||
|
||||
|
||||
punched = now < delegate.punched
|
||||
pickup = now < delegate.pickup
|
||||
bombed = now < delegate.bombed
|
||||
curved = now < delegate.curved
|
||||
|
||||
|
||||
if closest_player and closest_distance < 4 and good: # SO if broski is the nearest AND broski is near enough...
|
||||
# SO if broski is the nearest AND broski is near enough...
|
||||
if closest_player and closest_distance < 4 and good:
|
||||
player = spaz = delegate
|
||||
ball = self._puck.node # ball node
|
||||
you = closest_player.position # already a node
|
||||
in_air = (you[1] > 0.8)
|
||||
if closest_distance < (1.35 if not in_air else 1.6) and (closest_player.punch_pressed or punched): # Ball goes where you look but always tries to go to the other side. (tell me if u guys want it to go totally where you're looking at)
|
||||
# Ball goes where you look but always tries to go to the other side. (tell me if u guys want it to go totally where you're looking at)
|
||||
if closest_distance < (1.35 if not in_air else 1.6) and (closest_player.punch_pressed or punched):
|
||||
self.difficulty += 0.6 / 75
|
||||
e = bs.newnode(
|
||||
'explosion',
|
||||
|
|
@ -819,11 +816,11 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
self.one_sound.play()
|
||||
else:
|
||||
ball.color_texture = green
|
||||
bs.getsound("impactHard").play() # This is for the sound, you probably didn't know that!
|
||||
# This is for the sound, you probably didn't know that!
|
||||
bs.getsound("impactHard").play()
|
||||
|
||||
|
||||
|
||||
sight = (bs.Vec3(you) - bs.Vec3(closest_player.position_forward)).normalized() * (12 if delegate.percentage < 95 else 30) # Sight factor
|
||||
sight = (bs.Vec3(you) - bs.Vec3(closest_player.position_forward)
|
||||
).normalized() * (12 if delegate.percentage < 95 else 30) # Sight factor
|
||||
speed = 6 if delegate.percentage < 95 else 20 # bar full
|
||||
|
||||
if curved:
|
||||
|
|
@ -838,10 +835,12 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
z_offset = -4.0 if sight[0] < 0 else 4.0
|
||||
|
||||
def move_to_point(step):
|
||||
if not ball.exists(): return
|
||||
if ball.position[1] < 1 and bs.time() > curved_time: return
|
||||
if not self.curving: return
|
||||
|
||||
if not ball.exists():
|
||||
return
|
||||
if ball.position[1] < 1 and bs.time() > curved_time:
|
||||
return
|
||||
if not self.curving:
|
||||
return
|
||||
|
||||
t = step / total_steps
|
||||
|
||||
|
|
@ -887,7 +886,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
|
||||
ball.velocity = (vel[0], height, vel[2])
|
||||
if in_air and delegate.percentage > 95:
|
||||
audio = random.choice(['explosion01','explosion02','explosion03','explosion04','explosion05'])
|
||||
audio = random.choice(['explosion01', 'explosion02',
|
||||
'explosion03', 'explosion04', 'explosion05'])
|
||||
bs.getsound(audio).play()
|
||||
self.smashed = bs.time() + 1
|
||||
self.smasher = closest_player
|
||||
|
|
@ -913,7 +913,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
f[2],
|
||||
400, # small force
|
||||
)
|
||||
if closest_distance < 1.35 and (closest_player.pickup_pressed or pickup): # Ball goes straight up in the air. idk what it is called.
|
||||
# Ball goes straight up in the air. idk what it is called.
|
||||
if closest_distance < 1.35 and (closest_player.pickup_pressed or pickup):
|
||||
self.write(
|
||||
f'{player.name} {self.control_text}', closest_player.color)
|
||||
y_diff = abs(self._puck.node.position[1] - closest_player.position[1])
|
||||
|
|
@ -923,7 +924,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
self.last_interaction_time = bs.time()
|
||||
self.curve = False
|
||||
|
||||
|
||||
self._puck.touches += 1
|
||||
|
||||
ball = self._puck.node
|
||||
|
|
@ -951,7 +951,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
)
|
||||
bs.timer(1, e.delete)
|
||||
|
||||
direction = (bs.Vec3(you) - bs.Vec3(closest_player.position_forward)).normalized()
|
||||
direction = (bs.Vec3(you) -
|
||||
bs.Vec3(closest_player.position_forward)).normalized()
|
||||
ball.velocity = (-you[0] * 0.04, 12.8, direction[2] * 0.1)
|
||||
if closest_player.bomb_pressed and not delegate.gliding or bombed and not delegate.gliding: # gliding.. variant coming soon
|
||||
self.write(
|
||||
|
|
@ -989,12 +990,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
|
||||
# variant soon
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def on_team_join(self, team: Team) -> None:
|
||||
self._update_scoreboard()
|
||||
|
||||
|
|
@ -1084,7 +1079,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
self._puck.scored = True
|
||||
|
||||
# Kill the puck (it'll respawn itself shortly).
|
||||
bs.animate(self._puck.node, 'mesh_scale', {0: 0.25, 0.4 : 0}) # Animation ! 0 sec = 0.25 of size in our case
|
||||
# Animation ! 0 sec = 0.25 of size in our case
|
||||
bs.animate(self._puck.node, 'mesh_scale', {0: 0.25, 0.4: 0})
|
||||
bs.timer(0.7, self._kill_puck)
|
||||
|
||||
bs.cameraflash(duration=7.0)
|
||||
|
|
@ -1122,7 +1118,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
|
||||
spaz.can_curve = False
|
||||
|
||||
|
||||
spaz.last_angle = 0
|
||||
spaz.total_rotation = 0.0
|
||||
spaz.rotation_direction = 0 # 0: neutre, 1: clockwise, -1: not clockwise
|
||||
|
|
@ -1164,7 +1159,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
else:
|
||||
spaz.node.name = ''
|
||||
|
||||
|
||||
spaz.bar.hurt = min(1.0 - float(spaz.percentage) / 100, 1)
|
||||
|
||||
# Curved ball part
|
||||
|
|
@ -1188,8 +1182,10 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
current_angle = spaz.angle
|
||||
|
||||
delta = current_angle - spaz.last_angle
|
||||
if delta > 180: delta -= 360
|
||||
if delta < -180: delta += 360
|
||||
if delta > 180:
|
||||
delta -= 360
|
||||
if delta < -180:
|
||||
delta += 360
|
||||
|
||||
current_dir = 1 if delta > 0 else -1
|
||||
|
||||
|
|
@ -1206,9 +1202,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
|
||||
spaz.last_angle = current_angle
|
||||
|
||||
|
||||
|
||||
|
||||
spaz.check_timer1 = bs.Timer(1/30, check, repeat=True)
|
||||
# spaz.check_timer2 = bs.Timer(1/30, check_270_rotation, repeat=True)
|
||||
|
||||
|
|
@ -1236,13 +1229,13 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
|
|||
else:
|
||||
super().handlemessage(msg)
|
||||
|
||||
|
||||
def _spawn_puck(self) -> None:
|
||||
self._swipsound.play()
|
||||
self._whistle_sound.play()
|
||||
assert self._puck_spawn_pos is not None
|
||||
self._puck = Puck(position=self._puck_spawn_pos)
|
||||
self.timer = bs.Timer(1 / 144, self.lock_it, repeat=True) # 144 ?.. yes
|
||||
|
||||
def lock_it(self):
|
||||
if self._puck is None:
|
||||
return
|
||||
|
|
@ -1297,5 +1290,4 @@ class ModInstaller:
|
|||
bui.screenmessage("Installation Failed!", color=(1, 0, 0))
|
||||
bui.getsound('kronk2').play()
|
||||
|
||||
|
||||
bs.apptimer(2.5, _do_install)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue