Skip to content

Commit

Permalink
BC_buttons - No lockups in CC mode (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoSloppy authored and profezzorn committed Sep 29, 2023
1 parent 1c73322 commit 1abd9f4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions props/saber_BC_buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,8 @@ class SaberBCButtons : public PROP_INHERIT_PREFIX PropBase {

// Stab
case EVENTID(BUTTON_NONE, EVENT_THRUST, MODE_ON):
//Don't stab if in colorchange mode
if (SaberBase::GetColorChangeMode() != SaberBase::COLOR_CHANGE_MODE_NONE) return false;
SaberBase::SetClashStrength(2.0);
SaberBase::DoStab();
return true;
Expand Down Expand Up @@ -896,6 +898,8 @@ class SaberBCButtons : public PROP_INHERIT_PREFIX PropBase {
// 2 button
case EVENTID(BUTTON_NONE, EVENT_CLASH, MODE_ON | BUTTON_AUX):
#endif
//Don't lockup if in colorchange mode
if (SaberBase::GetColorChangeMode() != SaberBase::COLOR_CHANGE_MODE_NONE) return false;
if (!SaberBase::Lockup()) {
// pointing down
if (fusor.angle1() < - M_PI / 4) {
Expand All @@ -915,6 +919,8 @@ class SaberBCButtons : public PROP_INHERIT_PREFIX PropBase {

// Melt
case EVENTID(BUTTON_NONE, EVENT_STAB, MODE_ON):
//Don't melt if in colorchange mode
if (SaberBase::GetColorChangeMode() != SaberBase::COLOR_CHANGE_MODE_NONE) return false;
clash_impact_millis_ = millis();
if (!SaberBase::Lockup() && !swinging_) {
SaberBase::SetLockup(SaberBase::LOCKUP_MELT);
Expand All @@ -925,6 +931,8 @@ class SaberBCButtons : public PROP_INHERIT_PREFIX PropBase {

// Lightning Block
case EVENTID(BUTTON_POWER, EVENT_SECOND_HELD_MEDIUM, MODE_ON):
//Don't lightning block if in colorchange mode
if (SaberBase::GetColorChangeMode() != SaberBase::COLOR_CHANGE_MODE_NONE) return false;
SaberBase::SetLockup(SaberBase::LOCKUP_LIGHTNING_BLOCK);
SaberBase::DoBeginLockup();
return true;
Expand Down

0 comments on commit 1abd9f4

Please sign in to comment.