Пример #1
0
from rlbot.utils.structures.utils import create_enum_object

RLBotCoreStatus = create_enum_object(["Success",
                                      "BufferOverfilled",
                                      "MessageLargerThanMax",
                                      "InvalidNumPlayers",
                                      "InvalidBotSkill",
                                      "InvalidHumanIndex",
                                      "InvalidName",
                                      "InvalidTeam",
                                      "InvalidTeamColorID",
                                      "InvalidCustomColorID",
                                      "InvalidGameValues",
                                      "InvalidThrottle",
                                      "InvalidSteer",
                                      "InvalidPitch",
                                      "InvalidYaw",
                                      "InvalidRoll",
                                      "InvalidPlayerIndex",
                                      "InvalidQuickChatPreset",
                                      "InvalidRenderType"],
                                     list_name='status_list')
Пример #2
0
from threading import Thread

from rlbot.messages.flat import QuickChat
from rlbot.messages.flat import QuickChatSelection
from rlbot.utils.logging_utils import get_logger

from rlbot.utils.structures.utils import create_enum_object
"""
Look for quick chats from here:
https://github.com/RLBot/RLBot/blob/master/src/main/flatbuffers/rlbot.fbs
"""
QuickChats = create_enum_object(
    [
        chat for chat in dir(QuickChatSelection.QuickChatSelection)
        if not chat.startswith('__')
        and not callable(getattr(QuickChatSelection.QuickChatSelection, chat))
    ],
    list_name='quick_chat_list',
    other_attributes=[('CHAT_NONE', -1), ('CHAT_EVERYONE', False),
                      ('CHAT_TEAM_ONLY', True)],
    attribute_object=QuickChatSelection.QuickChatSelection)


def send_quick_chat_flat(game_interface, index, team, team_only, quick_chat):
    builder = flatbuffers.Builder(0)
    QuickChat.QuickChatStart(builder)
    QuickChat.QuickChatAddQuickChatSelection(builder, quick_chat)
    QuickChat.QuickChatAddPlayerIndex(builder, index)
    QuickChat.QuickChatAddTeamOnly(builder, team_only)
    result = QuickChat.QuickChatEnd(builder)

    builder.Finish(result)
Пример #3
0
    ball_yaw = game_tick_packet.game_ball.physics.rotation.yaw
    game_tick_packet.game_ball.physics.rotation.yaw = ball_yaw + math.pi if ball_yaw < 0 else ball_yaw - math.pi

    for i in range(game_tick_packet.num_cars):
        game_tick_packet.game_cars[
            i].physics.location.x = -1 * game_tick_packet.game_cars[
                i].physics.location.x
        game_tick_packet.game_cars[
            i].physics.location.y = -1 * game_tick_packet.game_cars[
                i].physics.location.y
        game_tick_packet.game_cars[
            i].physics.velocity.x = -1 * game_tick_packet.game_cars[
                i].physics.velocity.x
        game_tick_packet.game_cars[
            i].physics.velocity.y = -1 * game_tick_packet.game_cars[
                i].physics.velocity.y
        game_tick_packet.game_cars[
            i].physics.angular_velocity.x = -1 * game_tick_packet.game_cars[
                i].physics.angular_velocity.x
        game_tick_packet.game_cars[
            i].physics.angular_velocity.y = -1 * game_tick_packet.game_cars[
                i].physics.angular_velocity.y

        car_yaw = game_tick_packet.game_cars[i].physics.rotation.yaw
        game_tick_packet.game_cars[
            i].physics.rotation.yaw = car_yaw + math.pi if car_yaw < 0 else car_yaw - math.pi


DropshotTileState = create_enum_object(
    ["UNKNOWN", "FILLED", "DAMAGED", "OPEN"])