Skip to content

Conversation

@Guantol-Lemat
Copy link
Contributor

Also added previous additions to the Changelog

- MC_POST_CYCLE_RATE_CALCULATE

Also added previous additions to the Changelog
@epfly6 epfly6 requested a review from ConnorForan October 27, 2025 18:13
Copy link
Collaborator

@ConnorForan ConnorForan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old forgotten PR got dropped into my inbox mysteriously

I left some comments, though you would need to sync/rebase the branch with main and test it again. The sig could be broken, too.

I have no big concerns with this, though it is certainly niche, and the fact that it got left for this long with nobody looking for something like this could be a testament to that. But if you still care enough to update & test this, we could probably still add it.

We could also consider making the cycle rate a pseudo-field of some kind via EntityPlus, depending on what you might prefer.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unrelated changelog additions from this PR (if they are still missing from the changelog at head, feel free to just push them directly, though idk with how old this PR is). I guess even the changelog for MC_POST_CYCLE_RATE_CALCULATE will need to be moved. Or omit the changelog from the PR entirely and push something in afterwards.

ModCallbacks.MC_PRE_NEW_ROOM = 1200
ModCallbacks.MC_PRE_MEGA_SATAN_ENDING = 1201
ModCallbacks.MC_POST_MODS_LOADED = 1210
ModCallbacks.MC_POST_CYCLE_RATE_CALCULATE = 1211
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action needed, just noting that this ID is still available

}

void ASMPatchPostCycleRateCalculate() {
SigScan scanner("837f??0075??c787????????00000000");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to new signature standard (ASM.zhl)

lua_rawgeti(L, LUA_REGISTRYINDEX, g_LuaEngine->runCallbackRegistry->key);

lua::LuaResults failure = lua::LuaCaller(L).push(callbackid)
.push(collectible->_cycleCollectibleCount)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fix indentation

PreBirthPatch(immaculateAddr, false); // Immaculate
}

// MC_POST_CYCLE_RATE_CALCULATE(1211)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for ref, does this run one every update, or only each time the item "cycles"? Does the timer need to land exactly on the cycle rate, or does the internal code do a >(=) check (mostly just considering the possibility of changing the rate causing it to get stuck permanently. I have not looked at the vanilla code)

Also, does this ONLY run when the pickup is actually a cycling collectible?

@Guantol-Lemat
Copy link
Contributor Author

Since:

  1. You can already get a similar effect with the MC_PRE_PICKUP_MORPH callback.
  2. The cycle logic has been updated in REP+.
  3. This was my first ASM patch.

I think it makes more sense to close this and revisit the idea later, if it’s still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants