Skip to content

Conversation

ssk97
Copy link
Contributor

@ssk97 ssk97 commented Oct 13, 2025

Casting a spell with Overload converts all "target" text to "each". Currently this is done by having entirely separate effects. Instead, we can apply the effects after setting up a FixedTargets.

I have not yet finished converting all Overload cards, once I do I will remove the old OverloadAbility constructor. Currently only A-D cards have been modified. Several of the more complex Overload cards will require merging the target and overload effect implementations as the target version uses getFirstTarget.

I was wondering if this seemed worth finishing. I don't expect it to fix any bugs, just remove a lot of repetitive code.

card.getSpellAbility().addEffect(effect.copy());
OverloadedEffect overloadEffect = new OverloadedEffect(effect, target.copy());
overloadEffect.setText(effect.getText(card.getSpellAbility().getModes().getMode())
.replace("target", "each"));
Copy link
Member

Choose a reason for hiding this comment

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

Why you don’t use conditional style effect and target (one pair for single and one pair for all)? Auto-replace looks overdeveloped and potentially buggy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The "all" version of the spell needs to have no target when cast. It sounds to me like you're recommending not continuing this rework and keeping the existing code with its fully separate effects.

The whole point of this rework is to remove the duplicated code by auto-replacing the targets.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, it’s looks strange in current implementation — one shot effect but it can be continues effect inside — thats can broke some effects/targets lifecycle in theory. Not critical and maybe workable.

Also inner effects must support work with target pointers (e.g. each inner effect must have special code to check and use the pointers). Must be carefully replaced and checked.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would not call it "special code" as all effects ought to use target pointers as the default, but I agree need to verify each effect properly uses them.

protected OverloadedEffect(final OverloadedEffect effect) {
super(effect);
this.innerEffect = effect.innerEffect;
this.target = effect.target;
Copy link
Member

Choose a reason for hiding this comment

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

Miss copies

@xenohedron
Copy link
Contributor

xenohedron commented Oct 14, 2025

I endorse this direction

(just make sure there's adequate test coverage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants