-
Notifications
You must be signed in to change notification settings - Fork 774
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
[BOT] Added implementation for Optimus Prime and its abilities #10129
Conversation
There are multiple ways to get duplicated events:
|
Fixed now thanks |
Oops meant to close the thread not the pull request.. |
|
||
Permanent permanent = game.getPermanent(source.getSourceId()); | ||
if (permanent.isTransformable() && !permanent.isTransformed()) { | ||
permanent.transform(source, game); |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍
…nalCosts as disturb instead of default
8083810
to
3d3d397
Compare
this.addAbility(new AttacksWithCreaturesTriggeredAbility(new BolsterEffect(2), 1)); | ||
|
||
// The chosen creature gains trample until end of turn. | ||
this.addAbility(new AutobotLeaderAddTrampleTriggeredAbility()); |
There was a problem hiding this comment.
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.
Alright I reimplemented this and wrote a test |
Need to determine why triggers firing more than once but apart from that the rest works.
Any pointers in understanding why additional triggers are happening would be appreciated!