Advertisement
NoSloppy

BC_2nd_Blade_ext/ret_1-board

Feb 8th, 2022 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. // Turn Alt blade on/off using Aux button
  2. // Works on 2 button sabers even if running 1 button controls
  3. case EVENTID(BUTTON_AUX, EVENT_FIRST_HELD, MODE_ON):
  4. hybrid_font.DoEffect(EFFECT_USER4, 0);
  5. return true;
  6.  
  7. //Down where SB_Effect has the other effect's sounds trigger, this gets added:
  8.  
  9. case EFFECT_USER4: // Alt blade
  10. if (!second_blade_on_) {
  11. hybrid_font.PlayCommon(&SFX_out);
  12. second_blade_on_ = true;
  13. } else {
  14. hybrid_font.PlayCommon(&SFX_in);
  15. second_blade_on_ = false;
  16. }
  17.  
  18.  
  19. // second_blade_on_ variable needs to be initialized as false (with the other bools in the prop)
  20. // It also needs to become false anywhere there's a call to Off() to keep the toggle in sync if Aux is not the event to trigger retraction.
  21.  
  22. //Then the blade style is like this:
  23.  
  24. StylePtr<Layers<
  25. Black,
  26. AlphaL<
  27. // This Red can be replaced by a Layers<> with your existing style stuff in it, from the base blade down to, but not including, the InOutTrL.
  28. Red,
  29.  
  30. IsGreaterThan<EffectIncrementF<EFFECT_USER4,Int<32768>,Int<16384>>,Int<100>>>,
  31. EffectSequence<EFFECT_USER4,TransitionEffectL<TrConcat<TrInstant,Black,TrWipe<500>>,EFFECT_USER4>,TransitionEffectL<TrConcat<TrInstant,
  32. // This Red should be the same as the base blade color layer
  33. Red,
  34.  
  35. TrWipeInX<Int<500>>>,EFFECT_USER4>>,
  36. InOutTrL<TrInstant,TrWipeInX<WavLen<EFFECT_RETRACTION>>>
  37. >>(),
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement