mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- RemoveCounter can now handle X counters to remove using "byType" cost
- Small change to allow refunding of certain partially paid costs - Added Ooze Flux
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -7386,6 +7386,7 @@ res/cardsfolder/o/oonas_blackguard.txt svneol=native#text/plain
|
|||||||
res/cardsfolder/o/oonas_gatewarden.txt svneol=native#text/plain
|
res/cardsfolder/o/oonas_gatewarden.txt svneol=native#text/plain
|
||||||
res/cardsfolder/o/oonas_grace.txt svneol=native#text/plain
|
res/cardsfolder/o/oonas_grace.txt svneol=native#text/plain
|
||||||
res/cardsfolder/o/oonas_prowler.txt -text
|
res/cardsfolder/o/oonas_prowler.txt -text
|
||||||
|
res/cardsfolder/o/ooze_flux.txt -text
|
||||||
res/cardsfolder/o/ooze_garden.txt svneol=native#text/plain
|
res/cardsfolder/o/ooze_garden.txt svneol=native#text/plain
|
||||||
res/cardsfolder/o/opal_acrolith.txt svneol=native#text/plain
|
res/cardsfolder/o/opal_acrolith.txt svneol=native#text/plain
|
||||||
res/cardsfolder/o/opal_archangel.txt svneol=native#text/plain
|
res/cardsfolder/o/opal_archangel.txt svneol=native#text/plain
|
||||||
|
|||||||
9
res/cardsfolder/o/ooze_flux.txt
Normal file
9
res/cardsfolder/o/ooze_flux.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Name:Ooze Flux
|
||||||
|
ManaCost:3 G
|
||||||
|
Types:Enchantment
|
||||||
|
A:AB$ Token | Announce$ X | Cost$ XCantBe0 1 G SubCounter<X/P1P1/Creature/among creatures you control> | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenImage$ G X X Ooze | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | SpellDescription$ Put a green Saproling creature token onto the battlefield. It has "This creature's power and toughness are each equal to the number of fade counters on CARDNAME."
|
||||||
|
SVar:X:Count$xPaid
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/ooze_flux.jpg
|
||||||
|
Oracle:{1}{G}, Remove one or more +1/+1 counters from among creatures you control: Put an X/X green Ooze creature token onto the battlefield, where X is the number of +1/+1 counters removed this way.
|
||||||
|
SetInfo:GTC Rare
|
||||||
@@ -194,6 +194,14 @@ public class CostPayment {
|
|||||||
this.payCost();
|
this.payCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancel cost (including CostPart for refunding).
|
||||||
|
*/
|
||||||
|
public final void cancelCost(final CostPart part) {
|
||||||
|
this.setPaidManaPart(part);
|
||||||
|
this.cancelCost();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel cost.
|
* Cancel cost.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReusable() { return true; }
|
public boolean isReusable() { return true; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUndoable() { return true; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
@@ -146,8 +148,9 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final void refund(final Card source) {
|
public final void refund(final Card source) {
|
||||||
|
int refund = this.getList().size() == 1 ? this.lastPaidAmount : 1;
|
||||||
for (final Card c : this.getList()) {
|
for (final Card c : this.getList()) {
|
||||||
c.addCounter(this.counter, this.lastPaidAmount, false);
|
c.addCounter(this.counter, refund, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +228,16 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
int maxCounters = 0;
|
int maxCounters = 0;
|
||||||
|
|
||||||
if (!this.isTargetingThis()) {
|
if (!this.isTargetingThis()) {
|
||||||
|
if (c == null) {
|
||||||
|
final String sVar = ability.getSVar(amount);
|
||||||
|
// Generalize this
|
||||||
|
if (sVar.equals("XChoice")) {
|
||||||
|
c = CostUtil.chooseXValue(source, ability, maxCounters);
|
||||||
|
} else {
|
||||||
|
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.getZone().equals(ZoneType.Battlefield)) {
|
if (this.getZone().equals(ZoneType.Battlefield)) {
|
||||||
final Input inp = CostRemoveCounter.removeCounterType(ability, this.getType(), payment, this, c);
|
final Input inp = CostRemoveCounter.removeCounterType(ability, this.getType(), payment, this, c);
|
||||||
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
|
Singletons.getModel().getMatch().getInput().setInputInterrupt(inp);
|
||||||
@@ -342,14 +355,13 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
final StringBuilder msg = new StringBuilder("Remove ");
|
final StringBuilder msg = new StringBuilder("Remove ");
|
||||||
final int nLeft = nNeeded - this.nRemove;
|
final int nLeft = nNeeded - this.nRemove;
|
||||||
msg.append(nLeft).append(" ");
|
msg.append(nLeft).append(" ");
|
||||||
msg.append(costRemoveCounter.getCounter()).append(" from ");
|
msg.append(costRemoveCounter.getCounter().getName()).append(" counters from ");
|
||||||
|
|
||||||
msg.append(costRemoveCounter.getDescriptiveType());
|
msg.append(costRemoveCounter.getDescriptiveType());
|
||||||
if (nLeft > 1) {
|
|
||||||
msg.append("s");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.typeList = CardLists.getValidCards(sa.getActivatingPlayer().getCardsIn(costRemoveCounter.getZone()), type.split(";"), sa.getActivatingPlayer(), sa.getSourceCard());
|
this.typeList = CardLists.getValidCards(sa.getActivatingPlayer().getCardsIn(costRemoveCounter.getZone()), type.split(";"), sa.getActivatingPlayer(), sa.getSourceCard());
|
||||||
|
|
||||||
|
// TODO Tabulate typelist vs nNeeded to see if there are enough counters to remove
|
||||||
|
|
||||||
CMatchUI.SINGLETON_INSTANCE.showMessage(msg.toString());
|
CMatchUI.SINGLETON_INSTANCE.showMessage(msg.toString());
|
||||||
ButtonUtil.enableOnlyCancel();
|
ButtonUtil.enableOnlyCancel();
|
||||||
}
|
}
|
||||||
@@ -378,14 +390,14 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
|
|
||||||
public void done() {
|
public void done() {
|
||||||
this.stop();
|
this.stop();
|
||||||
costRemoveCounter.addListToHash(sa, "CounterPut");
|
costRemoveCounter.addListToHash(sa, "CounterRemove");
|
||||||
payment.paidCost(costRemoveCounter);
|
payment.paidCost(costRemoveCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
this.stop();
|
this.stop();
|
||||||
costRemoveCounter.addListToHash(sa, "CounterPut");
|
costRemoveCounter.addListToHash(sa, "CounterRemove");
|
||||||
payment.cancelCost();
|
payment.cancelCost(costRemoveCounter);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -465,13 +477,13 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
|
|
||||||
public void done() {
|
public void done() {
|
||||||
this.stop();
|
this.stop();
|
||||||
costRemoveCounter.addListToHash(sa, "CounterPut");
|
costRemoveCounter.addListToHash(sa, "CounterRemove");
|
||||||
payment.paidCost(costRemoveCounter);
|
payment.paidCost(costRemoveCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
this.stop();
|
this.stop();
|
||||||
costRemoveCounter.addListToHash(sa, "CounterPut");
|
costRemoveCounter.addListToHash(sa, "CounterRemove");
|
||||||
payment.cancelCost();
|
payment.cancelCost();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -202,16 +202,7 @@ public class SpellAbilityRequirements {
|
|||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public final void finishPaying() {
|
public final void finishPaying() {
|
||||||
if (this.isFree || this.payment.isAllPaid()) {
|
if (this.payment.isCanceled()) {
|
||||||
if (this.skipStack) {
|
|
||||||
AbilityUtils.resolve(this.ability, false);
|
|
||||||
} else {
|
|
||||||
this.addAbilityToStack();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.select.resetTargets();
|
|
||||||
Singletons.getModel().getGame().getAction().checkStateEffects();
|
|
||||||
} else if (this.payment.isCanceled()) {
|
|
||||||
final Card c = this.ability.getSourceCard();
|
final Card c = this.ability.getSourceCard();
|
||||||
|
|
||||||
// split cards transform back to full form if mana cost is not paid
|
// split cards transform back to full form if mana cost is not paid
|
||||||
@@ -234,6 +225,16 @@ public class SpellAbilityRequirements {
|
|||||||
this.payment.cancelPayment();
|
this.payment.cancelPayment();
|
||||||
Singletons.getModel().getGame().getStack().clearFrozen();
|
Singletons.getModel().getGame().getStack().clearFrozen();
|
||||||
}
|
}
|
||||||
|
else if (this.isFree || this.payment.isAllPaid()) {
|
||||||
|
if (this.skipStack) {
|
||||||
|
AbilityUtils.resolve(this.ability, false);
|
||||||
|
} else {
|
||||||
|
this.addAbilityToStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.select.resetTargets();
|
||||||
|
Singletons.getModel().getGame().getAction().checkStateEffects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user