mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Added first functionality to ReduceCostAbility.
- Converted Helm of Awakening.
This commit is contained in:
@@ -2,7 +2,7 @@ Name:Helm of Awakening
|
||||
ManaCost:2
|
||||
Types:Artifact
|
||||
Text:no text
|
||||
K:CostChange:All:Less:1:Spell:All:All:NoSpecial:Spells cost 1 less to cast.
|
||||
S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Amount$ 1 | Description$ Spells cost 1 less to cast.
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/helm_of_awakening.jpg
|
||||
SetInfo:VIS|Uncommon|http://magiccards.info/scans/en/vi/145.jpg
|
||||
|
||||
@@ -2470,12 +2470,12 @@ public class GameAction {
|
||||
} // Khalni Hydra
|
||||
|
||||
// Reduce cost
|
||||
/*for (Card c : cardsInPlay) {
|
||||
for (Card c : AllZoneUtil.getCardsIn(ZoneType.Battlefield)) {
|
||||
final ArrayList<StaticAbility> staticAbilities = c.getStaticAbilities();
|
||||
for (final StaticAbility stAb : staticAbilities) {
|
||||
manaCost = stAb.applyAbility("ReduceCost", spell, manaCost);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return manaCost;
|
||||
} // GetSpellCostChange
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ package forge.card.staticability;
|
||||
import java.util.HashMap;
|
||||
|
||||
import forge.Card;
|
||||
import forge.card.cardfactory.CardFactoryUtil;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.game.player.Player;
|
||||
@@ -83,17 +84,17 @@ public class StaticAbilityCostChange {
|
||||
final Card hostCard = staticAbility.getHostCard();
|
||||
final Player activator = sa.getActivatingPlayer();
|
||||
final Card card = sa.getSourceCard();
|
||||
final String amount = params.get("Amount");
|
||||
final ManaCost manaCost = new ManaCost(originalCost.toString());
|
||||
|
||||
if (params.containsKey("ValidCard")
|
||||
&& !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||
return originalCost;
|
||||
}
|
||||
|
||||
if (params.containsKey("Activator") && ((activator == null)
|
||||
|| !activator.isValid(params.get("Activator"), hostCard.getController(), hostCard))) {
|
||||
return originalCost;
|
||||
}
|
||||
|
||||
if (params.containsKey("Type") && params.get("Type").equals("Spell") && !sa.isSpell()) {
|
||||
return originalCost;
|
||||
}
|
||||
@@ -101,7 +102,17 @@ public class StaticAbilityCostChange {
|
||||
return originalCost;
|
||||
}
|
||||
|
||||
//modify the cost here
|
||||
return originalCost;
|
||||
if (!"WUGRB".contains(amount)) {
|
||||
int value = 0;
|
||||
if ("X".equals(amount)) {
|
||||
value = CardFactoryUtil.xCount(card, card.getSVar("X"));
|
||||
} else {
|
||||
value = Integer.valueOf(amount);
|
||||
}
|
||||
|
||||
manaCost.decreaseColorlessMana(value);
|
||||
}
|
||||
|
||||
return manaCost;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user