Skip to content

fix(castle-siege): prevent damage between players of the same siege side - #1349

Open
icheat2win wants to merge 4 commits into
MUnique:masterfrom
icheat2win:fix/castle-siege-friendly-fire
Open

icheat2win wants to merge 4 commits into
MUnique:masterfrom
icheat2win:fix/castle-siege-friendly-fire

Conversation

@icheat2win

Copy link
Copy Markdown
Contributor

Part of the Castle Siege epic (#735).

Problem

During the battle, players of the same siege side could damage each other, including with area skills. Only the catapults checked sides.

Change

  • New plugin point IPlayerAttackRestrictionPlugIn (fresh GUID). Player.AttackByAsync asks it before calculating damage, with the attacking player or the owner of the attacking pet (IPlayerSurrogate), and returns no hit when a plugin cancels.
  • CastleSiegeContext.AreOnSameSide: both players on the Castle Siege map during Start, with the same, non-empty side.
  • CastleSiegePlugIn implements the new point and cancels attacks between the same side.
  • Documented on the Castle Siege page of the docs website.

There was no existing seam for "may this player damage that player", so this adds one rather than putting a Castle Siege special case into Player.

Tests

New CastleSiegeFriendlyFireTests (3 tests): side combinations, leaving the map, outside the battle, a blocked attack on an ally leaves the health unchanged, an attack on an enemy still hits.

Ran the full MUnique.OpenMU.Tests suite with --no-build: 2445 passed, 2 skipped. Not verified with a game client.


Generated by Claude Code

Adds the IPlayerAttackRestrictionPlugIn point, which can prevent a
player (or the owner of an attacking pet) from damaging another player.
The Castle Siege plugin uses it to stop friendly fire between players of
the same side during the battle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011xNc764bgrPZRQYCRzPj1x
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T16:11:01.631691Z
We couldn’t complete this review. Comment @codex review to try again.
dcd057a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codacy-production

codacy-production Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 24 complexity · 7 duplication

Metric Results
Complexity 24
Duplication 7

View in Codacy

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.

@sven-n sven-n left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please resolve conflicts

claude and others added 2 commits October 29, 2026 22:23
…friendly-fire

# Conflicts:
#	docs-website/docs/server-features/castle-siege.md
#	src/GameLogic/CastleSiege/CastleSiegeContext.cs
#	src/GameLogic/CastleSiege/CastleSiegePlugIn.cs
@icheat2win
icheat2win requested a review from sven-n October 30, 2026 20:21

This branch has not been deployed

No deployments
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.

3 participants