- Added a new AI SVar "NonStackingAttachEffect".

This commit is contained in:
Sloth
2013-06-21 21:39:55 +00:00
parent 68d3a7cdb2
commit 06eb8e3e43
14 changed files with 37 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ K:Equip 1
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddHiddenKeyword$ CantBeBlockedBy Creature.Vampire,Creature.Zombie | Description$ Equipped creature can't be blocked by Vampires or Zombies.
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddAbility$ TorchDamage | Description$ Equipped creature has "T, Sacrifice Blazing Torch: Blazing Torch deals 2 damage to target creature or player."
SVar:TorchDamage:AB$ DealDamage | Cost$ T Sac<1/Card.Attached+namedBlazing Torch/equipped Blazing Torch> | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 2 | DamageSource$ Sacrificed | SpellDescription$ Blazing Torch deals 2 damage to target creature or player.
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/blazing_torch.jpg
Oracle:Equipped creature can't be blocked by Vampires or Zombies.\nEquipped creature has "{T}, Sacrifice Blazing Torch: Blazing Torch deals 2 damage to target creature or player."\nEquip {1}
SetInfo:ZEN Uncommon

View File

@@ -4,6 +4,7 @@ Types:Artifact Equipment
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddAbility$ BlindEnemies | Description$ Equipped creature has "Unattach CARDNAME: Prevent all combat damage that would be dealt to this creature this turn."
SVar:BlindEnemies:AB$ Pump | Cost$ Unattach<OriginalHost/Blinding Powder> | Defined$ Self | KW$ HIDDEN Prevent all combat damage that would be dealt to CARDNAME. | SpellDescription$ Prevent all combat damage that would be dealt to CARDNAME this turn.
K:Equip 2
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/blinding_powder.jpg
Oracle:Equipped creature has "Unattach Blinding Powder: Prevent all combat damage that would be dealt to this creature this turn."\nEquip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)
SetInfo:BOK Uncommon

View File

@@ -4,6 +4,7 @@ Types:Artifact
S:Mode$ Continuous | Affected$ Creature | AddPower$ AffectedX | AddToughness$ AffectedX | EffectZone$ Battlefield | Description$ Each creature gets +1/+1 for each other creature on the battlefield that shares at least one creature type with it. (For example, if two Goblin Warriors and a Goblin Shaman are on the battlefield, each gets +2/+2.)
SVar:AffectedX:Count$Valid Creature.sharesCreatureTypeWith+Other
SVar:PlayMain1:TRUE
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/coat_of_arms.jpg
Oracle:Each creature gets +1/+1 for each other creature on the battlefield that shares at least one creature type with it. (For example, if two Goblin Warriors and a Goblin Shaman are on the battlefield, each gets +2/+2.)
SetInfo:8ED Rare

View File

@@ -7,6 +7,7 @@ T:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Creature.AttachedBy | Trigg
SVar:TrigDestroy:AB$Destroy | Cost$ 0 | Defined$ TriggeredAttacker | SubAbility$ DBDestroy
SVar:DBDestroy:DB$Destroy | Defined$ TriggeredBlocker
SVar:RemAIDeck:True
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/dead_iron_sledge.jpg
Oracle:Whenever equipped creature blocks or becomes blocked by a creature, destroy both creatures.\nEquip {2} ({2}: Attach to target creature you control. Equip only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the creature leaves.)
SetInfo:MRD Uncommon

View File

@@ -7,5 +7,6 @@ SVar:HankyuPutCounter:AB$ PutCounter | Cost$ T | CounterType$ AIM | CounterNum$
SVar:HankyuDmg:AB$ DealDamage | Cost$ T SubCounter<All/AIM/OriginalHost/Hankyu> | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ HankyuX | References$ HankyuX | SpellDescription$ CARDNAME deals damage to target creature or player equal to the number of aim counters removed this way.
SVar:HankyuX:SVar$CostCountersRemoved
SVar:RemAIDeck:True
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/hankyu.jpg
Oracle:Equipped creature has "{T}: Put an aim counter on Hankyu" and "{T}, Remove all aim counters from Hankyu: This creature deals damage to target creature or player equal to the number of aim counters removed this way."\nEquip {4} ({4}: Attach to target creature you control. Equip only as a sorcery.)

