Repository navigation
feat(items): add the talisman of mobility - #1458
icheat2win wants to merge 10 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 84 |
| Duplication | 47 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b4b1796e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2eb87bf26
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public override string Name => PlugInName; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override string Description => PlugInDescription; |
There was a problem hiding this comment.
Return localized resources from the update metadata properties
In a German or Chinese admin-panel session, this update still appears in English: Updates.razor.cs forwards the update's Name and Description properties directly, so the localized [Display] attribute is not consulted on the update-selection page. The translations added in this commit therefore do not reach the page where operators decide whether to install this optional update. docs/CODING_RULES.md rule 10 requires localized plugin names and descriptions; return the corresponding resource properties from both overrides instead of the English constants.
AGENTS.md reference: AGENTS.md:L16-L17
Useful? React with 👍 / 👎.
| return false; | ||
| } | ||
|
|
||
| SetValue(player, character, Stats.MobilityTalismanMap, 0); |
There was a problem hiding this comment.
Preserve the bookmark for other half-used talismans
When a character uses two full talismans once before returning with either, both items reach durability 1 and share the character's latest bookmark. Returning with the first talisman clears that shared bookmark, so the second subsequently fails in GetSavedGateAsync and cannot perform its remaining use unless another unused talisman saves a location. Retain the bookmark for other half-used talismans, or prevent multiple outstanding saves rather than silently invalidating another item's paid return use.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I think that's acceptable for now.
Prevent consuming a second talisman while there is still one with 1 durability in the inventory.
| var map = await player.GameContext.GetMapAsync((ushort)mapNumber).ConfigureAwait(false); | ||
| return new ExitGate | ||
| { | ||
| Map = map?.Definition ?? mapDefinition, |
There was a problem hiding this comment.
Resolve an available map host before accepting the return gate
If the saved map remains active in configuration but its hosting server is stopped, a character on another server gets a null result from GetMapAsync, yet this fallback still produces a usable gate. The caller then clears the bookmark and consumes the talisman, while PlayerMapTransitions.ClientReadyAfterMapChangeAsync cannot locate the destination and warps the character to its home map instead. Check for an available local or remote host before accepting the gate, leaving the bookmark and item intact when none is available.
Useful? React with 👍 / 👎.
sven-n
left a comment
There was a problem hiding this comment.
This PR conflicts with current master, so I can't merge it. Please rebase it onto master. These files conflict:
src/GameLogic/Properties/PlugInResources.Designer.cssrc/GameLogic/Properties/PlugInResources.resxsrc/Persistence/Initialization/Properties/ItemNames.Designer.cssrc/Persistence/Initialization/Properties/ItemNames.de.resxsrc/Persistence/Initialization/Properties/ItemNames.resxsrc/Persistence/Initialization/Properties/ItemNames.zh-CN.resxtests/MUnique.OpenMU.Persistence.Initialization.Tests/ItemStatProfilesDataTest.cs
Most of them are resource files (.resx / .Designer.cs) which other merged PRs also extended. When you resolve them, keep the entries of both sides, and regenerate the designer file instead of merging it by hand. I'll review it in full once it's rebased.
Generated by Claude Code
dab398d to
9015939
Compare
sven-n
left a comment
There was a problem hiding this comment.
Thanks for the rebase. Unfortunately, #1504 was merged in the meantime and regenerated GameLogic/Properties/PlugInResources.Designer.cs, so this PR conflicts again (PlugInResources.*, PlayerMessage.*). Please rebase once more: keep the entries of both sides in the .resx files, then regenerate the designer instead of merging it by hand.
Your five item PRs (#1458, #1461, #1464, #1470, #1471) all add to the same resource files, so they conflict with each other too. Each merge will make the others conflict again. I'll merge whichever is rebased and green first.
Code feedback for this one:
- Localization:
AddTalismanOfMobilityUpdatePlugIn.Name/Descriptionreturn the English constantsPlugInName/PlugInDescription, although theDisplayattribute points to resources. Please return the resources, likeAddTalismanOfResurrectionUpdatePlugInin #1461 does (rule 10). - Map requirements on return:
GetSavedGateAsynconly checks that the saved map is active. If the character no longer fulfills its requirements (e.g. no wings for Icarus), it's warped there anyway. Please checkmapDefinition.TryGetRequirementError(player, out _)before warping, as the Talisman of Resurrection does, and keep the talisman unused in that case.
Generated by Claude Code
9015939 to
54949af
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54949af202
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (new CashShopItems(context, gameConfiguration).CreateTalismanOfMobility() is { } talisman) | ||
| { | ||
| ItemRules.Apply([talisman]); |
There was a problem hiding this comment.
Apply rules when the cash-shop update already created the talisman
When upgrading a pre-cash-shop database with both optional updates selected, AddCashShopUpdatePlugIn.ApplyAsync runs first and now creates the talisman through CashShopItems.Initialize(). Consequently, CreateTalismanOfMobility() returns null here and skips the rule application. The mandatory item-rule update runs before the cash-shop update, so the talisman retains the model's permissive defaults for trading, dropping and NPC/personal-store sales, unlike a freshly initialized database. Apply the restrictions to the talisman created by the earlier update too, and cover this upgrade sequence to satisfy docs/CODING_RULES.md rule 4's cumulative-repair requirement.
AGENTS.md reference: AGENTS.md:L16-L17
Useful? React with 👍 / 👎.
Part of MUnique#1339 The first use saves the place of the character, the second one warps it back. The place is stored in stat attributes of the character. An optional update adds the item and puts the shop packages on sale. Rebased onto master: this is the change of the earlier commits in one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc76CH3CGWUp5r4XmXWK
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdc27d5c68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| || player.CurrentMiniGame is not null | ||
| || player.DuelRoom is not null) |
There was a problem hiding this comment.
Enforce closed Castle Siege gates on mobility returns
If an attacker saves a point behind the castle gates before the battle starts, CastleSiegePlugIn.MovePlayersToTheirSidesAsync moves them out at Start, but their next talisman use warps straight back behind the closed gates. Castle Siege does not populate CurrentMiniGame, and this path skips the IPlayerTeleportRestrictionPlugIn check used by WizardTeleportAction, so neither these guards nor WarpToAsync prevents the bypass. Consult that existing restriction seam before clearing the bookmark and consuming the return charge, as directed by docs/CODING_RULES.md rule 8, or disallow mobility returns during the siege.
AGENTS.md reference: AGENTS.md:L16-L17
Useful? React with 👍 / 👎.
cdc27d5 to
1883c6a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1883c6aefe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.CreateItem(14, 169, LocalizedString.FromResource(() => ItemNames.RageFighterCharacterCard)); | ||
| this.CreateResetFruits(); | ||
| this.CreateTalismanOfResurrection(); | ||
| this.CreateTalismanOfMobility(); |
There was a problem hiding this comment.
Add bookmark definitions in the shared cash-shop initializer
On an existing database predating this feature, an operator can apply AddCashShopUpdatePlugIn while deselecting the new optional talisman update. The cash-shop update calls this initializer and now puts the talisman on sale, but the three bookmark attributes are absent because only AddTalismanOfMobilityUpdatePlugIn adds them on this upgrade path. Saving a location with a full talisman then makes SetValue fall back to plain Stats definitions; the EF StatAttribute.Definition setter assigns a null DefinitionId for these, so the bookmark disappears after relogging and strands the remaining return charge. Initialize the prerequisite attributes in this shared path too, and cover this upgrade selection as required by docs/CODING_RULES.md rule 4.
AGENTS.md reference: AGENTS.md:L16-L17
Useful? React with 👍 / 👎.
sven-n
left a comment
There was a problem hiding this comment.
Thanks for the rebase. It's clean against master now. The two points from my previous review are still open, though:
- Localization:
AddTalismanOfMobilityUpdatePlugIn.Name/Descriptionstill return the English constantsPlugInName/PlugInDescription. Please returnPlugInResources.AddTalismanOfMobilityUpdatePlugIn_Name/_Description, as the other update plugins do (e.g. the Talisman of Resurrection's). - Map requirements on return:
TalismanOfMobilityConsumeHandlerPlugInstill warps to the saved map without checking its requirements. A character which saved a place in Icarus and lost its wings would be warped there anyway. Please checkmapDefinition.TryGetRequirementError(player, out _)inGetSavedGateAsync(or before the warp), show a message, and keep the talisman unused in that case.
Once these are in, I'll merge it.
Generated by Claude Code
Addresses the review on MUnique#1458: - The update plugin returns its localized name and description from PlugInResources instead of English constants. - Before returning to the saved place, the talisman checks the requirements of the saved map (e.g. wings for Icarus) and whether it's active. If they aren't fulfilled, the character gets the message and keeps the talisman and the saved place. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75aT2CCp3YgcY55r3t
|
Thanks! Both points are in 9d235f6: AddTalismanOfMobilityUpdatePlugIn.Name/Description now return PlugInResources.AddTalismanOfMobilityUpdatePlugIn_Name/_Description, like the Talisman of Resurrection update. The English constants are gone. |
…talisman-of-mobility # Conflicts: # tests/MUnique.OpenMU.Persistence.Initialization.Tests/ItemStatProfilesDataTest.cs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c321996ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var gate = await GetSavedGateAsync(player, character, savedMap).ConfigureAwait(false); | ||
| SetValue(player, character, Stats.MobilityTalismanMap, 0); | ||
| await this.ConsumeSourceItemAsync(player, item).ConfigureAwait(false); | ||
| await player.WarpToAsync(gate).ConfigureAwait(false); |
There was a problem hiding this comment.
Revalidate Land of Trials access on mobility returns
If a non-owner bookmarks public Land of Trials, leaves, and the castle owner subsequently makes it private, this return still succeeds. The public/owner restriction is enforced by CastleSiegeTaxProvider.TryPayHuntEntryFeeAsync, called from CastleSiegeHuntZoneEnterAction, rather than by TryGetRequirementError or the existing gate plug-ins. Land of Trials also does not set CurrentMiniGame, so the initial guard does not prevent this access bypass. Expose the hunt-zone admission policy through the entry plug-in seam and consult it before clearing the bookmark or consuming the charge, following docs/CODING_RULES.md rule 8, or prohibit bookmarks there.
AGENTS.md reference: AGENTS.md:L16-L17
Useful? React with 👍 / 👎.
The Talisman of Mobility warped the character back without asking the IWarpGateEnteringPlugIn point, so a closed event map like the Raklion hatchery used the talisman up and ejected the character afterwards. The plug-ins are now asked before the talisman and the saved place are used, like for warp gates and the warp list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
The return of the Talisman of Mobility could bypass two Castle Siege restrictions: - The Land of Trials is only entered through its guard, which lets in the castle owner alliance, or everyone while the hunt zone is public. The castle siege plugin now applies the same rule as an IWarpGateEnteringPlugIn, so a saved place there can't be used to get back in while the zone is closed. - On the same map, the return now asks IPlayerTeleportRestrictionPlugIn first, so it can't cross a closed castle gate. In both cases the talisman and the saved place are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
A place saved by the Talisman of Mobility behind the castle gates before the battle could be returned to from another map while the battle runs. During the battle, the castle siege plugin now only lets warps onto the siege map through its configured gates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
The cash shop update creates the Talisman of Mobility, too. Then it lacked the attributes for the saved place and its item rules, and the talisman update skipped the rules because the item already existed. CashShopItems.CreateTalismanOfMobility now adds the attributes and applies the item rules itself, whichever update creates it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
When no game server hosts the saved map, e.g. because it's stopped, the return used the talisman up and the character ended at its home map. The handler now resolves the host first, like the map transition does, and keeps the talisman and the saved place otherwise. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
Part of #1339
The first use saves the place of the character, the second one warps it back. The place is stored in stat attributes of the character. An optional update adds the item and puts the shop packages on sale.
Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi