- ORI: Added Kytheon, Hero of Akros

This commit is contained in:
swordshine
2015-06-20 11:28:36 +00:00
parent f83d43d8bb
commit 105332a6b8
9 changed files with 47 additions and 15 deletions

View File

@@ -268,6 +268,7 @@ public class GameAction {
c.setTapped(false); //untap card after it leaves the battlefield if needed
game.fireEvent(new GameEventCardTapped(c, false));
}
c.setMustAttackEntity(null);
}
// Need to apply any static effects to produce correct triggers

View File

@@ -35,6 +35,10 @@ public class MustAttackEffect extends SpellAbilityEffect {
sb.append("Creatures ").append(player).append(" controls attack ");
sb.append(defender).append(" during his or her next turn.");
}
for (final Card c : getTargetCards(sa)) {
sb.append(c).append(" must attack ");
sb.append(defender).append(" during its controller's next turn if able.");
}
return sb.toString();
}
@@ -43,22 +47,27 @@ public class MustAttackEffect extends SpellAbilityEffect {
public void resolve(SpellAbility sa) {
final List<Player> tgtPlayers = getTargetPlayers(sa);
final TargetRestrictions tgt = sa.getTargetRestrictions();
final String defender = sa.getParam("Defender");
final GameEntity entity;
if (defender.equals("Self")) {
entity = sa.getHostCard();
} else if (defender.equals("You")) {
entity = sa.getActivatingPlayer();
} else {
throw new RuntimeException("Illegal defender " + defender + " for MustAttackEffect in card " + sa.getHostCard());
}
// System.out.println("Setting mustAttackEntity to: "+entity);
for (final Player p : tgtPlayers) {
if ((tgt == null) || p.canBeTargetedBy(sa)) {
final String defender = sa.getParam("Defender");
final GameEntity entity;
if (defender.equals("Self")) {
entity = sa.getHostCard();
} else if (defender.equals("You")) {
entity = sa.getActivatingPlayer();
} else {
throw new RuntimeException("Illegal defender " + defender + " for MustAttackEffect in card " + sa.getHostCard());
}
// System.out.println("Setting mustAttackEntity to: "+entity);
p.setMustAttackEntity(entity);
}
}
for (final Card c : getTargetCards(sa)) {
if ((tgt == null) || c.canBeTargetedBy(sa)) {
c.setMustAttackEntity(entity);
}
}
} // mustAttackResolve()

View File

@@ -151,6 +151,7 @@ public class Card extends GameEntity implements Comparable<Card> {
// if this card is an Aura, what Entity is it enchanting?
private GameEntity enchanting = null;
private GameEntity mustAttackEntity = null;
private final Map<Player, CardPlayOption> mayPlay = Maps.newTreeMap();
@@ -881,6 +882,18 @@ public class Card extends GameEntity implements Comparable<Card> {
mustBlockCards = view.clearCards(mustBlockCards, TrackableProperty.MustBlockCards);
}
public final void setMustAttackEntity(final GameEntity e) {
mustAttackEntity = e;
}
public final GameEntity getMustAttackEntity() {
return mustAttackEntity;
}
public final void clearMustAttackEntity(final Player playerturn) {
if (this.getController().equals(playerturn)) {
mustAttackEntity = null;
}
}
public final CardCollectionView getClones() {
return CardCollection.getView(clones);
}
@@ -4931,6 +4944,10 @@ public class Card extends GameEntity implements Comparable<Card> {
if (property.equals("attackingYou")) return combat.isAttacking(this, sourceController);
} else if (property.startsWith("notattacking")) {
return null == combat || !combat.isAttacking(this);
} else if (property.equals("attackedThisCombat")) {
if (null == combat || !this.getDamageHistory().getCreatureAttackedThisCombat()) {
return false;
}
} else if (property.equals("attackedBySourceThisCombat")) {
if (null == combat) return false;
final GameEntity defender = combat.getDefenderByAttacker(source);
@@ -6320,6 +6337,7 @@ public class Card extends GameEntity implements Comparable<Card> {
getDamageHistory().newTurn();
setRegeneratedThisTurn(0);
setBecameTargetThisTurn(false);
clearMustAttackEntity(turn);
clearMustBlockCards();
getDamageHistory().setCreatureAttackedLastTurnOf(turn, getDamageHistory().getCreatureAttackedThisTurn());
getDamageHistory().setCreatureAttackedThisTurn(false);

View File

@@ -45,6 +45,10 @@ public class AttackRequirement {
nAttackAnything++;
}
}
final GameEntity mustAttack3 = attacker.getMustAttackEntity();
if (mustAttack3 != null) {
defenderSpecific.add(mustAttack3);
}
final Game game = attacker.getGame();
for (final GameEntity defender : possibleDefenders) {

View File

@@ -4,7 +4,7 @@ Types:Artifact Creature Bird
PT:0/4
K:Flying
K:etbCounter:P1P0:4
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attacking+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.Self+attackedThisCombat,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
SVar:TrigSubCounter:AB$ RemoveCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P0 | CounterNum$ 1
A:AB$ PutCounter | Cost$ X T | Defined$ Self | UpTo$ True | MaxFromEffect$ 4 | CounterType$ P1P0 | CounterNum$ X | ActivationPhases$ Upkeep | PlayerTurn$ True | References$ X | SpellDescription$ Put up to X +1/+0 counters on CARDNAME. This ability can't cause the total number of +1/+0 counters on CARDNAME to be greater than four. Activate this ability only during your upkeep.
SVar:X:Count$xPaid

View File

@@ -3,7 +3,7 @@ ManaCost:6
Types:Artifact Creature Beast
PT:0/4
K:etbCounter:P1P0:7
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attacking+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attackedThisCombat+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
SVar:TrigSubCounter:AB$ RemoveCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P0 | CounterNum$ 1
A:AB$ PutCounter | Cost$ X T | Defined$ Self | UpTo$ True | MaxFromEffect$ 7 | CounterType$ P1P0 | CounterNum$ X | ActivationPhases$ Upkeep | PlayerTurn$ True | References$ X | SpellDescription$ Put up to X +1/+0 counters on CARDNAME. This ability can't cause the total number of +1/+0 counters on CARDNAME to be greater than seven. Activate this ability only during your upkeep.
SVar:X:Count$xPaid

View File

@@ -4,7 +4,7 @@ Types:Artifact Creature Horse
PT:0/3
K:etbCounter:P1P0:4
K:CantBeBlockedBy Artifact.Creature
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attacking+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attackedThisCombat+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
SVar:TrigSubCounter:AB$ RemoveCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P0 | CounterNum$ 1
A:AB$ PutCounter | Cost$ X T | Defined$ Self | UpTo$ True | MaxFromEffect$ 4 | CounterType$ P1P0 | CounterNum$ X | ActivationPhases$ Upkeep | PlayerTurn$ True | References$ X | SpellDescription$ Put up to X +1/+0 counters on CARDNAME. This ability can't cause the total number of +1/+0 counters on CARDNAME to be greater than four. Activate this ability only during your upkeep.
SVar:X:Count$xPaid

View File

@@ -4,7 +4,7 @@ Types:Artifact Creature Insect
PT:0/3
K:etbCounter:P1P0:4
K:CantBeBlockedBy Creature.Wall
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attacking+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attackedThisCombat+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigSubCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, remove a +1/+0 counter from it.
SVar:TrigSubCounter:AB$ RemoveCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P0 | CounterNum$ 1
A:AB$ PutCounter | Cost$ X T | Defined$ Self | UpTo$ True | MaxFromEffect$ 4 | CounterType$ P1P0 | CounterNum$ X | ActivationPhases$ Upkeep | PlayerTurn$ True | References$ X | SpellDescription$ Put up to X +1/+0 counters on CARDNAME. This ability can't cause the total number of +1/+0 counters on CARDNAME to be greater than four. Activate this ability only during your upkeep.
SVar:X:Count$xPaid

View File

@@ -2,7 +2,7 @@ Name:Kjeldoran Home Guard
ManaCost:3 W
Types:Creature Human Soldier
PT:1/6
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attacking+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, put a -0/-1 counter on CARDNAME and put a 0/1 white Deserter creature token onto the battlefield.
T:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | IsPresent$ Card.attackedThisCombat+Self,Card.blocking+Self | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At end of combat, if CARDNAME attacked or blocked this combat, put a -0/-1 counter on CARDNAME and put a 0/1 white Deserter creature token onto the battlefield.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ M0M1 | CounterNum$ 1 | SubAbility$ DBToken
SVar:DBToken:DB$Token | TokenAmount$ 1 | TokenName$ Deserter | TokenTypes$ Creature,Deserter | TokenOwner$ You | TokenColors$ White | TokenPower$ 0 | TokenToughness$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/kjeldoran_home_guard.jpg