Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to add flag support to the dream block.
In this case, activated and deactivated dream block can appears at the same time,
which vanilla Celeste, Everest and some of mods do not support.
What did vanilla do:
playerHasDreamDash
for only visual.Session.Inventory.DreamDash
which is global.Inventory.DreamDash
and assume all dream block is activated, then happily read Tracker[DreamBlock] (mainly used inCollide
method series).To change this:
DreamBlock.Activated
to represent the dream block's actual state (actually a property to readInventory.DreamDash
directly)Player.DreamDashCheck
Player.DashCoroutine
Player.DreamDashUpdate
to use that property.Collide
method with ours and hope that it can work with all mods.Inventory.DreamDash
.What did Everest and mods do:
Inventory.DreamDash
so they can't get flag support automatically. (can work as before)Inventory.DreamDash
, it should work, asDreamBlock.Activated
is a property that can read it.DreamBlock.Activate
series, it can in wrong visual state.To change this:
DreamBlock.Activate
series is Obsolete.DreamBlock.Activated
.DreamBlock.Activate
series still works fine in old map, so we don't need to migrate them all/quickly.Finally, we are prepared to add flag support.
DreamBlock.Flag
.DreamBlock.Activated
.NoInlining
for hooks.flagState
to save current flag state. only whenflagState
is changed, we can try to update visuals to match state.Update
.ActivatedPlus
for extensibility. It's designed for non-visual state.For performance reason, add
Level.HasNewDreamBlock
.Inventory.DreamDash
. Ignore them only when there's flag dream block.Add
DreamBlockPatch
to indicate if this patch has been applied.Info
it's actually what Reverse Helper did.It's designed for the extensibility.It's because of the compatibility.feel free to ask me.
it's impossible to track if an field is changed.
Level.HasNewDreamBlock
.What should we do
Tested CelesteTAS
100%.tas
Checked 2A Cutscene and it looks good
wrote a test map and it looks good
Tested Mod List is the same as Ja's IL Hook Viewer
- Communal Helper - crashed
- Reverse Helper - didn't work (apparently)
- More Lock Block - didn't work (apparently)
Main IL Changes And Mod Compatibility
DreamBlock.Added
Added new method call after
Inventory.DreamDash
to replace it with correct stateshould be good in 95% cases
it's not clean tbh
DreamBlock.Update
Update flag state every frame
should be good in 99.9% cases
Player.DreamDashCheck
Replace all
Collide
s with custom oneRemove
Inventory.DreamDash
conditionallyShould be good, because nobody loves to hook it.
More Lock Block was broken.
Tera Helper is not broken, but they should change their hook.
Player.DashCoroutine
Replace one
Collide
s with custom oneRemove
Inventory.DreamDash
conditionallyCommunalhelper was broken.
Player.DreamDashUpdate
Replace one
Collide
s with custom oneThere's no
Inventory.DreamDash
No mods was broken.