mirror of
https://github.com/Freaku17/BombSquad-Mods-byFreaku
synced 2025-10-19 20:20:40 +00:00
Update ALL UTILITIES for 1.7.20+
This commit is contained in:
parent
07d6968898
commit
7c72e45a01
3 changed files with 102 additions and 78 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#Ported by: Freaku / @[Just] Freak#4999
|
# Ported by your friend: Freaku
|
||||||
|
|
||||||
#Join BCS:
|
#Join BCS:
|
||||||
# https://discord.gg/ucyaesh
|
# https://discord.gg/ucyaesh
|
||||||
|
|
@ -9,24 +9,27 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ba_meta require api 7
|
# ba_meta require api 8
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
import _ba,ba,random,math
|
import _babase, babase, random, math
|
||||||
from bastd.gameutils import SharedObjects
|
import bauiv1 as bui
|
||||||
from bastd.actor.bomb import Bomb
|
import bascenev1 as bs
|
||||||
from bastd.actor.popuptext import PopupText
|
from bascenev1lib.gameutils import SharedObjects
|
||||||
|
from bascenev1lib.actor.bomb import Bomb
|
||||||
|
from bascenev1lib.actor.popuptext import PopupText
|
||||||
|
from bauiv1lib.party import PartyWindow
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
class Floater(ba.Actor):
|
class Floater(bs.Actor):
|
||||||
def __init__(self, bounds):
|
def __init__(self, bounds):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
shared = SharedObjects.get()
|
shared = SharedObjects.get()
|
||||||
self.controlled = False
|
self.controlled = False
|
||||||
self.source_player = None
|
self.source_player = None
|
||||||
self.floaterMaterial = ba.Material()
|
self.floaterMaterial = bs.Material()
|
||||||
self.floaterMaterial.add_actions(
|
self.floaterMaterial.add_actions(
|
||||||
conditions=('they_have_material',
|
conditions=('they_have_material',
|
||||||
shared.player_material),
|
shared.player_material),
|
||||||
|
|
@ -46,21 +49,21 @@ class Floater(ba.Actor):
|
||||||
self.py = "random.uniform(self.pos[1],self.pos[4])"
|
self.py = "random.uniform(self.pos[1],self.pos[4])"
|
||||||
self.pz = "random.uniform(self.pos[2],self.pos[5])"
|
self.pz = "random.uniform(self.pos[2],self.pos[5])"
|
||||||
|
|
||||||
self.node = ba.newnode(
|
self.node = bs.newnode(
|
||||||
'prop',
|
'prop',
|
||||||
delegate=self,
|
delegate=self,
|
||||||
owner=None,
|
owner=None,
|
||||||
attrs={
|
attrs={
|
||||||
'position': (eval(self.px), eval(self.py), eval(self.pz)),
|
'position': (eval(self.px), eval(self.py), eval(self.pz)),
|
||||||
'model':
|
'mesh':
|
||||||
ba.getmodel('landMine'),
|
bs.getmesh('landMine'),
|
||||||
'light_model':
|
'light_mesh':
|
||||||
ba.getmodel('landMine'),
|
bs.getmesh('landMine'),
|
||||||
'body':
|
'body':
|
||||||
'landMine',
|
'landMine',
|
||||||
'body_scale':
|
'body_scale':
|
||||||
3,
|
3,
|
||||||
'model_scale':
|
'mesh_scale':
|
||||||
3.1,
|
3.1,
|
||||||
'shadow_size':
|
'shadow_size':
|
||||||
0.25,
|
0.25,
|
||||||
|
|
@ -69,21 +72,21 @@ class Floater(ba.Actor):
|
||||||
'gravity_scale':
|
'gravity_scale':
|
||||||
0.0,
|
0.0,
|
||||||
'color_texture':
|
'color_texture':
|
||||||
ba.gettexture('achievementFlawlessVictory'),
|
bs.gettexture('achievementFlawlessVictory'),
|
||||||
'reflection':
|
'reflection':
|
||||||
'soft',
|
'soft',
|
||||||
'reflection_scale': [0.25],
|
'reflection_scale': [0.25],
|
||||||
'materials':
|
'materials':
|
||||||
[shared.footing_material, self.floaterMaterial]
|
[shared.footing_material, self.floaterMaterial]
|
||||||
})
|
})
|
||||||
self.node2 = ba.newnode(
|
self.node2 = bs.newnode(
|
||||||
'prop',
|
'prop',
|
||||||
owner=self.node,
|
owner=self.node,
|
||||||
attrs={
|
attrs={
|
||||||
'position': (0, 0, 0),
|
'position': (0, 0, 0),
|
||||||
'body':
|
'body':
|
||||||
'sphere',
|
'sphere',
|
||||||
'model':
|
'mesh':
|
||||||
None,
|
None,
|
||||||
'color_texture':
|
'color_texture':
|
||||||
None,
|
None,
|
||||||
|
|
@ -94,7 +97,7 @@ class Floater(ba.Actor):
|
||||||
'density':
|
'density':
|
||||||
999999,
|
999999,
|
||||||
'reflection_scale': [1.0],
|
'reflection_scale': [1.0],
|
||||||
'model_scale':
|
'mesh_scale':
|
||||||
1.0,
|
1.0,
|
||||||
'gravity_scale':
|
'gravity_scale':
|
||||||
0,
|
0,
|
||||||
|
|
@ -170,7 +173,7 @@ class Floater(ba.Actor):
|
||||||
if self.source_player is None:
|
if self.source_player is None:
|
||||||
return
|
return
|
||||||
if self.source_player.is_alive():
|
if self.source_player.is_alive():
|
||||||
ba.timer(1, self.checkPlayerDie)
|
bs.timer(1, self.checkPlayerDie)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.dis()
|
self.dis()
|
||||||
|
|
@ -196,15 +199,15 @@ class Floater(ba.Actor):
|
||||||
pn = self.node.position
|
pn = self.node.position
|
||||||
dist = self.distance(pn[0], pn[1], pn[2], px, py, pz)
|
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)
|
self.node.velocity = ((px - pn[0]) / dist, (py - pn[1]) / dist, (pz - pn[2]) / dist)
|
||||||
ba.timer(dist-1, ba.WeakCall(self.move), suppress_format_warning=True)
|
bs.timer(dist-1, bs.WeakCall(self.move)) #suppress_format_warning=True)
|
||||||
|
|
||||||
def handlemessage(self, msg):
|
def handlemessage(self, msg):
|
||||||
if isinstance(msg, ba.DieMessage):
|
if isinstance(msg, bs.DieMessage):
|
||||||
self.node.delete()
|
self.node.delete()
|
||||||
self.node2.delete()
|
self.node2.delete()
|
||||||
self.controlled = False
|
self.controlled = False
|
||||||
elif isinstance(msg, ba.OutOfBoundsMessage):
|
elif isinstance(msg, bs.OutOfBoundsMessage):
|
||||||
self.handlemessage(ba.DieMessage())
|
self.handlemessage(bs.DieMessage())
|
||||||
else:
|
else:
|
||||||
super().handlemessage(msg)
|
super().handlemessage(msg)
|
||||||
|
|
||||||
|
|
@ -214,18 +217,18 @@ class Floater(ba.Actor):
|
||||||
|
|
||||||
|
|
||||||
def assignFloInputs(clientID: int):
|
def assignFloInputs(clientID: int):
|
||||||
with ba.Context(_ba.get_foreground_host_activity()):
|
activity = bs.get_foreground_host_activity()
|
||||||
activity = ba.getactivity()
|
with activity.context:
|
||||||
if not hasattr(activity, 'flo') or not activity.flo.node.exists():
|
if not hasattr(activity, 'flo') or not activity.flo.node.exists():
|
||||||
try: activity.flo = Floater(activity.map.get_def_bound_box('map_bounds'))
|
try: activity.flo = Floater(activity.map.get_def_bound_box('map_bounds'))
|
||||||
except: return #Perhaps using in main-menu/score-screen
|
except: return #Perhaps using in main-menu/score-screen
|
||||||
floater = activity.flo
|
floater = activity.flo
|
||||||
if floater.controlled:
|
if floater.controlled:
|
||||||
ba.screenmessage('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
|
return
|
||||||
ba.screenmessage('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 _ba.get_foreground_host_activity().players:
|
for i in activity.players:
|
||||||
if i.sessionplayer.inputdevice.client_id == clientID:
|
if i.sessionplayer.inputdevice.client_id == clientID:
|
||||||
def dis(i, floater):
|
def dis(i, floater):
|
||||||
i.actor.node.invincible = False
|
i.actor.node.invincible = False
|
||||||
|
|
@ -235,33 +238,34 @@ def assignFloInputs(clientID: int):
|
||||||
ps = i.actor.node.position
|
ps = i.actor.node.position
|
||||||
i.actor.node.invincible = True
|
i.actor.node.invincible = True
|
||||||
floater.node.position = (ps[0], ps[1] + 1.0, ps[2])
|
floater.node.position = (ps[0], ps[1] + 1.0, ps[2])
|
||||||
ba.timer(1, floater.pop)
|
bs.timer(1, floater.pop)
|
||||||
i.actor.node.hold_node = ba.Node(None)
|
i.actor.node.hold_node = bs.Node(None)
|
||||||
i.actor.node.hold_node = floater.node2
|
i.actor.node.hold_node = floater.node2
|
||||||
i.actor.connect_controls_to_player()
|
i.actor.connect_controls_to_player()
|
||||||
i.actor.disconnect_controls_from_player()
|
i.actor.disconnect_controls_from_player()
|
||||||
i.resetinput()
|
i.resetinput()
|
||||||
floater.source_player = i
|
floater.source_player = i
|
||||||
floater.con()
|
floater.con()
|
||||||
i.assigninput(ba.InputType.PICK_UP_PRESS, floater.up)
|
i.assigninput(babase.InputType.PICK_UP_PRESS, floater.up)
|
||||||
i.assigninput(ba.InputType.PICK_UP_RELEASE, floater.upR)
|
i.assigninput(babase.InputType.PICK_UP_RELEASE, floater.upR)
|
||||||
i.assigninput(ba.InputType.JUMP_PRESS, floater.down)
|
i.assigninput(babase.InputType.JUMP_PRESS, floater.down)
|
||||||
i.assigninput(ba.InputType.BOMB_PRESS, floater.drop)
|
i.assigninput(babase.InputType.BOMB_PRESS, floater.drop)
|
||||||
i.assigninput(ba.InputType.PUNCH_PRESS, ba.Call(dis, i, floater))
|
i.assigninput(babase.InputType.PUNCH_PRESS, babase.Call(dis, i, floater))
|
||||||
i.assigninput(ba.InputType.UP_DOWN, floater.updown)
|
i.assigninput(babase.InputType.UP_DOWN, floater.updown)
|
||||||
i.assigninput(ba.InputType.LEFT_RIGHT, floater.leftright)
|
i.assigninput(babase.InputType.LEFT_RIGHT, floater.leftright)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bui.set_party_icon_always_visible(True)
|
||||||
|
|
||||||
old_fcm = _ba.chatmessage
|
old_fcm = bs.chatmessage
|
||||||
def new_chat_message(msg: Union[str, ba.Lstr], clients: Sequence[int] = None, sender_override: str = None):
|
def new_chat_message(*args, **kwargs):
|
||||||
old_fcm(msg, clients, sender_override)
|
old_fcm(*args, **kwargs)
|
||||||
if msg == '/floater':
|
if args[0] == '/floater':
|
||||||
try: assignFloInputs(-1)
|
try: assignFloInputs(-1)
|
||||||
except: pass
|
except: pass
|
||||||
_ba.chatmessage = new_chat_message
|
bs.chatmessage = new_chat_message
|
||||||
|
|
||||||
# ba_meta export plugin
|
# ba_meta export plugin
|
||||||
class byFreaku(ba.Plugin):
|
class byFreaku(babase.Plugin):
|
||||||
def __init__(self): pass
|
def __init__(self): pass
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#Made by: Freaku / @[Just] Freak#4999
|
# Made by your friend: Freaku
|
||||||
|
|
||||||
# • Icon Keyboard •
|
# • Icon Keyboard •
|
||||||
# Make your chats look even more cooler!
|
# Make your chats look even more cooler!
|
||||||
|
|
@ -8,14 +8,15 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ba_meta require api 7
|
# ba_meta require api 8
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import ba
|
import babase
|
||||||
from _ba import charstr as uwu
|
import bascenev1 as bs
|
||||||
|
from babase import charstr as uwu
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Optional, Dict, List, Tuple,Type, Iterable
|
from typing import Any, Optional, Dict, List, Tuple,Type, Iterable
|
||||||
|
|
@ -27,37 +28,37 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
|
|
||||||
# ba_meta export keyboard
|
# ba_meta export keyboard
|
||||||
class IconKeyboard_byFreaku(ba.Keyboard):
|
class IconKeyboard_byFreaku(babase.Keyboard):
|
||||||
"""Keyboard go brrrrrrr"""
|
"""Keyboard go brrrrrrr"""
|
||||||
name = 'Icons by \ue048Freaku'
|
name = 'Icons by \ue048Freaku'
|
||||||
chars = [(uwu(ba.SpecialChar.TICKET),
|
chars = [(uwu(babase.SpecialChar.TICKET),
|
||||||
uwu(ba.SpecialChar.CROWN),
|
uwu(babase.SpecialChar.CROWN),
|
||||||
uwu(ba.SpecialChar.DRAGON),
|
uwu(babase.SpecialChar.DRAGON),
|
||||||
uwu(ba.SpecialChar.SKULL),
|
uwu(babase.SpecialChar.SKULL),
|
||||||
uwu(ba.SpecialChar.HEART),
|
uwu(babase.SpecialChar.HEART),
|
||||||
uwu(ba.SpecialChar.FEDORA),
|
uwu(babase.SpecialChar.FEDORA),
|
||||||
uwu(ba.SpecialChar.HAL),
|
uwu(babase.SpecialChar.HAL),
|
||||||
uwu(ba.SpecialChar.YIN_YANG),
|
uwu(babase.SpecialChar.YIN_YANG),
|
||||||
uwu(ba.SpecialChar.EYE_BALL),
|
uwu(babase.SpecialChar.EYE_BALL),
|
||||||
uwu(ba.SpecialChar.HELMET),
|
uwu(babase.SpecialChar.HELMET),
|
||||||
uwu(ba.SpecialChar.OUYA_BUTTON_U)),
|
uwu(babase.SpecialChar.OUYA_BUTTON_U)),
|
||||||
(uwu(ba.SpecialChar.MUSHROOM),
|
(uwu(babase.SpecialChar.MUSHROOM),
|
||||||
uwu(ba.SpecialChar.NINJA_STAR),
|
uwu(babase.SpecialChar.NINJA_STAR),
|
||||||
uwu(ba.SpecialChar.VIKING_HELMET),
|
uwu(babase.SpecialChar.VIKING_HELMET),
|
||||||
uwu(ba.SpecialChar.MOON),
|
uwu(babase.SpecialChar.MOON),
|
||||||
uwu(ba.SpecialChar.SPIDER),
|
uwu(babase.SpecialChar.SPIDER),
|
||||||
uwu(ba.SpecialChar.FIREBALL),
|
uwu(babase.SpecialChar.FIREBALL),
|
||||||
uwu(ba.SpecialChar.MIKIROG),
|
uwu(babase.SpecialChar.MIKIROG),
|
||||||
uwu(ba.SpecialChar.OUYA_BUTTON_O),
|
uwu(babase.SpecialChar.OUYA_BUTTON_O),
|
||||||
uwu(ba.SpecialChar.LOCAL_ACCOUNT),
|
uwu(babase.SpecialChar.LOCAL_ACCOUNT),
|
||||||
uwu(ba.SpecialChar.LOGO)),
|
uwu(babase.SpecialChar.LOGO)),
|
||||||
(uwu(ba.SpecialChar.TICKET),
|
(uwu(babase.SpecialChar.TICKET),
|
||||||
uwu(ba.SpecialChar.FLAG_INDIA),
|
uwu(babase.SpecialChar.FLAG_INDIA),
|
||||||
uwu(ba.SpecialChar.OCULUS_LOGO),
|
uwu(babase.SpecialChar.OCULUS_LOGO),
|
||||||
uwu(ba.SpecialChar.STEAM_LOGO),
|
uwu(babase.SpecialChar.STEAM_LOGO),
|
||||||
uwu(ba.SpecialChar.NVIDIA_LOGO),
|
uwu(babase.SpecialChar.NVIDIA_LOGO),
|
||||||
uwu(ba.SpecialChar.GAME_CENTER_LOGO),
|
uwu(babase.SpecialChar.GAME_CENTER_LOGO),
|
||||||
uwu(ba.SpecialChar.GOOGLE_PLAY_GAMES_LOGO),
|
uwu(babase.SpecialChar.GOOGLE_PLAY_GAMES_LOGO),
|
||||||
uwu(ba.SpecialChar.ALIBABA_LOGO))]
|
uwu(babase.SpecialChar.EXPLODINARY_LOGO))]
|
||||||
nums = []
|
nums = []
|
||||||
pages: Dict[str, Tuple[str, ...]] = {}
|
pages: Dict[str, Tuple[str, ...]] = {}
|
||||||
19
Utilities/TowerD-unlocked.py
Normal file
19
Utilities/TowerD-unlocked.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Made by your friend: Freaku
|
||||||
|
|
||||||
|
|
||||||
|
import babase
|
||||||
|
import bascenev1 as bs
|
||||||
|
from bascenev1lib.maps import TowerD
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def new_play_types(cls):
|
||||||
|
"""return valid play types for this map."""
|
||||||
|
return ['melee', 'keep_away', 'team_flag', 'king_of_the_hill']
|
||||||
|
|
||||||
|
|
||||||
|
# ba_meta require api 8
|
||||||
|
# ba_meta export plugin
|
||||||
|
class byFreaku(babase.Plugin):
|
||||||
|
def on_app_running(self):
|
||||||
|
TowerD.get_play_types = new_play_types
|
||||||
Loading…
Add table
Add a link
Reference in a new issue