mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- They do nothing. (Added Pyromancer's Goggles)
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -11678,6 +11678,7 @@ forge-gui/res/cardsfolder/p/pyrokinesis.txt svneol=native#text/plain
|
|||||||
forge-gui/res/cardsfolder/p/pyromancer_ascension.txt -text svneol=unset#text/plain
|
forge-gui/res/cardsfolder/p/pyromancer_ascension.txt -text svneol=unset#text/plain
|
||||||
forge-gui/res/cardsfolder/p/pyromancers_assault.txt -text
|
forge-gui/res/cardsfolder/p/pyromancers_assault.txt -text
|
||||||
forge-gui/res/cardsfolder/p/pyromancers_gauntlet.txt -text
|
forge-gui/res/cardsfolder/p/pyromancers_gauntlet.txt -text
|
||||||
|
forge-gui/res/cardsfolder/p/pyromancers_goggles.txt -text
|
||||||
forge-gui/res/cardsfolder/p/pyromancers_swath.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/pyromancers_swath.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/pyromancy.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/pyromancy.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/pyromania.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/pyromania.txt svneol=native#text/plain
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ public class ComputerUtilMana {
|
|||||||
// get a mana of this type from floating, bail if none available
|
// get a mana of this type from floating, bail if none available
|
||||||
final Mana mana = getMana(ai, part, sa, cost.getSourceRestriction(), (byte) -1);
|
final Mana mana = getMana(ai, part, sa, cost.getSourceRestriction(), (byte) -1);
|
||||||
if (mana != null) {
|
if (mana != null) {
|
||||||
if (ai.getManaPool().tryPayCostWithMana(sa, cost, mana)) {
|
if (ai.getManaPool().tryPayCostWithMana(sa, cost, mana, false)) {
|
||||||
manaSpentToPay.add(0, mana);
|
manaSpentToPay.add(0, mana);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -502,7 +502,7 @@ public class ComputerUtilMana {
|
|||||||
// get a mana of this type from floating, bail if none available
|
// get a mana of this type from floating, bail if none available
|
||||||
final Mana mana = getMana(ai, part, sa, cost.getSourceRestriction(), hasConverge ? cost.getColorsPaid() : -1);
|
final Mana mana = getMana(ai, part, sa, cost.getSourceRestriction(), hasConverge ? cost.getColorsPaid() : -1);
|
||||||
if (mana != null) {
|
if (mana != null) {
|
||||||
if (ai.getManaPool().tryPayCostWithMana(sa, cost, mana)) {
|
if (ai.getManaPool().tryPayCostWithMana(sa, cost, mana, test)) {
|
||||||
manaSpentToPay.add(0, mana);
|
manaSpentToPay.add(0, mana);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ public class Mana {
|
|||||||
return this.manaAbility.getKeywords();
|
return this.manaAbility.getKeywords();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean triggersWhenSpent() {
|
||||||
|
return this.manaAbility != null && manaAbility.getTriggersWhenSpent();
|
||||||
|
}
|
||||||
|
|
||||||
public final byte getColor() {
|
public final byte getColor() {
|
||||||
return this.color;
|
return this.color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class ManaPool implements Iterable<Mana> {
|
|||||||
|
|
||||||
paidAbs.add(saPayment); // assumes some part on the mana produced by the ability will get used
|
paidAbs.add(saPayment); // assumes some part on the mana produced by the ability will get used
|
||||||
for (final Mana mana : abManaPart.getLastManaProduced()) {
|
for (final Mana mana : abManaPart.getLastManaProduced()) {
|
||||||
if (tryPayCostWithMana(saPaidFor, manaCost, mana)) {
|
if (tryPayCostWithMana(saPaidFor, manaCost, mana, false)) {
|
||||||
saPaidFor.getPayingMana().add(0, mana);
|
saPaidFor.getPayingMana().add(0, mana);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,19 +218,25 @@ public class ManaPool implements Iterable<Mana> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (manaFound != null && tryPayCostWithMana(saPaidFor, manaCost, manaFound)) {
|
if (manaFound != null && tryPayCostWithMana(saPaidFor, manaCost, manaFound, false)) {
|
||||||
saPaidFor.getPayingMana().add(0, manaFound);
|
saPaidFor.getPayingMana().add(0, manaFound);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean tryPayCostWithMana(final SpellAbility sa, ManaCostBeingPaid manaCost, final Mana mana) {
|
public boolean tryPayCostWithMana(final SpellAbility sa, ManaCostBeingPaid manaCost, final Mana mana, boolean test) {
|
||||||
if (!manaCost.isNeeded(mana, this)) {
|
if (!manaCost.isNeeded(mana, this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
manaCost.payMana(mana, this);
|
manaCost.payMana(mana, this);
|
||||||
removeMana(mana);
|
removeMana(mana);
|
||||||
|
|
||||||
|
if (test) {
|
||||||
|
// If just testing, should I be running special mana bonuses?
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (mana.addsNoCounterMagic(sa) && sa.getHostCard() != null) {
|
if (mana.addsNoCounterMagic(sa) && sa.getHostCard() != null) {
|
||||||
sa.getHostCard().setCanCounter(false);
|
sa.getHostCard().setCanCounter(false);
|
||||||
}
|
}
|
||||||
@@ -267,6 +273,9 @@ public class ManaPool implements Iterable<Mana> {
|
|||||||
if (mana.addsCounters(sa)) {
|
if (mana.addsCounters(sa)) {
|
||||||
mana.getManaAbility().createETBCounters(sa.getHostCard());
|
mana.getManaAbility().createETBCounters(sa.getHostCard());
|
||||||
}
|
}
|
||||||
|
if (mana.triggersWhenSpent()) {
|
||||||
|
mana.getManaAbility().addTriggersWhenSpent(sa, sa.getHostCard());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import forge.card.mana.ManaAtom;
|
import forge.card.mana.ManaAtom;
|
||||||
|
import forge.game.trigger.Trigger;
|
||||||
|
import forge.game.trigger.TriggerHandler;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import forge.card.ColorSet;
|
import forge.card.ColorSet;
|
||||||
@@ -59,6 +61,7 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
private final String addsKeyowrdsType;
|
private final String addsKeyowrdsType;
|
||||||
private final String addsKeywordsUntil;
|
private final String addsKeywordsUntil;
|
||||||
private final String addsCounters;
|
private final String addsCounters;
|
||||||
|
private final String triggersWhenSpent;
|
||||||
private final boolean persistentMana;
|
private final boolean persistentMana;
|
||||||
private String manaReplaceType;
|
private String manaReplaceType;
|
||||||
|
|
||||||
@@ -88,6 +91,7 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
this.addsKeyowrdsType = params.get("AddsKeywordsType");
|
this.addsKeyowrdsType = params.get("AddsKeywordsType");
|
||||||
this.addsKeywordsUntil = params.get("AddsKeywordsUntil");
|
this.addsKeywordsUntil = params.get("AddsKeywordsUntil");
|
||||||
this.addsCounters = params.get("AddsCounters");
|
this.addsCounters = params.get("AddsCounters");
|
||||||
|
this.triggersWhenSpent = params.get("TriggersWhenSpent");
|
||||||
this.persistentMana = (null == params.get("PersistentMana")) ? false :
|
this.persistentMana = (null == params.get("PersistentMana")) ? false :
|
||||||
"True".equalsIgnoreCase(params.get("PersistentMana"));
|
"True".equalsIgnoreCase(params.get("PersistentMana"));
|
||||||
this.manaReplaceType = params.containsKey("ManaReplaceType") ? params.get("ManaReplaceType") : "";
|
this.manaReplaceType = params.containsKey("ManaReplaceType") ? params.get("ManaReplaceType") : "";
|
||||||
@@ -268,6 +272,19 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getTriggersWhenSpent() {
|
||||||
|
return this.triggersWhenSpent != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addTriggersWhenSpent(SpellAbility saBeingPaid, Card card) {
|
||||||
|
if (this.triggersWhenSpent == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TriggerHandler handler = card.getGame().getTriggerHandler();
|
||||||
|
Trigger trig = TriggerHandler.parseTrigger(sourceCard.getSVar(this.triggersWhenSpent), sourceCard, false);
|
||||||
|
handler.registerOneTrigger(trig);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* getManaRestrictions.
|
* getManaRestrictions.
|
||||||
|
|||||||
@@ -241,6 +241,14 @@ public class TriggerHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean registerOneTrigger(final Trigger t) {
|
||||||
|
if (isTriggerActive(t)) {
|
||||||
|
activeTriggers.add(t);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public final void runTrigger(final TriggerType mode, final Map<String, Object> runParams, boolean holdTrigger) {
|
public final void runTrigger(final TriggerType mode, final Map<String, Object> runParams, boolean holdTrigger) {
|
||||||
if (suppressedModes.contains(mode)) {
|
if (suppressedModes.contains(mode)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
8
forge-gui/res/cardsfolder/p/pyromancers_goggles.txt
Normal file
8
forge-gui/res/cardsfolder/p/pyromancers_goggles.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Name:Pyromancer's Goggles
|
||||||
|
ManaCost:5
|
||||||
|
Types:Legendary Artifact
|
||||||
|
A:AB$ Mana | Cost$ T | Produced$ R | TriggersWhenSpent$ TrigCopy | SpellDescription$ Add {R} to your mana pool. When that mana is spent to cast a red instant or sorcery spell, copy that spell and you may choose new targets for the copy.
|
||||||
|
SVar:TrigCopy:Mode$ SpellCast | ValidCard$ Instant.Red,Sorcery.Red | ValidActivatingPlayer$ You | OneOff$ True | Execute$ TrigCopyMain | TriggerDescription$ When that mana is spent to cast a red instant or sorcery spell, copy that spell and you may choose new targets for the copy.
|
||||||
|
SVar:TrigCopyMain:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | SubAbility$ DBCleanup
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/pyromancers_goggles.jpg
|
||||||
|
Oracle:{T}: Add {R} to your mana pool. When that mana is spent to cast a red instant or sorcery spell, copy that spell and you may choose new targets for the copy.
|
||||||
Reference in New Issue
Block a user