Skip to content

handlers: mission energy cost, level-up, and battle drops - #42

Open
Seltraeh wants to merge 1 commit into
decompfrontier:devfrom
Seltraeh:split/13-mission-flow
Open

handlers: mission energy cost, level-up, and battle drops#42
Seltraeh wants to merge 1 commit into
decompfrontier:devfrom
Seltraeh:split/13-mission-flow

Conversation

@Seltraeh

@Seltraeh Seltraeh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

handlers: mission energy cost, level-up, and battle drops

Branch: split/13-mission-flow
Base: dev
Merge position: 13 of 13

Part of the PR #28 split. Each PR branches from dev and contains only its
own changes, so this diff is exactly one subsystem. The set is designed to be
merged in numeric order; merging all 13 reproduces PR #28 byte for byte
(verified against tree 79a4e065).

Later PRs in the series touch Handlers.hpp, GmeControllerHandlers.cpp and
UserInfo.cpp too, so once earlier ones land this branch may need a rebase.
Those conflicts are always additions on both sides — keep both. Maintainer
edits are enabled, so feel free to push the rebase directly to this branch.

Final PR. Moves MissionStart / MissionEnd onto real data.

What's included

MissionStart takes the energy cost from mission_mst keyed on the requested mission id instead of a fixed value. It also reads the mission id from its nested position in the request rather than the top level, where it was never present — the previous fallback made every mission launch as mission 10.

MissionEnd credits per-mission zel and karma from the battle result, applies level-ups by per-level chunk subtraction, and refills energy to the new level's cap on ding. Dropped units go through addUserUnit and dropped items through addUserItem, driving both the obtained-unit animation and the first-encounter encyclopedia unlock.

Known incomplete

Battle wave content is still the captured mission-10 enemy set. The wave headers are keyed off the requested mission so the client renders and plays correctly, but loading per-mission waves from mission_mst remains outstanding and is the obvious next task.

Verification

Start a mission: correct energy deducted. Complete it: rewards credited, level-up animation plays once without cascading, drops appear.

Moves MissionStart and MissionEnd onto real data.

MissionStart takes the energy cost from mission_mst keyed on the requested
mission id instead of a fixed value, and reads the mission id from its nested
position in the request rather than the top level, where it was never present.

MissionEnd credits the per-mission zel and karma from the battle result,
applies level-ups by per-level chunk subtraction, and refills energy to the
new level's cap on ding. Dropped units are credited through addUserUnit and
dropped items through addUserItem, which drives both the obtained-unit
animation and the first-encounter encyclopedia unlock.

Battle wave content is still the captured mission-10 enemy set; the wave
headers are keyed off the requested mission so the client renders and plays
correctly, but loading per-mission waves from mission_mst remains outstanding.
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.

1 participant