mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Added Weight of Conscience
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -12038,6 +12038,7 @@ res/cardsfolder/w/wei_infantry.txt svneol=native#text/plain
|
|||||||
res/cardsfolder/w/wei_night_raiders.txt svneol=native#text/plain
|
res/cardsfolder/w/wei_night_raiders.txt svneol=native#text/plain
|
||||||
res/cardsfolder/w/wei_scout.txt svneol=native#text/plain
|
res/cardsfolder/w/wei_scout.txt svneol=native#text/plain
|
||||||
res/cardsfolder/w/wei_strike_force.txt svneol=native#text/plain
|
res/cardsfolder/w/wei_strike_force.txt svneol=native#text/plain
|
||||||
|
res/cardsfolder/w/weight_of_conscience.txt -text
|
||||||
res/cardsfolder/w/weight_of_spires.txt -text
|
res/cardsfolder/w/weight_of_spires.txt -text
|
||||||
res/cardsfolder/w/weird_harvest.txt -text
|
res/cardsfolder/w/weird_harvest.txt -text
|
||||||
res/cardsfolder/w/weirding_shaman.txt svneol=native#text/plain
|
res/cardsfolder/w/weirding_shaman.txt svneol=native#text/plain
|
||||||
|
|||||||
10
res/cardsfolder/w/weight_of_conscience.txt
Normal file
10
res/cardsfolder/w/weight_of_conscience.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Name:Weight of Conscience
|
||||||
|
ManaCost:1 W
|
||||||
|
Types:Enchantment Aura
|
||||||
|
K:Enchant creature
|
||||||
|
A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Curse
|
||||||
|
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ CARDNAME can't attack. | Description$ Enchanted creature can't attack.
|
||||||
|
A:AB$ ChangeZone | Cost$ tapXType<2/Creature.sharesCreatureTypeWith/creatures that share a creature type> | Defined$ Enchanted | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile enchanted creature.
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/weight_of_conscience.jpg
|
||||||
|
Oracle:Enchant creature\nEnchanted creature can't attack.\nTap two untapped creatures you control that share a creature type: Exile enchanted creature.
|
||||||
|
SetInfo:MOR Common
|
||||||
@@ -19,8 +19,12 @@ package forge.card.cost;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.CardLists;
|
import forge.CardLists;
|
||||||
|
import forge.CardPredicates;
|
||||||
import forge.CardPredicates.Presets;
|
import forge.CardPredicates.Presets;
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
@@ -80,11 +84,14 @@ public class CostTapType extends CostPartWithList {
|
|||||||
|
|
||||||
final Integer i = this.convertAmount();
|
final Integer i = this.convertAmount();
|
||||||
final String desc = this.getDescription();
|
final String desc = this.getDescription();
|
||||||
|
final String type = this.getType();
|
||||||
|
|
||||||
|
if (type.contains("sharesCreatureTypeWith")) {
|
||||||
|
sb.append("two untapped creatures you control that share a creature type");
|
||||||
|
} else {
|
||||||
sb.append(Cost.convertAmountTypeToWords(i, this.getAmount(), "untapped " + desc));
|
sb.append(Cost.convertAmountTypeToWords(i, this.getAmount(), "untapped " + desc));
|
||||||
|
|
||||||
sb.append(" you control");
|
sb.append(" you control");
|
||||||
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,14 +122,35 @@ public class CostTapType extends CostPartWithList {
|
|||||||
final Card source = ability.getSourceCard();
|
final Card source = ability.getSourceCard();
|
||||||
|
|
||||||
List<Card> typeList = new ArrayList<Card>(activator.getCardsIn(ZoneType.Battlefield));
|
List<Card> typeList = new ArrayList<Card>(activator.getCardsIn(ZoneType.Battlefield));
|
||||||
|
String type = this.getType();
|
||||||
|
boolean sameType = false;
|
||||||
|
|
||||||
typeList = CardLists.getValidCards(typeList, this.getType().split(";"), activator, source);
|
if (type.contains("sharesCreatureTypeWith")) {
|
||||||
|
sameType = true;
|
||||||
|
type = type.replace("sharesCreatureTypeWith", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
typeList = CardLists.getValidCards(typeList, type.split(";"), activator, source);
|
||||||
|
|
||||||
if (!canTapSource) {
|
if (!canTapSource) {
|
||||||
typeList.remove(source);
|
typeList.remove(source);
|
||||||
}
|
}
|
||||||
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
||||||
|
|
||||||
|
if (sameType) {
|
||||||
|
for (final Card card : typeList) {
|
||||||
|
if (CardLists.filter(typeList, new Predicate<Card>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(final Card c) {
|
||||||
|
return c.sharesCreatureTypeWith(card);
|
||||||
|
}
|
||||||
|
}).size() > 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
final Integer amount = this.convertAmount();
|
final Integer amount = this.convertAmount();
|
||||||
if ((typeList.size() == 0) || ((amount != null) && (typeList.size() < amount))) {
|
if ((typeList.size() == 0) || ((amount != null) && (typeList.size() < amount))) {
|
||||||
return false;
|
return false;
|
||||||
@@ -141,8 +169,29 @@ public class CostTapType extends CostPartWithList {
|
|||||||
@Override
|
@Override
|
||||||
public final boolean payHuman(final SpellAbility ability, final GameState game) {
|
public final boolean payHuman(final SpellAbility ability, final GameState game) {
|
||||||
List<Card> typeList = new ArrayList<Card>(ability.getActivatingPlayer().getCardsIn(ZoneType.Battlefield));
|
List<Card> typeList = new ArrayList<Card>(ability.getActivatingPlayer().getCardsIn(ZoneType.Battlefield));
|
||||||
typeList = CardLists.getValidCards(typeList, this.getType().split(";"), ability.getActivatingPlayer(), ability.getSourceCard());
|
String type = this.getType();
|
||||||
|
boolean sameType = false;
|
||||||
|
if (type.contains("sharesCreatureTypeWith")) {
|
||||||
|
sameType = true;
|
||||||
|
type = type.replace("sharesCreatureTypeWith", "");
|
||||||
|
}
|
||||||
|
typeList = CardLists.getValidCards(typeList, type.split(";"), ability.getActivatingPlayer(), ability.getSourceCard());
|
||||||
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
||||||
|
if (sameType) {
|
||||||
|
final List<Card> List2 = typeList;
|
||||||
|
typeList = CardLists.filter(typeList, new Predicate<Card>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(final Card c) {
|
||||||
|
for (Card card : List2) {
|
||||||
|
if (!card.equals(c) && card.sharesCreatureTypeWith(c)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
final String amount = this.getAmount();
|
final String amount = this.getAmount();
|
||||||
final Card source = ability.getSourceCard();
|
final Card source = ability.getSourceCard();
|
||||||
Integer c = this.convertAmount();
|
Integer c = this.convertAmount();
|
||||||
@@ -185,6 +234,9 @@ public class CostTapType extends CostPartWithList {
|
|||||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.getType().contains("sharesCreatureTypeWith")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
List<Card> totap = ComputerUtil.chooseTapType(ai, this.getType(), source, !canTapSource, c);
|
List<Card> totap = ComputerUtil.chooseTapType(ai, this.getType(), source, !canTapSource, c);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user