mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
[STX] Implement Conspiracy Theorist (#7728)
* [STX] Implement Conspiracy Theorist
This commit is contained in:
parent
7d2b1b4ade
commit
af0f705b5e
4 changed files with 171 additions and 2 deletions
25
Mage/src/main/java/mage/game/events/DiscardedCardsEvent.java
Normal file
25
Mage/src/main/java/mage/game/events/DiscardedCardsEvent.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package mage.game.events;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author htrajan
|
||||
*/
|
||||
public class DiscardedCardsEvent extends GameEvent {
|
||||
|
||||
private final Cards discardedCards;
|
||||
|
||||
public DiscardedCardsEvent(Ability source, UUID playerId, int amount, Cards discardedCards) {
|
||||
super(EventType.DISCARDED_CARDS, null, source, playerId, amount, false);
|
||||
this.discardedCards = new CardsImpl(discardedCards);
|
||||
}
|
||||
|
||||
public Cards getDiscardedCards() {
|
||||
return discardedCards;
|
||||
}
|
||||
}
|
||||
|
|
@ -748,7 +748,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
if (!discardedCards.isEmpty()) {
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARDS, null, source, playerId, discardedCards.size()));
|
||||
game.fireEvent(new DiscardedCardsEvent(source, playerId, discardedCards.size(), discardedCards));
|
||||
}
|
||||
return discardedCards;
|
||||
}
|
||||
|
|
@ -826,7 +826,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARD, card.getId(), source, playerId));
|
||||
|
||||
if (fireFinalEvent) {
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARDS, null, source, playerId, 1));
|
||||
game.fireEvent(new DiscardedCardsEvent(source, playerId, 1, new CardsImpl(card)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue