示例#1
0
        public static void ClientTryStartAction()
        {
            var worldObject = ClientWorldObjectInteractHelper.ClientFindWorldObjectAtCurrentMousePosition();

            if (worldObject?.ProtoGameObject is not IProtoObjectStructure protoObjectStructure)
            {
                return;
            }

            if (!SharedIsDeconstructable(protoObjectStructure))
            {
                return;
            }

            var currentCharacter = Client.Characters.CurrentPlayerCharacter;
            var privateState     = PlayerCharacter.GetPrivateState(currentCharacter);

            if (privateState.CurrentActionState is DeconstructionActionState actionState &&
                actionState.WorldObject == worldObject)
            {
                // the same object is already Deconstruction
                return;
            }

            SharedStartAction(currentCharacter, worldObject);
        }
示例#2
0
        public static void ClientTryStartAction()
        {
            var worldObject = ClientWorldObjectInteractHelper.ClientFindWorldObjectAtCurrentMousePosition();

            if (worldObject?.ProtoGameObject is not IProtoObjectHackableContainer)
            {
                return;
            }

            var currentCharacter = Client.Characters.CurrentPlayerCharacter;
            var privateState     = PlayerCharacter.GetPrivateState(currentCharacter);

            if (privateState.CurrentActionState is HackingActionState actionState &&
                actionState.WorldObject == worldObject)
            {
                // the same object is already Hacking
                return;
            }

            SharedStartAction(currentCharacter, worldObject);
        }
示例#3
0
        public static void ClientTryStartAction()
        {
            var worldObject = ClientWorldObjectInteractHelper.ClientFindWorldObjectAtCurrentMousePosition();

            if (!(worldObject?.ProtoStaticWorldObject is IProtoObjectStructure))
            {
                return;
            }

            var currentCharacter = Client.Characters.CurrentPlayerCharacter;
            var privateState     = PlayerCharacter.GetPrivateState(currentCharacter);

            if (privateState.CurrentActionState is ConstructionActionState actionState &&
                actionState.WorldObject == worldObject)
            {
                // the same object is already building/repairing
                return;
            }

            SharedStartAction(currentCharacter, worldObject);
        }