Remove dangling "and to" from 1st Spare the Target chat message#2120
Open
talia-storymaker wants to merge 4 commits intoSWU-Karabast:mainfrom
Open
Remove dangling "and to" from 1st Spare the Target chat message#2120talia-storymaker wants to merge 4 commits intoSWU-Karabast:mainfrom
talia-storymaker wants to merge 4 commits intoSWU-Karabast:mainfrom
Conversation
moyerr
reviewed
Feb 4, 2026
moyerr
reviewed
Feb 24, 2026
Comment on lines
18
to
26
| const legalSystems = gameSystems.filter((system) => system.hasLegalTarget(context) && system.name !== 'collect bounty'); /* collecting a bounty always gets its own message */ | ||
| const legalSystems = gameSystems.filter((system) => system.hasLegalTarget(context) && system.getEffectMessage(context)[0] !== ''); | ||
| const message = ChatHelpers.formatWithLength(legalSystems.length, 'to '); | ||
| const legalSystemsMessages = legalSystems.map((system) => { | ||
| const [format, args] = system.getEffectMessage(context); | ||
| return { | ||
| format: format, | ||
| args: args | ||
| }; | ||
| }); |
Collaborator
There was a problem hiding this comment.
This looks pretty much correct! Can we just move the logic down to the legalSystemMessages below and perform the filter after the map there? That way, we've already generated the effectMessages and converted them to a proper object. So all we'd need to do is check that message.format !== ''.
Does that make sense?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem this addresses is that if someone uses Spare The Target, there is an "and to" at the end of the chat message (regardless of if the target has a Bounty or not; if it does have a Bounty, the bounty-collecting is still a separate message). This is because the code wants to put bounties in the same chat message as other actions, but bounties always have to be their own message. I assumed when making this that the latter is the desired behavior, so this simply removes the "and to" (regardless of if the target has a Bounty or not) with no other changes.
I know this may not be a very elegant fix and I'm obviously open to feedback.