When a bomb is used, cancel all previous bomb-related tasks just before
invoking new bomb tasks. This prevents the possibility of stacking
multiple bombs at the same time.
Also make sure to YIELD before starting the bomb logic loops, because
the bomb task will be scheduled in the same frame after the first yield,
due to the initial invocation being from an event handler.
The desync was caused by implementation specific behavior with complex numbers. Depending on the compiler, multiplying a complex-type number 1+0*I by -1 will either yield -1-0*I (gcc) or -1+0*I (clang). Complex functions with a branch cut along the negative real axis, such as carg will respond drastically to such a difference in zero sign.
In the case of carg, the difference incurred by this is exactly M_TAU, which is irrelevant in most applications. In reimu_b, however there was one instance where the branch cut of carg was not handled (carg(a/b) != carg(a) - carg(b)). Even without the zero-sign inconsistency, this was a bug causing bullets to be absorbed by gaps that should not have been.
This commit fixes said bug (and simplifies two instances of unproblematic but needlessly complicated math). The result is that (i) the gaps now function properly, and (ii) new replays do not desync between gcc and clang anymore. Note, that this change slightly breaks replay compatibility to older replays that showed the buggy behavior of the gaps.
* WIP cutscenes
* cutscene tweaks
* cutscene: erase background drawing under text
* Make text outlines thicker
* Prepare an interface for adding new cutscenes
* Basic progress tracking for cutscenes
* cutscene: support specifying scene name and BGM
* cutscene: exit with transition after scene ends
* Implement --cutscene ID and --list-cutscenes CLI flags
* fix progress_write_cmd_unlock_cutscenes
* Play intro cutscene before entering main menu for the first time
Also added --intro parameter in dev builds to force playing the intro
cutscene
* Add intro cutscene
* cutscenes: update opening/01 scene
* add Reimu Good End
* remove Bonus Data
* split up a bit of dialogue, revert an image change in intro
* small typo
* most cutscenes complete
* smartquotify
* finish Extra intros
* new cutscenes routed into main game
* fix ENDING_ID
* rough 'mediaroom' menu
* fix cutscene menu crash
* derp
* PR changes
* fixing imports
* more PR fixes
* PR fixes, including updating the script to #255
* add in newlines for readability
Co-authored-by: Alice D <alice@starwitch.productions>
* Homing shots are slower
* Homing shots do more damage, but fire less frequently (DPS is
preserved)
* Needle slaves are slightly closer together and rotate a bit faster
* More shift-spam abuse prevention
If entering a new stage while holding the shot button, myon never moves
away from the player until the player itself moves, and therefore never
initializes its .dir property. The initial value of .dir is 0.
All shots fired in this state have zero velocity, since .dir is supposed
to be a direction unit vector for them.
This patch initializes .dir to a sane value right away, and prevents
myon from getting stuck to the player in the first place.
Note that the original bug did not trigger when starting a new game,
only after a stage transition. The reason for that is currently unknown.
This does not seem to cause any replay inconsistencies, so the quirk is
probably on the user input layer.
fixes #252
ENEMY_IMMUNE is now deprecated. Spawning an enemy with ENEMY_IMMUNE hp
sets up the new flags field to match old behavior. The hp value itself
has (almost) no special meaning anymore.
This replaces SDL_mixer with an internal streaming and mixing system,
relying only on basic SDL audio support. It's also a partial refactor of
the audio API, most notably BGM-related. The BGM metadata resource type
is gone, as well as the `.bgm` files. The metadata is now stored inside
the `.opus` files directly, using standard Opus tags.