Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOT] Added implementation for Optimus Prime and its abilities #10129

Merged
merged 15 commits into from
Aug 20, 2023

Conversation

jontaru
Copy link
Contributor

@jontaru jontaru commented Mar 20, 2023

Need to determine why triggers firing more than once but apart from that the rest works.

  • Bolster is triggering twice with one attacker ? Why?
  • Autobot leader convert trigger twice?
  • Autobot leader trample given to modified creature trigger more than once?

Any pointers in understanding why additional triggers are happening would be appreciated!

@JayDi85
Copy link
Member

JayDi85 commented Mar 20, 2023

There are multiple ways to get duplicated events:

@jontaru
Copy link
Contributor Author

jontaru commented Mar 23, 2023

There are multiple ways to get duplicated events:

Fixed now thanks

@jontaru jontaru closed this Mar 23, 2023
@jontaru
Copy link
Contributor Author

jontaru commented Mar 23, 2023

Oops meant to close the thread not the pull request..

@jontaru jontaru reopened this Mar 23, 2023
@jontaru jontaru requested a review from JayDi85 March 23, 2023 14:39

Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent.isTransformable() && !permanent.isTransformed()) {
permanent.transform(source, game);
Copy link
Member

@JayDi85 JayDi85 Mar 23, 2023

Choose a reason for hiding this comment

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

"Return converted/transformed" is not same as "return and transform". The last one can raise trigger with main card side befire transform. So the old approach with VALUE_KEY_ENTER_TRANSFORMED was correct (you must setup it before move).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I'll try to go back to the other way but it was causing the doubling of effects how it previously was.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works ! The game.getState().processAction(game); really did fix the issues 👍

@jontaru jontaru force-pushed the transformers/OptimusPrime branch from 8083810 to 3d3d397 Compare May 14, 2023 22:38
this.addAbility(new AttacksWithCreaturesTriggeredAbility(new BolsterEffect(2), 1));

// The chosen creature gains trample until end of turn.
this.addAbility(new AutobotLeaderAddTrampleTriggeredAbility());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a hacky way to implement it and could trigger off unrelated counters being added. The watcher checking name is also brittle. I think what actually needs to happen is BolsterEffect gets an optional second parameter to take an additional Effects to add to the chosen creature. Then this card can add the gain trample effect, and the delayed triggered ability that stores a MageObjectReference to the source and converts it if possible.

@xenohedron xenohedron self-assigned this Aug 20, 2023
@xenohedron
Copy link
Contributor

Alright I reimplemented this and wrote a test

@xenohedron xenohedron merged commit 77d0d3c into magefree:master Aug 20, 2023
1 check 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.

4 participants