Skip to content

Commit

Permalink
Allow shielding during up b angles.
Browse files Browse the repository at this point in the history
  • Loading branch information
avahe-kellenberger committed Dec 13, 2023
1 parent bc48bec commit e91e768
Showing 1 changed file with 107 additions and 108 deletions.
215 changes: 107 additions & 108 deletions src/modes/UltimateR4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,84 +56,84 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
bool shield_button_pressed = inputs.l || inputs.r;

if (inputs.mod_x) {
if (shield_button_pressed) {
// Double shielding for shield tilt
outputs.triggerLDigital = true;
outputs.triggerRDigital = true;
}

// 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;
outputs.triggerRDigital = true;
} else {
if (directions.horizontal) {
// Fastest walking speed before run
if (directions.horizontal) {
// Fastest walking speed before run
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
} else if (directions.vertical) {
// Vertical Shield Tilt and crouch with mod_x = 65
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 65);
} else if (directions.diagonal) {
// MX + q1/2/3/4 = 53 35
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
}

/* Up B angles */
if (directions.diagonal) {
// (39.05) = 53 43
if (inputs.c_down) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
} else if (directions.vertical) {
// Vertical Shield Tilt and crouch with mod_x = 65
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 65);
} else if (directions.diagonal) {
// MX + q1/2/3/4 = 53 35
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 43);
}
// (36.35) = 53 39
if (inputs.c_left) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 39);
}
// (30.32) = 56 41
if (inputs.c_up) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 31);
}
// (27.85) = 49 42
if (inputs.c_right) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 28);
}

/* Up B angles */
if (directions.diagonal) {
// (39.05) = 53 43
/* Extended Up B Angles */
if (inputs.b) {
// (33.29) = 67 44
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 44);
// (39.38) = 67 55
if (inputs.c_down) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 43);
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 55);
}
// (36.35) = 53 39
// (36.18) = 67 49
if (inputs.c_left) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 39);
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 49);
}
// (30.32) = 56 41
// (30.2) = 67 39
if (inputs.c_up) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 31);
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 39);
}
// (27.85) = 49 42
// (27.58) = 67 35
if (inputs.c_right) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 28);
}

/* Extended Up B Angles */
if (inputs.b) {
// (33.29) = 67 44
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 44);
// (39.38) = 67 55
if (inputs.c_down) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 55);
}
// (36.18) = 67 49
if (inputs.c_left) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 49);
}
// (30.2) = 67 39
if (inputs.c_up) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 39);
}
// (27.58) = 67 35
if (inputs.c_right) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 67);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 35);
}
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 35);
}
}

// Angled Ftilts
if (inputs.a) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 36);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 26);
}
// Angled Ftilts
if (inputs.a) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 36);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 26);
}
}
}
Expand All @@ -149,70 +149,69 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
// Double shielding for shield tilt
outputs.triggerLDigital = true;
outputs.triggerRDigital = true;
} else {
if (directions.horizontal) {
// Allow tink/yink walk shield
}
if (directions.horizontal) {
// Allow tink/yink walk shield
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 28);
} else if (directions.diagonal) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
}

/* Up B angles */
if (directions.diagonal) {
// (50.95) = 43 53
if (inputs.c_down) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 43);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
}
// (53.65) = 39 53
if (inputs.c_left) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 49);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
}
// (59.68) = 31 53
if (inputs.c_up) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 31);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
}
// (62.15) = 28 53
if (inputs.c_right) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 28);
} else if (directions.diagonal) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
}

/* Up B angles */
if (directions.diagonal) {
// (50.95) = 43 53
/* Extended Up B Angles */
if (inputs.b) {
// (56.71) = 44 67
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 44);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
// (50.62) = 55 67
if (inputs.c_down) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 43);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 55);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
// (53.65) = 39 53
// (53.82) = 49 67
if (inputs.c_left) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 49);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
// (59.68) = 31 53
// (59.8) = 39 67
if (inputs.c_up) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 31);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 39);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
// (62.15) = 28 53
// (62.42) = 35 67
if (inputs.c_right) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 28);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 53);
}

/* Extended Up B Angles */
if (inputs.b) {
// (56.71) = 44 67
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 44);
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 35);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
// (50.62) = 55 67
if (inputs.c_down) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 55);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
// (53.82) = 49 67
if (inputs.c_left) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 49);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
// (59.8) = 39 67
if (inputs.c_up) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 39);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
// (62.42) = 35 67
if (inputs.c_right) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 35);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 67);
}
}
}

// MY Pivot Uptilt/Dtilt
if (inputs.a) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 50);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 65);
}
// MY Pivot Uptilt/Dtilt
if (inputs.a) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 50);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 65);
}
}
}
Expand Down

0 comments on commit e91e768

Please sign in to comment.