8000 fix(inventory): recompute equipped armor class by Mnehmos · Pull Request #89 · Mnehmos/mnehmos.rpg.mcp · GitHub
[go: up one dir, main page]

Skip to content

fix(inventory): recompute equipped armor class - #89

Merged
Mnehmos merged 1 commit into
mainfrom
codex/fix-armor-ac
Aug 14, 2026
Merged

Mnehmos merged 1 commit into
mainfrom
codex/fix-armor-ac

Conversation

@Mnehmos
@Mnehmos Mnehmos commented Aug 14, 2026
Copy link
Copy Markdown
Owner

What changed

  • Recompute AC from all currently equipped armor after equip and unequip.
  • Accept legacy starter armor that stores its base as properties.ac as well as authored baseAC items.
  • Preserve shield bonuses and avoid incremental AC drift when equipment is replaced.

Root cause

Starter Chain Mail is persisted with properties.ac: 16, while inventory_manage.equip only read properties.baseAC. AC was also incremented/decremented from its prior value, which could drift as armor and shields changed.

Validation

  • Focused inventory suite: 29/29 passed.
  • Build passed.
  • Full suite: 140 files passed, 1 skipped; 2,217 tests passed, 7 skipped; 13.35s wall time.

@coderabbitai
coderabbitai Bot commented Aug 14, 2026
Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 83ffbc59-becd-42d1-ac88-04584e5d1780

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mnehmos
Mnehmos marked this pull request as ready for review August 14, 2026 00:31
@Mnehmos
Mnehmos merged commit 2c34688 into main Aug 14, 2026
4 checks passed
@Mnehmos
Mnehmos deleted the codex/fix-armor-ac branch August 14, 2026 00:31
@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84f5ab4ec4

ℹ️ 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".

items: ReturnType<InventoryRepository['getInventoryWithDetails']>['items']
): number {
const dexMod = Math.floor((dexterity - 10) / 2);
let armorBase = 10 + dexMod;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the character's authoritative AC baseline

When a character's AC comes from an explicit character_manage.create value, natural armor, or another feature not represented by an inventory item, initializing the calculation to 10 + DEX discards that AC. Because both equip and unequip now invoke this helper unconditionally, merely equipping an ordinary weapon can change an AC 18 character to 10–12 even though no armor changed; the recomputation needs to preserve non-equipment AC or run only when the complete AC basis is represented by equipped items.

Useful? React with 👍 / 👎.

zxrfire pushed a commit to zxrfire/mnehmos.rpg.mcp that referenced this pull request Sep 8, 2026
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

0