mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
Added new files
This commit is contained in:
parent
5e004af549
commit
77ccb73089
1783 changed files with 566966 additions and 0 deletions
457
dist/ba_root/mods/chatHandle/ChatCommands/commands/Cheats.py
vendored
Normal file
457
dist/ba_root/mods/chatHandle/ChatCommands/commands/Cheats.py
vendored
Normal file
|
|
@ -0,0 +1,457 @@
|
|||
from .Handlers import handlemsg, handlemsg_all, clientid_to_myself,send
|
||||
from bastd.actor.zoomtext import ZoomText
|
||||
import ba, _ba
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
Commands = ['kill', 'fall', 'heal', 'zoommessage', 'curse', 'sleep', 'superpunch', 'gloves', 'shield', 'freeze', 'unfreeze', 'godmode', 'speedon','admincmdlist']
|
||||
CommandAliases = ['die', 'fell-down', 'zm', 'heath', 'cur', 'sp', 'punch', 'protect', 'ice', 'thaw', 'gm', 'speedy', 'acl']
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def ExcelCommand(command, arguments, clientid, accountid):
|
||||
"""
|
||||
Checks The Command And Run Function
|
||||
|
||||
Parameters:
|
||||
command : str
|
||||
arguments : str
|
||||
clientid : int
|
||||
accountid : int
|
||||
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
|
||||
if command in ['kill', 'die']:
|
||||
kill(arguments, clientid)
|
||||
|
||||
elif command in ['fall', 'fell-down']:
|
||||
fall(arguments, clientid)
|
||||
|
||||
elif command in ['heal', 'heath']:
|
||||
heal(arguments, clientid)
|
||||
|
||||
elif command in ['curse', 'cur']:
|
||||
curse(arguments, clientid)
|
||||
|
||||
elif command == 'sleep':
|
||||
sleep(arguments, clientid)
|
||||
|
||||
elif command in ['sp', 'superpunch']:
|
||||
super_punch(arguments, clientid)
|
||||
|
||||
elif command in ['gloves', 'punch']:
|
||||
gloves(arguments, clientid)
|
||||
|
||||
elif command in ['shield', 'protect']:
|
||||
shield(arguments, clientid)
|
||||
|
||||
elif command in ['freeze', 'ice']:
|
||||
freeze(arguments, clientid)
|
||||
|
||||
elif command in ['zm', 'zoommessage']:
|
||||
zm(arguments, clientid)
|
||||
|
||||
elif command in ['unfreeze', 'thaw']:
|
||||
un_freeze(arguments, clientid)
|
||||
|
||||
elif command in ['gm', 'godmode']:
|
||||
god_mode(arguments, clientid)
|
||||
|
||||
elif command in ['speedon', 'speedy']:
|
||||
speedy(arguments, clientid)
|
||||
|
||||
elif command in ['acl']:
|
||||
acl(arguments, clientid)
|
||||
|
||||
|
||||
|
||||
def kill(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.DieMessage())
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.DieMessage())
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.DieMessage())
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
def fall(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.StandMessage())
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.StandMessage())
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.StandMessage())
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def heal(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.PowerupMessage(poweruptype='health'))
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.PowerupMessage(poweruptype='health'))
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.PowerupMessage(poweruptype='health'))
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def curse(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.PowerupMessage(poweruptype='curse'))
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.PowerupMessage(poweruptype='curse'))
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.PowerupMessage(poweruptype='curse'))
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def sleep(arguments, clientid):
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
activity.players[myself].actor.node.handlemessage('knockout', 8000)
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
for i in activity.players:
|
||||
i.actor.node.handlemessage('knockout', 8000)
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
activity.players[req_player].actor.node.handlemessage('knockout', 8000)
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def hug(arguments, clientid):
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
|
||||
myself = clientid_to_myself(clientid)
|
||||
|
||||
if activity.players[myself].actor.node.hold_node != True:
|
||||
activity.players[myself].actor.node.hold_node = True
|
||||
else:
|
||||
activity.players[myself].node.hold_node = False
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
for i in activity.players:
|
||||
if i.actor.node.hold_node != True:
|
||||
i.actor.node.hold_node = True
|
||||
else:
|
||||
i.actor.node.hold_node = False
|
||||
|
||||
else:
|
||||
try:
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
req_player = int(arguments[0])
|
||||
|
||||
if activity.players[req_player].actor.node.hold_node != True:
|
||||
activity.players[req_player].actor.node.hold_node = True
|
||||
else:
|
||||
activity.players[req_player].actor.node.hold_node = False
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def super_punch(arguments, clientid):
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
|
||||
myself = clientid_to_myself(clientid)
|
||||
|
||||
if activity.players[myself].actor._punch_power_scale != 15:
|
||||
activity.players[myself].actor._punch_power_scale = 15
|
||||
activity.players[myself].actor._punch_cooldown = 0
|
||||
else:
|
||||
activity.players[myself].actor._punch_power_scale = 1.2
|
||||
activity.players[myself].actor._punch_cooldown = 400
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
for i in activity.players:
|
||||
if i.actor._punch_power_scale != 15:
|
||||
i.actor._punch_power_scale = 15
|
||||
i.actor._punch_cooldown = 0
|
||||
else:
|
||||
i.actor._punch_power_scale = 1.2
|
||||
i.actor._punch_cooldown = 400
|
||||
|
||||
else:
|
||||
try:
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
req_player = int(arguments[0])
|
||||
|
||||
if activity.players[req_player].actor._punch_power_scale != 15:
|
||||
activity.players[req_player].actor._punch_power_scale = 15
|
||||
activity.players[req_player].actor._punch_cooldown = 0
|
||||
else:
|
||||
activity.players[req_player].actor._punch_power_scale = 1.2
|
||||
activity.players[req_player].actor._punch_cooldown = 400
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def gloves(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.PowerupMessage(poweruptype='punch'))
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.PowerupMessage(poweruptype='punch'))
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.PowerupMessage(poweruptype='punch'))
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def shield(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.PowerupMessage(poweruptype='shield'))
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.PowerupMessage(poweruptype='shield'))
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.PowerupMessage(poweruptype='shield'))
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def freeze(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.FreezeMessage())
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.FreezeMessage())
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.FreezeMessage())
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def un_freeze(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
handlemsg(myself, ba.ThawMessage())
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
handlemsg_all(ba.ThawMessage())
|
||||
|
||||
else:
|
||||
try:
|
||||
req_player = int(arguments[0])
|
||||
handlemsg(req_player, ba.ThawMessage())
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def god_mode(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
player = activity.players[myself].actor
|
||||
|
||||
if player._punch_power_scale != 7:
|
||||
player._punch_power_scale = 7
|
||||
player.node.hockey = True
|
||||
player.node.invincible = True
|
||||
|
||||
else:
|
||||
player._punch_power_scale = 1.2
|
||||
player.node.hockey = False
|
||||
player.node.invincible = False
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
for i in activity.players:
|
||||
if i.actor._punch_power_scale != 7:
|
||||
i.actor._punch_power_scale = 7
|
||||
i.actor.node.hockey = True
|
||||
i.actor.node.invincible = True
|
||||
else:
|
||||
i.actor._punch_power_scale = 1.2
|
||||
i.actor.node.hockey = False
|
||||
i.actor.node.invincible = False
|
||||
|
||||
else:
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
req_player = int(arguments[0])
|
||||
player = activity.players[req_player].actor
|
||||
|
||||
if player._punch_power_scale != 7:
|
||||
player._punch_power_scale = 7
|
||||
player.node.hockey = True
|
||||
player.node.invincible = True
|
||||
|
||||
else:
|
||||
player._punch_power_scale = 1.2
|
||||
player.node.hockey = False
|
||||
player.node.invincible = False
|
||||
|
||||
|
||||
def speedy(arguments, clientid):
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
player = activity.players[myself].actor
|
||||
|
||||
if player.node.hockey != True:
|
||||
player.node.hockey = True
|
||||
|
||||
else:
|
||||
player.node.hockey = False
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
for i in activity.players:
|
||||
if i.actor.node.hockey != True:
|
||||
i.actor.node.hockey = True
|
||||
else:
|
||||
i.actor.node.hockey = False
|
||||
|
||||
else:
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
req_player = int(arguments[0])
|
||||
player = activity.players[req_player].actor
|
||||
|
||||
if player.node.hockey != True:
|
||||
player.node.hockey = True
|
||||
|
||||
else:
|
||||
player.node.hockey = False
|
||||
|
||||
|
||||
def zm(arguments, clientid):
|
||||
if len(arguments) == 0:
|
||||
_ba.screenmessage("Special Chat Only For Main", color=(1,1,1), transient=True, clients=[clientid])
|
||||
else:
|
||||
k = arguments[0]
|
||||
with ba.Context(_ba.get_foreground_host_activity()):
|
||||
ZoomText(
|
||||
k,
|
||||
position=(0, 180),
|
||||
maxwidth=800,
|
||||
lifespan=25000,
|
||||
color=(0.93*1.25, 0.9*1.25, 1.0*1.25),
|
||||
trailcolor=(0.15, 0.05, 1.0, 0.0),
|
||||
flash=False,
|
||||
jitter=2.0).autoretain
|
||||
|
||||
|
||||
|
||||
def load_roles_data():
|
||||
base_path = os.path.join(_ba.env()['python_directory_user'], "playersData" + os.sep)
|
||||
roles_file_path = os.path.join(base_path, 'roles.json')
|
||||
|
||||
with open(roles_file_path, 'r') as file:
|
||||
roles_data = json.load(file)
|
||||
|
||||
return roles_data
|
||||
|
||||
|
||||
def acl(arguments, client_id):
|
||||
roles_data = load_roles_data()
|
||||
|
||||
if arguments == [] or arguments == ['']:
|
||||
admin_commands = roles_data.get("admin", {}).get("commands", [])
|
||||
msg = "Admin Commands:\n" + "\n".join(admin_commands)+"\n"
|
||||
send(msg, client_id)
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue