public static float GetOffsetValue(this ShoulderPosition shoulderPosition)
        {
            switch (shoulderPosition)
            {
            case ShoulderPosition.Left:
                return(-1);

            case ShoulderPosition.Right:
                return(1);

            default:
                return(0);
            }
        }
Exemplo n.º 2
0
        private static void UpdateFocusedShoulderPosition(MissionScreen missionScreen, Agent mainAgent)
        {
            var isShoulderSwitchModeDynamic =
                SubModule.Config.ShoulderSwitchMode == ShoulderSwitchMode.MatchAttackAndBlockDirection ||
                SubModule.Config.ShoulderSwitchMode == ShoulderSwitchMode.TemporarilyMatchAttackAndBlockDirection;

            if (!isShoulderSwitchModeDynamic)
            {
                return;
            }

            var actionDirection = mainAgent.GetCurrentActionDirection(1);

            if (missionScreen.InputManager.IsGameKeyDown(CombatHotKeyCategory.Attack))
            {
                switch (actionDirection)
                {
                case Agent.UsageDirection.AttackLeft:
                    _focusedShoulderPosition          = ShoulderPosition.Left;
                    _alternateShoulderSwitchTimestamp = missionScreen.Mission.Time;
                    return;

                case Agent.UsageDirection.AttackRight:
                    _focusedShoulderPosition = ShoulderPosition.Right;
                    return;
                }
            }
            else if (missionScreen.InputManager.IsGameKeyDown(CombatHotKeyCategory.Defend))
            {
                switch (actionDirection)
                {
                case Agent.UsageDirection.DefendLeft:
                    _focusedShoulderPosition          = ShoulderPosition.Left;
                    _alternateShoulderSwitchTimestamp = missionScreen.Mission.Time;
                    return;

                case Agent.UsageDirection.DefendRight:
                    _focusedShoulderPosition = ShoulderPosition.Right;
                    return;
                }
            }
            else if (ShouldReturnFocusToOriginalShoulder(missionScreen))
            {
                _focusedShoulderPosition = ShoulderPosition.Right;
            }
        }
Exemplo n.º 3
0
 private void SetAngle()
 {
     Angle = ShoulderPosition.GetAngle(Aim);
 }
Exemplo n.º 4
0
 private void SetAngle()
 {
     currentAngle = ShoulderPosition.GetAngle(aimPosition);
 }