[KHM] Implemented Egon, God of Death (#7377)

This commit is contained in:
Daniel Bomar 2021-01-12 19:49:06 -06:00 committed by GitHub
parent 70bf8fe31b
commit 2bd682dcbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 94 additions and 6 deletions

View file

@ -63,6 +63,11 @@ public class DoIfCostPaid extends OneShotEffect {
return this;
}
public DoIfCostPaid addOtherwiseEffect (Effect effect) {
otherwiseEffects.add(effect);
return this;
}
public Effects getExecutingEffects() {
return this.executingEffects;
}
@ -96,12 +101,14 @@ public class DoIfCostPaid extends OneShotEffect {
int bookmark = game.bookmarkState();
if (cost.pay(source, game, source, player.getId(), false)) {
game.informPlayers(player.getLogName() + " paid for " + mageObject.getLogName() + " - " + message);
for (Effect effect : executingEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
result &= effect.apply(game, source);
} else {
game.addEffect((ContinuousEffect) effect, source);
if (!executingEffects.isEmpty()) {
for (Effect effect : executingEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
result &= effect.apply(game, source);
} else {
game.addEffect((ContinuousEffect) effect, source);
}
}
}
player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek