mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- SetStateAi: allow AILogic$ Always on SetState transform triggers (set this on Vance's Blasting Cannons).
This commit is contained in:
@@ -87,6 +87,7 @@ public class SetStateAi extends SpellAbilityAi {
|
||||
protected boolean checkPhaseRestrictions(Player ai, SpellAbility sa, PhaseHandler ph) {
|
||||
final String mode = sa.getParam("Mode");
|
||||
final Card source = sa.getHostCard();
|
||||
final String logic = sa.getParamOrDefault("AILogic", "");
|
||||
final Game game = source.getGame();
|
||||
|
||||
if("Transform".equals(mode)) {
|
||||
@@ -95,7 +96,7 @@ public class SetStateAi extends SpellAbilityAi {
|
||||
if (source.hasKeyword("CARDNAME can't transform")) {
|
||||
return false;
|
||||
}
|
||||
return shouldTransformCard(source, ai, ph);
|
||||
return shouldTransformCard(source, ai, ph) || "Always".equals(logic);
|
||||
} else {
|
||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||
sa.resetTargets();
|
||||
@@ -117,7 +118,7 @@ public class SetStateAi extends SpellAbilityAi {
|
||||
}
|
||||
|
||||
for (final Card c : list) {
|
||||
if (shouldTransformCard(c, ai, ph)) {
|
||||
if (shouldTransformCard(c, ai, ph) || "Always".equals(logic)) {
|
||||
sa.getTargets().add(c);
|
||||
if (sa.getTargets().getNumTargeted() == tgt.getMaxTargets(source, sa)) {
|
||||
break;
|
||||
@@ -135,7 +136,7 @@ public class SetStateAi extends SpellAbilityAi {
|
||||
if (list.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return shouldTurnFace(list.get(0), ai, ph);
|
||||
return shouldTurnFace(list.get(0), ai, ph) || "Always".equals(logic);
|
||||
} else {
|
||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||
sa.resetTargets();
|
||||
@@ -148,7 +149,7 @@ public class SetStateAi extends SpellAbilityAi {
|
||||
}
|
||||
|
||||
for (final Card c : list) {
|
||||
if (shouldTurnFace(c, ai, ph)) {
|
||||
if (shouldTurnFace(c, ai, ph) || "Always".equals(logic)) {
|
||||
sa.getTargets().add(c);
|
||||
if (sa.getTargets().getNumTargeted() == tgt.getMaxTargets(source, sa)) {
|
||||
break;
|
||||
@@ -175,6 +176,8 @@ public class SetStateAi extends SpellAbilityAi {
|
||||
transformed.getCurrentState().copyFrom(card, card.getAlternateState());
|
||||
transformed.updateStateForView();
|
||||
|
||||
// TODO: compareCards assumes that a creature will transform into a creature. Need to improve this
|
||||
// for other things potentially transforming.
|
||||
return compareCards(card, transformed, ai, ph);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ SVar:TrigMill:DB$ Mill | Defined$ You | NumCards$ 1 | Destination$ Exile | Remem
|
||||
SVar:DBEffect:DB$ Effect | RememberObjects$ RememberedCard | ConditionDefined$ RememberedCard | ConditionPresent$ Card.nonLand | ConditionCompare$ EQ1 | StaticAbilities$ Play | SubAbility$ DBCleanup | ExileOnMoved$ Exile
|
||||
SVar:Play:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may cast the remembered nonland card.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
T:Mode$ SpellCast | ValidCard$ Card.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigTransform | CheckSVar$ YouCastThisTurn | SVarCompare$ EQ3 | NoResolvingCheck$ True | OptionalDecider$ You | TriggerDescription$ Whenever you cast your third spell in a turn, transform CARDNAME.
|
||||
SVar:TrigTransform:DB$ SetState | Defined$ Self | Mode$ Transform
|
||||
T:Mode$ SpellCast | ValidCard$ Card.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigTransform | CheckSVar$ YouCastThisTurn | SVarCompare$ EQ3 | NoResolvingCheck$ True | OptionalDecider$ You | TriggerDescription$ Whenever you cast your third spell in a turn, you may transform CARDNAME.
|
||||
SVar:TrigTransform:DB$ SetState | Defined$ Self | Mode$ Transform | AILogic$ Always
|
||||
SVar:YouCastThisTurn:Count$ThisTurnCast_Card.YouCtrl
|
||||
AlternateMode:DoubleFaced
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/vances_blasting_cannons.jpg
|
||||
|
||||
Reference in New Issue
Block a user