Repository navigation
Conversation
throw_ball() presses ZL + ZR, scrolls balls with the D-pad while both are held, lets go to throw and waits. An optional ZL-only lead locks on first. Both catchers call it with their old presses and timings; ball_scrolls() and throw_buttons_hold() get unit tests.
| } | ||
|
|
||
| pbf_wait(context, POST_THROW_WAIT); | ||
| BallThrowOptions ball_throw; |
There was a problem hiding this comment.
intialize list this whole thing?
There was a problem hiding this comment.
Done in 2394ee3: one BallThrowOptions{.aim = ..., .right_scrolls = ..., ...} passed straight to throw_ball().
| BUTTON_ZL | BUTTON_ZR, | ||
| 500ms, 3500ms | ||
| ); | ||
| BallThrowOptions ball_throw; |
There was a problem hiding this comment.
intializer list the whole thing
There was a problem hiding this comment.
drop this unit test for this one
There was a problem hiding this comment.
Dropped in 2394ee3, with its registration in PokemonLZA_Tests.cpp.
|
|
||
| void throw_ball(ProControllerContext& context, const BallThrowOptions& options){ | ||
| if (options.lock_on > 0ms){ | ||
| pbf_controller_state(context, BUTTON_ZL, DPAD_NONE, {0, 0}, {0, 0}, options.lock_on); |
There was a problem hiding this comment.
basically any constants values in a function that takes more than 1 or 2 parameters should have a parameter comments
There was a problem hiding this comment.
Done: /*delay=*/, /*hold=*/, /*cool=*/ on ssf_press_button, and /*left_joystick=*/, /*right_joystick=*/, /*duration=*/ on the lock-on pbf_controller_state.
| Milliseconds after_throw = Milliseconds(0); | ||
| }; | ||
|
|
||
|
|
There was a problem hiding this comment.
Done: BallScrolls, ball_scrolls() and throw_buttons_hold() moved into the .cpp's anonymous namespace; the header now has only BallThrowOptions and throw_ball().
…private, no unit tests Review on #590: the callers build BallThrowOptions in one initializer, ball_scrolls() and throw_buttons_hold() move into the .cpp's anonymous namespace, constant arguments get parameter comments, and the tests go (they only restated the arithmetic).
Base:
upstream-main(mirror of upstream main). No parent PRs; the diff shows only this change.InPlaceCatcher and PostKillCatcher each wrote their own ZL + ZR throw, and our AutoStory catch has a third. This adds
throw_ball()inPrograms/PokemonLZA_BallThrow.{h,cpp}: optional ZL-only lock-on lead, ZL + ZR aim, optional D-pad ball scroll while both are held (negative = left), release to throw, then a wait. Both catchers now call it with their old timings (InPlaceCatcher: 500 ms hold + 3500 ms before its L press; PostKillCatcher: its scroll options and Post-Throw Wait). The only command-level difference: InPlaceCatcher's singlepbf_press_button(ZL|ZR, 500ms, 3500ms)becomes a 500 ms press plus a 3500 mspbf_wait, the same timeline. The lock-on lead is unused by upstream programs; it's there for the AutoStory catch (ZL 500 ms, then ZL + ZR 1500 ms).Testing: new unit tests
PokemonLZA::BallThrow::*cover the scroll direction/count and the ZL + ZR hold length (runs in Fork Draft CI). The presses themselves are not tested on a console.