mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Minor edit to CardFactoryUtil.eqPump_Equip. The equipMagnetList will now add Goblin Gaveleer and Loxodon Punisher to this list.
This commit is contained in:
@@ -1727,8 +1727,9 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if (AllZone.GameAction.isCardInPlay(getTargetCard()) &&
|
if (AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||||
CardFactoryUtil.canTarget(sourceCard, getTargetCard())) {
|
&& CardFactoryUtil.canTarget(sourceCard, getTargetCard())) {
|
||||||
|
|
||||||
if (sourceCard.isEquipping()) {
|
if (sourceCard.isEquipping()) {
|
||||||
Card crd = sourceCard.getEquipping().get(0);
|
Card crd = sourceCard.getEquipping().get(0);
|
||||||
if (crd.equals(getTargetCard())) return;
|
if (crd.equals(getTargetCard())) return;
|
||||||
@@ -1742,52 +1743,59 @@ public class CardFactoryUtil {
|
|||||||
// An animated artifact equipmemt can't equip a creature
|
// An animated artifact equipmemt can't equip a creature
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(sourceCard).is(Constant.Zone.Play) &&
|
return AllZone.getZone(sourceCard).is(Constant.Zone.Play)
|
||||||
AllZone.Phase.getActivePlayer().equals(sourceCard.getController()) &&
|
&& AllZone.Phase.getActivePlayer().equals(sourceCard.getController())
|
||||||
!sourceCard.isCreature() &&
|
&& !sourceCard.isCreature()
|
||||||
(AllZone.Phase.getPhase().equals("Main1") ||
|
&& (AllZone.Phase.getPhase().equals("Main1") || AllZone.Phase.getPhase().equals("Main2"));
|
||||||
AllZone.Phase.getPhase().equals("Main2"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
return getCreature().size() != 0 &&
|
return getCreature().size() != 0
|
||||||
!sourceCard.isEquipping();
|
&& !sourceCard.isEquipping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chooseTargetAI() {
|
public void chooseTargetAI() {
|
||||||
Card target = CardFactoryUtil.AI_getBestCreature(getCreature());
|
Card target = CardFactoryUtil.AI_getBestCreature(getCreature());
|
||||||
setTargetCard(target);
|
setTargetCard(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
CardList getCreature() { // build list and do some pruning
|
CardList getCreature() {
|
||||||
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.isCreature() && (!CardFactoryUtil.AI_doesCreatureAttack(c)) &&
|
return c.isCreature()
|
||||||
CardFactoryUtil.canTarget(sourceCard, c) &&
|
&& CardFactoryUtil.AI_doesCreatureAttack(c)
|
||||||
(!c.getKeyword().contains("Defender")) &&
|
&& CardFactoryUtil.canTarget(sourceCard, c)
|
||||||
(c.getNetDefense() + Tough > 0);
|
&& (!c.getKeyword().contains("Defender"))
|
||||||
|
&& (c.getNetDefense() + Tough > 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Is there at least 1 Loxodon Punisher and/or Goblin Gaveleer to target
|
||||||
|
CardList equipMagnetList = list;
|
||||||
|
equipMagnetList = equipMagnetList.filter(new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.getName().equals("Loxodon Punisher")
|
||||||
|
|| c.getName().equals("Goblin Gaveleer");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// list.remove(card); // if mana-only cost, allow self-target
|
|
||||||
|
|
||||||
// is there at least 1 Loxodon Punisher to target
|
if (!equipMagnetList.isEmpty() && Tough >= 0) {
|
||||||
|
return equipMagnetList;
|
||||||
CardList equipMagnetList = list.getName("Loxodon Punisher");
|
|
||||||
if (equipMagnetList.size() != 0 && Tough >= -1) { // we want Loxodon Punisher to gain at least +1 toughness
|
|
||||||
return equipMagnetList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Power == 0 && Tough == 0) { // This aura is keyword only
|
// This equipment is keyword only
|
||||||
|
if (Power == 0 && Tough == 0) {
|
||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c){
|
public boolean addCard(Card c) {
|
||||||
ArrayList<String> extKeywords = new ArrayList<String>(Arrays.asList(extrinsicKeywords));
|
ArrayList<String> extKeywords = new ArrayList<String>(Arrays.asList(extrinsicKeywords));
|
||||||
for (String s:extKeywords) {
|
for (String s:extKeywords) {
|
||||||
|
|
||||||
|
// We want to give a new keyword
|
||||||
if (!c.getKeyword().contains(s))
|
if (!c.getKeyword().contains(s))
|
||||||
return true; // We want to give a new keyword
|
return true;
|
||||||
}
|
}
|
||||||
//no new keywords:
|
//no new keywords:
|
||||||
return false;
|
return false;
|
||||||
@@ -1797,7 +1805,6 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}//getCreature()
|
}//getCreature()
|
||||||
|
|
||||||
};//equip ability
|
};//equip ability
|
||||||
|
|
||||||
Input runtime = new Input() {
|
Input runtime = new Input() {
|
||||||
|
|||||||
Reference in New Issue
Block a user