Skip to content

Battle window: a way back, and an easier target picker - #95

Merged
daedeloth merged 1 commit into
developfrom
claude/project-thread-wd61d5
Nov 5, 2026
Merged

daedeloth merged 1 commit into
developfrom
claude/project-thread-wd61d5

Conversation

@daedeloth

Copy link
Copy Markdown
Member

Requested by Thijs · project thread

What

A way back. Before this change, the window remembered the picked target, so every later step and every error page stayed stuck on it. Now each step after Attack or Support starts with "‹ Choose another target · All battles". That covers choosing regiments, special units, send support, the error pages and the "attack sent" message. getContent() handles overview and a fresh action before it reads the stored target, and it resets the request data.

Target picker (options A + C, as agreed). This replaces Neuron_Structure_ChooseTarget in the Battle window only. Thieves and Market still use the engine one.

  • Suggested appears for attacks when there is something to suggest. Everyone gets "Strike back" (the village attacked you in the last 7 days) and attackers of a clan mate. Premium adds the closest tribe and the closest player who costs no honour. The list never suggests a village that costs honour or cannot be attacked.
  • Nearby lists the 20 closest villages (straight line between town centres), with filters for all, players or tribes. It is premium only: free players see an upgrade box that opens the Premium window. In support mode, your own villages and your clan's villages come first.
  • Recent lists who attacked you, who you attacked (with the result) and the profiles you looked at. The last one is what the old "latest targets" list really was.
  • Search is the name search.
  • Each row shows the owner, race, networth and the distance in leagues. For premium players on an attack, it also shows the honour cost in green or red. Clan members and players on holiday stay in the list, greyed out, with the reason.
  • Free players open on Recent, not on the locked tab. The other tabs have a one-line "premium shows the honour cost" link. The premium benefits list gains a line for this.

New code: Dolumar_Battle_TargetList, battle/chooseTarget.phpt and battle/backLinks.phpt. Texts are in en, nl, de, fr and pl; the de, fr and pl texts are machine-quality. The spec is .ai/superpowers/specs/2026-11-05-battle-target-picker.md. There is no schema change and no engine change.

Decisions to check

  • "Premium" means isPremium(), which includes the free first week.
  • If credits are not configured on a server, nobody can buy premium, so the picker is open to everyone there.
  • The path distance and travel time stay on the next step. The A* path search is too heavy for 20 rows, which is why the list can differ slightly from "Total distance".

Testing

  • tests/Integration/BattleTargetListTest.php (6 tests) passes against a seeded local database. tests/Battle/TargetListTest.php is in the unit suite, and the unit suite passes. phpcs (PHPCompatibility) is clean on the changed PHP files.
  • I clicked through it in a local game (php -S + MySQL + memcached, preview seed), on desktop and mobile, as a premium and as a free player. Screenshots are in the project files under battle-targets/implemented/.

Generated by Claude Code

Every step of Attack and Support now links back to the battle list and to
"Choose another target"; the window no longer stays stuck on a picked target.

The target picker gets tabs: Suggested (strike back, avenge a clan mate, and
for premium the closest tribe and a nearby player that costs no honour),
Nearby (the 20 closest villages, premium only with an upgrade box), Recent
(who attacked you, who you attacked, profiles you looked at) and Search.
Rows show owner, race, networth, distance in leagues and, for premium, the
honour cost of an attack. Support lists your own and clan villages first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpWbfBL3zdGwhQNxBeeRqz
@daedeloth daedeloth self-assigned this Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Preview: removed, this pull request is closed.

@daedeloth
daedeloth merged commit 9425efe into develop Nov 5, 2026
5 checks passed
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.

2 participants