-- Added Konda's Banner and O-Naginata

This commit is contained in:
swordshine
2013-03-28 04:47:58 +00:00
parent 04e461f275
commit d048f06c7c
5 changed files with 79 additions and 5 deletions

2
.gitattributes vendored
View File

@@ -5755,6 +5755,7 @@ res/cardsfolder/k/kodamas_might.txt -text
res/cardsfolder/k/kodamas_reach.txt svneol=native#text/plain
res/cardsfolder/k/kokusho_the_evening_star.txt svneol=native#text/plain
res/cardsfolder/k/konda_lord_of_eiganjo.txt svneol=native#text/plain
res/cardsfolder/k/kondas_banner.txt -text
res/cardsfolder/k/kondas_hatamoto.txt svneol=native#text/plain
res/cardsfolder/k/kongming_sleeping_dragon.txt svneol=native#text/plain
res/cardsfolder/k/kongmings_contraptions.txt -text
@@ -7301,6 +7302,7 @@ res/cardsfolder/n/nurturer_initiate.txt svneol=native#text/plain
res/cardsfolder/n/nurturing_licid.txt -text
res/cardsfolder/n/nut_collector.txt svneol=native#text/plain
res/cardsfolder/n/nyxathid.txt svneol=native#text/plain
res/cardsfolder/o/o_naginata.txt -text
res/cardsfolder/o/oak_street_innkeeper.txt -text
res/cardsfolder/o/oaken_brawler.txt svneol=native#text/plain
res/cardsfolder/o/oakenform.txt svneol=native#text/plain

View File

@@ -0,0 +1,13 @@
Name:Konda's Banner
ManaCost:2
Types:Legendary Artifact Equipment
Text:CARDNAME can be attached only to a legendary creature.
K:CantEquip Creature.nonLegendary
K:Equip 2
S:Mode$ Continuous | Affected$ Creature.SharesColorWith Equipped | AddPower$ 1 | AddToughness$ 1 | Description$ Creatures that share a color with equipped creature get +1/+1.
S:Mode$ Continuous | Affected$ Creature.sharesCreatureTypeWith Equipped | AddPower$ 1 | AddToughness$ 1 | Description$ Creatures that share a creature type with equipped creature get +1/+1.
SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/kondas_banner.jpg
Oracle:Konda's Banner can be attached only to a legendary creature.\nCreatures that share a color with equipped creature get +1/+1.\nCreatures that share a creature type with equipped creature get +1/+1.\nEquip {2}
SetInfo:CHK Rare

View File

@@ -0,0 +1,12 @@
Name:O-Naginata
ManaCost:1
Types:Artifact Equipment
Text:CARDNAME can be attached only to a creature with 3 or more power.
K:Equip 2
K:CantEquip Creature.powerLT3
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 3 | AddKeyword$ Trample | Description$ Equipped creature gets +3/+0 and has trample.
SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/o_naginata.jpg
Oracle:O-Naginata can be attached only to a creature with 3 or more power.\nEquipped creature gets +3/+0 and has trample.\nEquip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)
SetInfo:SOK Uncommon

View File

@@ -2190,7 +2190,8 @@ public class Card extends GameEntity implements Comparable<Card> {
if (keyword.startsWith("Permanents don't untap during their controllers' untap steps")
|| keyword.startsWith("PreventAllDamageBy")
|| keyword.startsWith("CantBlock")
|| keyword.startsWith("CantBeBlockedBy")) {
|| keyword.startsWith("CantBeBlockedBy")
|| keyword.startsWith("CantEquip")) {
continue;
}
if (keyword.startsWith("CostChange")) {
@@ -3701,6 +3702,17 @@ public class Card extends GameEntity implements Comparable<Card> {
+ " but it can't be equipped.", 2);
return;
}
if (this.hasStartOfKeyword("CantEquip")) {
final int keywordPosition = this.getKeywordPosition("CantEquip");
final String parse = this.getKeyword().get(keywordPosition).toString();
final String[] k = parse.split(" ", 2);
final String[] restrictions = k[1].split(",");
if (c.isValid(restrictions, this.getController(), this)) {
Singletons.getModel().getGame().getGameLog().add("ResolveStack", "Trying to equip " + c.getName()
+ " but it can't be equipped.", 2);
return;
}
}
if (this.isEquipping()) {
this.unEquipCard(this.getEquipping().get(0));
}
@@ -6529,6 +6541,12 @@ public class Card extends GameEntity implements Comparable<Card> {
return false;
}
}
} else if (restriction.equals("Equipped")) {
if (!source.isEquipment() || !source.isEquipping()) {
return false;
} else if (!this.sharesColorWith(source.getEquippingCard())) {
return false;
}
} else if (restriction.equals("MostProminentColor")) {
for (final String color : CardUtil.getColors(this)) {
if (CardFactoryUtil.isMostProminentColor(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield), color)) {
@@ -6594,6 +6612,11 @@ public class Card extends GameEntity implements Comparable<Card> {
}
}
}
} if (restriction.equals("Equipped")) {
if (source.isEquipping() && this.sharesCreatureTypeWith(source.getEquippingCard())) {
return true;
}
return false;
} if (restriction.equals("Remembered")) {
for (final Object rem : source.getRemembered()) {
if (rem instanceof Card) {
@@ -8849,6 +8872,31 @@ public class Card extends GameEntity implements Comparable<Card> {
}
return true;
}
/**
* canBeEquippedBy.
*
* @param equip
* a Card
* @return a boolean
*/
public final boolean canBeEquippedBy(final Card equip) {
if (equip.hasStartOfKeyword("CantEquip")) {
final int keywordPosition = equip.getKeywordPosition("CantEquip");
final String parse = equip.getKeyword().get(keywordPosition).toString();
final String[] k = parse.split(" ", 2);
final String[] restrictions = k[1].split(",");
if (this.isValid(restrictions, equip.getController(), equip)) {
return false;
}
}
if (this.hasProtectionFrom(equip)
|| this.hasKeyword("CARDNAME can't be equipped.")
|| !this.isValid("Creature.YouCtrl", equip.getController(), equip)) {
return false;
}
return true;
}
/**
* Gets the replacement effects.

View File

@@ -957,13 +957,12 @@ public class GameAction {
if (c.isEquipping()) {
final Card equippedCreature = c.getEquipping().get(0);
if (!equippedCreature.isCreature() || !equippedCreature.isInPlay()) {
if (!equippedCreature.isCreature() || !equippedCreature.isInPlay()
|| !equippedCreature.canBeEquippedBy(c)) {
c.unEquipCard(equippedCreature);
checkAgain = true;
}
// make sure any equipment that has become a creature stops
// equipping
// make sure any equipment that has become a creature stops equipping
if (c.isCreature()) {
c.unEquipCard(equippedCreature);
checkAgain = true;