View File

@@ -5,6 +5,7 @@ K:Equip 4
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. | Description$ Equipped creature doesn't untap during its controller's untap step.
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddAbility$ Damage | Description$ Equipped creature has "Tap: This creature deals 2 damage to target creature or player."
SVar:Damage:AB$DealDamage | Cost$ T | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to target creature or player.
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/heavy_arbalest.jpg
Oracle:Equipped creature doesn't untap during its controller's untap step.\nEquipped creature has "{T}: This creature deals 2 damage to target creature or player."\nEquip {4}
SetInfo:SOM Uncommon

View File

@@ -4,6 +4,7 @@ Types:Artifact Equipment
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddAbility$ BolaTap | Description$ Equipped creature has "T, Unattach CARDNAME: Tap target creature."
SVar:BolaTap:AB$ Tap | Cost$ T Unattach<OriginalHost/Leonin Bola> | ValidTgts$ Creature | SpellDescription$ Tap target creature.
K:Equip 1
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/leonin_bola.jpg
Oracle:Equipped creature has "{T}, Unattach Leonin Bola: Tap target creature."\nEquip {1} ({1}: Attach to target creature you control. Equip only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the creature leaves.)
SetInfo:DST Common

View File

@@ -4,6 +4,7 @@ Types:Artifact Equipment
K:Equip 1
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddAbility$ AnyMana | Description$ Equipped creature has "Tap: Add one mana of any color to your mana pool."
SVar:AnyMana:AB$Mana | Cost$ T | Produced$ Any | SpellDescription$ Add one mana of any color to your mana pool.
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/paradise_mantle.jpg
Oracle:Equipped creature has "{T}: Add one mana of any color to your mana pool."\nEquip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
SetInfo:5DN Uncommon

View File

@@ -5,6 +5,7 @@ S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddAbility$ RazorDamage | A
SVar:RazorDamage:AB$ DealDamage | Cost$ T Unattach<OriginalHost/Razor Boomerang> | NumDmg$ 1 | DamageSource$ OriginalHost | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | RememberCostCards$ True | SubAbility$ BoomerangCatch | SpellDescription$ Razor Boomerang deals 1 damage to target creature or player. Return Razor Boomerang to its owner's hand.
SVar:BoomerangCatch:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand | Defined$ Remembered | ForgetChanged$ True
K:Equip 2
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/razor_boomerang.jpg
Oracle:Equipped creature has "{T}, Unattach Razor Boomerang: Razor Boomerang deals 1 damage to target creature or player. Return Razor Boomerang to its owner's hand."\nEquip {2}
SetInfo:WWK Uncommon

View File

@@ -8,6 +8,7 @@ SVar:ShurikenGainCtrl:DB$ GainControl | NewController$ TargetedController | Defi
SVar:ShurikenForget:DB$ Pump | ForgetObjects$ Valid Card.IsRemembered+namedShuriken | StackDescription$ None
SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/shuriken.jpg
Oracle:Equipped creature has "{T}, Unattach Shuriken: Shuriken deals 2 damage to target creature. That creature's controller gains control of Shuriken unless it was unattached from a Ninja."\nEquip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)
SetInfo:BOK Uncommon

View File

@@ -8,6 +8,7 @@ SVar:Damage:AB$DealDamage | Cost$ 2 T | ValidTgts$ Creature,Player | TgtPrompt$
SVar:TrigChangeZone:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ ThornbiteTrigUntap | TriggerDescription$ Whenever a creature is put into a graveyard from the battlefield, untap equipped creature.
SVar:ThornbiteTrigUntap:AB$Untap | Cost$ 0
SVar:TrigAttach:DB$ Attach | Cost$ 0 | Defined$ TriggeredCard
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/thornbite_staff.jpg
Oracle:Equipped creature has <20>{2}, {T}: This creature deals 1 damage to target creature or player<65> and <20>Whenever a creature dies, untap this creature.<2E>\nWhenever a Shaman creature enters the battlefield, you may attach Thornbite Staff to it.
\nEquip {4}

