Commit e98cb004 authored by swordshine's avatar swordshine

Add Robber of the Rich

parent e529765c
......@@ -156,7 +156,7 @@ public class DamageDealAi extends DamageAiBase {
}
}
}
if (ai.getAttackedWithCreatureThisTurn()) {
if (!ai.getCreaturesAttackedThisTurn().isEmpty()) {
dmg = Integer.parseInt(logic.substring(logic.indexOf(".") + 1));
}
} else if ("WildHunt".equals(logic)) {
......
......@@ -63,7 +63,7 @@ public class DestroyAi extends SpellAbilityAi {
}
} else if ("AtEOTIfNotAttacking".equals(sa.getParam("AILogic"))) {
PhaseHandler ph = ai.getGame().getPhaseHandler();
if (!ph.is(PhaseType.END_OF_TURN) || ai.getAttackedWithCreatureThisTurn()) {
if (!ph.is(PhaseType.END_OF_TURN) || !ai.getCreaturesAttackedThisTurn().isEmpty()) {
return false;
}
}
......
......@@ -1329,6 +1329,13 @@ public class CardFactoryUtil {
return doXMath(cc.getAttackersDeclaredThisTurn(), m, c);
}
// Count$CardAttackedThisTurn_<Valid>
if (sq[0].contains("CreaturesAttackedThisTurn")) {
final String[] workingCopy = l[0].split("_");
final String validFilter = workingCopy[1];
return doXMath(CardLists.getType(cc.getCreaturesAttackedThisTurn(), validFilter).size(), m, c);
}
// Count$ThisTurnCast <Valid>
// Count$LastTurnCast <Valid>
if (sq[0].contains("ThisTurnCast") || sq[0].contains("LastTurnCast")) {
......
......@@ -317,7 +317,7 @@ public class CombatUtil {
c.getDamageHistory().setCreatureAttackedThisCombat(true);
c.getDamageHistory().clearNotAttackedSinceLastUpkeepOf();
c.getController().setAttackedWithCreatureThisTurn(true);
c.getController().addCreaturesAttackedThisTurn(c);
c.getController().incrementAttackersDeclaredThisTurn();
if (combat.getDefenderByAttacker(c) != null && combat.getDefenderByAttacker(c) instanceof Player) {
......
......@@ -150,7 +150,7 @@ public class GlobalAttackRestrictions {
final Game game = attackingPlayer.getGame();
/* if (game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.onlyOneAttackerATurn)) {
if (attackingPlayer.getAttackedWithCreatureThisTurn()) {
if (!attackingPlayer.getAttackedWithCreatureThisTurn().isEmpty()) {
max = 0;
} else {
max = 1;
......
......@@ -124,7 +124,7 @@ public class Player extends GameEntity implements Comparable<Player> {
private ManaPool manaPool = new ManaPool(this);
private GameEntity mustAttackEntity = null;
private GameEntity mustAttackEntityThisTurn = null;
private boolean attackedWithCreatureThisTurn = false;
private CardCollection creatureAttackedThisTurn = new CardCollection();
private boolean activateLoyaltyAbilityThisTurn = false;
private boolean tappedLandForManaThisTurn = false;
private int attackersDeclaredThisTurn = 0;
......@@ -1824,11 +1824,14 @@ public class Player extends GameEntity implements Comparable<Player> {
activateLoyaltyAbilityThisTurn = b;
}
public final boolean getAttackedWithCreatureThisTurn() {
return attackedWithCreatureThisTurn;
public final CardCollection getCreaturesAttackedThisTurn() {
return creatureAttackedThisTurn;
}
public final void setAttackedWithCreatureThisTurn(final boolean b) {
attackedWithCreatureThisTurn = b;
public final void addCreaturesAttackedThisTurn(final Card c) {
creatureAttackedThisTurn.add(c);
}
public final void clearCreaturesAttackedThisTurn() {
creatureAttackedThisTurn.clear();
}
public final int getAttackersDeclaredThisTurn() {
......@@ -2389,7 +2392,7 @@ public class Player extends GameEntity implements Comparable<Player> {
resetNumDrawnThisTurn();
resetNumDiscardedThisTurn();
setNumCardsInHandStartedThisTurnWith(getCardsIn(ZoneType.Hand).size());
setAttackedWithCreatureThisTurn(false);
clearCreaturesAttackedThisTurn();
setActivateLoyaltyAbilityThisTurn(false);
setTappedLandForManaThisTurn(false);
setLandsPlayedLastTurn(getLandsPlayedThisTurn());
......
......@@ -527,7 +527,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
}
if (hasParam("PlayerAttackedWithCreatureThisTurn")
&& !player.getAttackedWithCreatureThisTurn()) {
&& player.getCreaturesAttackedThisTurn().isEmpty()) {
return false;
}
......
Name:Robber of the Rich
ManaCost:1 R
Types:Creature Human Archer Rogue
PT:2/2
K:Reach
K:Haste
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigExile | CheckSVar$ X | SVarCompare$ GTY | References$ X,Y | TriggerDescription$ Whenever CARDNAME attacks, if defending player has more cards in hand than you, exile the top card of their library.
SVar:TrigExile:DB$ Mill | Defined$ TriggeredDefendingPlayer | NumCards$ 1 | Destination$ Exile | RememberMilled$ True | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ STPlay | SVars$ Z | SubAbility$ DBCleanup | ExileOnMoved$ Exile | Duration$ Permanent
SVar:STPlay:Mode$ Continuous | MayPlay$ True | MayPlayIgnoreColor$ True | EffectZone$ Command | Affected$ Card.IsRemembered+nonLand | AffectedZone$ Exile | CheckSVar$ Z | References$ Z | Description$ During any turn you attacked with a Rogue, you may cast that card and you may spend mana as though it were mana of any color to cast that spell.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$ValidHand Card.DefenderCtrl
SVar:Y:Count$InYourHand
SVar:Z:Count$CreaturesAttackedThisTurn_Rogue
Oracle:Reach, haste\nWhenever Robber of the Rich attacks, if defending player has more cards in hand than you, exile the top card of their library. During any turn you attacked with a Rogue, you may cast that card and you may spend mana as though it were mana of any color to cast that spell.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment