Skip to content

Let a rule make another player a target without Ctrl - #1283

Open
openmubr wants to merge 1 commit into
Mutizens:mainfrom
openmubr:pr/player-target-rules
Open

openmubr wants to merge 1 commit into
Mutizens:mainfrom
openmubr:pr/player-target-rules

Conversation

@openmubr

@openmubr openmubr commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

The Chaos Castle lets the hero attack another player with a click, without Ctrl. Servers with player-versus-player
events of their own (an arena, a team match) need the same for the time of their event, and today that means editing
CheckAttack and CheckAttack_Fenrir.

This adds GameLogic/Combat/PlayerTargetRules.h. A rule is asked about the player under the cursor (never the hero,
never a dead one), right after the Chaos Castle check; when one says yes, the player is a target as in the Chaos
Castle.

Without a rule nothing changes. ZzzInterface.cpp gets one include and the same 4 lines in CheckAttack and
CheckAttack_Fenrir.

Tests

test_player_target_rules: rules are asked in order until one says yes and are gone once removed; with a rule the
player under the cursor is a target for CheckAttack and CheckAttack_Fenrir, a dead player is refused before any
rule is asked, and the hero is never asked about.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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