mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
[DMU] Implemented The Raven Man
This commit is contained in:
parent
aea8c82728
commit
0d705fdea6
5 changed files with 131 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.DiscardedCardWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public enum PlayerDiscardedThisTurnCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return DiscardedCardWatcher.playerInRangeDiscarded(source.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "a player discarded a card this turn";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.CantBlockAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class BlackBirdToken extends TokenImpl {
|
||||
|
||||
public BlackBirdToken() {
|
||||
super("Bird Token", "1/1 black Bird creature token with flying and \"This creature can't block.\"");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlack(true);
|
||||
subtype.add(SubType.BIRD);
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
addAbility(new CantBlockAbility());
|
||||
}
|
||||
|
||||
private BlackBirdToken(final BlackBirdToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlackBirdToken copy() {
|
||||
return new BlackBirdToken(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,4 +43,16 @@ public class DiscardedCardWatcher extends Watcher {
|
|||
DiscardedCardWatcher watcher = game.getState().getWatcher(DiscardedCardWatcher.class);
|
||||
return watcher == null ? 0 : watcher.playerMap.getOrDefault(playerId, 0);
|
||||
}
|
||||
|
||||
public static boolean playerInRangeDiscarded(UUID controllerId, Game game) {
|
||||
DiscardedCardWatcher watcher = game.getState().getWatcher(DiscardedCardWatcher.class);
|
||||
if (watcher != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controllerId, game)) {
|
||||
if (watcher.playerMap.getOrDefault(playerId, 0) > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue