Skip to content

Commit

Permalink
Angled tilts/aerials with ModX/ModY.
Browse files Browse the repository at this point in the history
  • Loading branch information
avahe-kellenberger committed Dec 13, 2023
1 parent 25241c7 commit bc48bec
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/modes/UltimateR4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
bool shield_button_pressed = inputs.l || inputs.r;

if (inputs.mod_x) {
// Angled fsmash/ftilt with C-Stick + MX
if (directions.cx != 0) {
outputs.rightStickX = ANALOG_STICK_NEUTRAL + (directions.cx * 100);
outputs.rightStickY = ANALOG_STICK_NEUTRAL + 59;
}

if (shield_button_pressed) {
// Double shielding for shield tilt
outputs.triggerLDigital = true;
Expand All @@ -73,12 +79,6 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
}

// Angled fsmash/ftilt with C-Stick + MX
if (directions.cx != 0) {
outputs.rightStickX = ANALOG_STICK_NEUTRAL + (directions.cx * 100);
outputs.rightStickY = ANALOG_STICK_NEUTRAL + (directions.y * 59);
}

/* Up B angles */
if (directions.diagonal) {
// (39.05) = 53 43
Expand Down Expand Up @@ -139,6 +139,12 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
}

if (inputs.mod_y) {
// Angled fsmash/ftilt with C-Stick + MX
if (directions.cx != 0) {
outputs.rightStickX = ANALOG_STICK_NEUTRAL + (directions.cx * 100);
outputs.rightStickY = ANALOG_STICK_NEUTRAL - 59;
}

if (shield_button_pressed) {
// Double shielding for shield tilt
outputs.triggerLDigital = true;
Expand Down

0 comments on commit bc48bec

Please sign in to comment.