mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +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
|
ManaCost:2
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
Text:no text
|
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:Rarity:Uncommon
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/helm_of_awakening.jpg
|
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
|
SetInfo:VIS|Uncommon|http://magiccards.info/scans/en/vi/145.jpg
|
||||||
|
|||||||
@@ -2470,12 +2470,12 @@ public class GameAction {
|
|||||||
} // Khalni Hydra
|
} // Khalni Hydra
|
||||||
|
|
||||||
// Reduce cost
|
// Reduce cost
|
||||||
/*for (Card c : cardsInPlay) {
|
for (Card c : AllZoneUtil.getCardsIn(ZoneType.Battlefield)) {
|
||||||
final ArrayList<StaticAbility> staticAbilities = c.getStaticAbilities();
|
final ArrayList<StaticAbility> staticAbilities = c.getStaticAbilities();
|
||||||
for (final StaticAbility stAb : staticAbilities) {
|
for (final StaticAbility stAb : staticAbilities) {
|
||||||
manaCost = stAb.applyAbility("ReduceCost", spell, manaCost);
|
manaCost = stAb.applyAbility("ReduceCost", spell, manaCost);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
return manaCost;
|
return manaCost;
|
||||||
} // GetSpellCostChange
|
} // GetSpellCostChange
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package forge.card.staticability;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -83,17 +84,17 @@ public class StaticAbilityCostChange {
|
|||||||
final Card hostCard = staticAbility.getHostCard();
|
final Card hostCard = staticAbility.getHostCard();
|
||||||
final Player activator = sa.getActivatingPlayer();
|
final Player activator = sa.getActivatingPlayer();
|
||||||
final Card card = sa.getSourceCard();
|
final Card card = sa.getSourceCard();
|
||||||
|
final String amount = params.get("Amount");
|
||||||
|
final ManaCost manaCost = new ManaCost(originalCost.toString());
|
||||||
|
|
||||||
if (params.containsKey("ValidCard")
|
if (params.containsKey("ValidCard")
|
||||||
&& !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
&& !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return originalCost;
|
return originalCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("Activator") && ((activator == null)
|
if (params.containsKey("Activator") && ((activator == null)
|
||||||
|| !activator.isValid(params.get("Activator"), hostCard.getController(), hostCard))) {
|
|| !activator.isValid(params.get("Activator"), hostCard.getController(), hostCard))) {
|
||||||
return originalCost;
|
return originalCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("Type") && params.get("Type").equals("Spell") && !sa.isSpell()) {
|
if (params.containsKey("Type") && params.get("Type").equals("Spell") && !sa.isSpell()) {
|
||||||
return originalCost;
|
return originalCost;
|
||||||
}
|
}
|
||||||
@@ -101,7 +102,17 @@ public class StaticAbilityCostChange {
|
|||||||
return originalCost;
|
return originalCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
//modify the cost here
|
if (!"WUGRB".contains(amount)) {
|
||||||
return originalCost;
|
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