View File

@@ -4,6 +4,7 @@ Types:Artifact Equipment
K:Equip 3
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddAbility$ Damage | Description$ Equipped creature has "Tap: This creature deals 1 damage to target creature or player."
SVar:Damage:AB$DealDamage | Cost$ T | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/viridian_longbow.jpg
Oracle:Equipped creature has "{T}: This creature deals 1 damage to target creature or player."\nEquip {3} ({3}: Attach to target creature you control. Equip only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the creature leaves.)
SetInfo:MRD Common

View File

@@ -5,6 +5,7 @@ K:Equip 5
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddAbility$ Damage & DamageWerewolf | Description$ Equipped creature has "Tap: This creature deals 1 damage to target creature or player" and "Tap: This creature deals 3 damage to target Werewolf creature."
SVar:Damage:AB$DealDamage | Cost$ T | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
SVar:DamageWerewolf:AB$DealDamage | Cost$ T | ValidTgts$ Creature.Werewolf | TgtPrompt$ Select target Werewolf creature | NumDmg$ 3 | SpellDescription$ CARDNAME deals 3 damage to target Werewolf creature.
SVar:NonStackingAttachEffect:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/wolfhunters_quiver.jpg
Oracle:Equipped creature has "{T}: This creature deals 1 damage to target creature or player" and "{T}: This creature deals 3 damage to target Werewolf creature."\nEquip {5}
SetInfo:DKA Uncommon

View File

@@ -32,7 +32,6 @@ import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.player.PlayerActionConfirmMode;
import forge.game.zone.ZoneType;
import forge.util.MyRandom;
public class AttachAi extends SpellAbilityAi {
@@ -618,6 +617,7 @@ public class AttachAi extends SpellAbilityAi {
targets = AbilityUtils.getDefinedObjects(sa.getSourceCard(), sa.getParam("Defined"), sa);
} else {
AttachAi.attachPreference(sa, tgt, mandatory);
targets = sa.getTargets().getTargets();
}
if (!mandatory && card.isEquipment() && !targets.isEmpty()) {
@@ -633,6 +633,13 @@ public class AttachAi extends SpellAbilityAi {
if (ComputerUtilCard.evaluateCreature(oldTarget) > ComputerUtilCard.evaluateCreature(newTarget)) {
return false;
}
// don't equip creatures that don't gain anything
if (card.hasSVar("NonStackingAttachEffect")) {
for (Card equipment : newTarget.getEquippedBy()) {
if (equipment.getName().equals(card.getName()))
return false;
}
}
}
}
@@ -739,7 +746,7 @@ public class AttachAi extends SpellAbilityAi {
});
}
if ((magnetList != null) && !magnetList.isEmpty()) {
if (magnetList != null && !magnetList.isEmpty()) {
// Always choose something from the Magnet List.
// Probably want to "weight" the list by amount of Enchantments and
// choose the "lightest"
@@ -815,6 +822,20 @@ public class AttachAi extends SpellAbilityAi {
});
}
//some equipments aren't useful in multiples
if (attachSource.hasSVar("NonStackingAttachEffect")) {
prefList = CardLists.filter(prefList, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
for (Card equipment : c.getEquippedBy()) {
if (equipment.getName().equals(attachSource.getName()))
return false;
}
return true;
}
});
}
// Don't pump cards that will die.
prefList = ComputerUtil.getSafeTargets(ai, sa, prefList);
@@ -883,7 +904,7 @@ public class AttachAi extends SpellAbilityAi {
// I believe this is the only case where mandatory will be true, so just
// check that when starting that work
// But we shouldn't attach to things with Protection
if (tgt.getZone().contains(ZoneType.Battlefield) && !mandatory) {
if (!mandatory) {
list = CardLists.getTargetableCards(list, sa);
} else {
list = CardLists.filter(list, Predicates.not(CardPredicates.isProtectedFrom(attachSource)));