mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Added Primal Vigor
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -8725,6 +8725,7 @@ forge-gui/res/cardsfolder/p/primal_order.txt svneol=native#text/plain
|
|||||||
forge-gui/res/cardsfolder/p/primal_plasma.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/primal_plasma.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/primal_rage.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/primal_rage.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/primal_surge.txt -text
|
forge-gui/res/cardsfolder/p/primal_surge.txt -text
|
||||||
|
forge-gui/res/cardsfolder/p/primal_vigor.txt -text
|
||||||
forge-gui/res/cardsfolder/p/primal_visitation.txt -text
|
forge-gui/res/cardsfolder/p/primal_visitation.txt -text
|
||||||
forge-gui/res/cardsfolder/p/primal_whisperer.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/primal_whisperer.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/primalcrux.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/primalcrux.txt svneol=native#text/plain
|
||||||
@@ -15101,6 +15102,7 @@ forge-gui/src/main/java/forge/game/player/PlayerStatistics.java -text
|
|||||||
forge-gui/src/main/java/forge/game/player/PlayerType.java svneol=native#text/plain
|
forge-gui/src/main/java/forge/game/player/PlayerType.java svneol=native#text/plain
|
||||||
forge-gui/src/main/java/forge/game/player/RegisteredPlayer.java -text
|
forge-gui/src/main/java/forge/game/player/RegisteredPlayer.java -text
|
||||||
forge-gui/src/main/java/forge/game/player/package-info.java svneol=native#text/plain
|
forge-gui/src/main/java/forge/game/player/package-info.java svneol=native#text/plain
|
||||||
|
forge-gui/src/main/java/forge/game/replacement/ReplaceAddCounter.java -text
|
||||||
forge-gui/src/main/java/forge/game/replacement/ReplaceCounter.java -text
|
forge-gui/src/main/java/forge/game/replacement/ReplaceCounter.java -text
|
||||||
forge-gui/src/main/java/forge/game/replacement/ReplaceDamage.java -text
|
forge-gui/src/main/java/forge/game/replacement/ReplaceDamage.java -text
|
||||||
forge-gui/src/main/java/forge/game/replacement/ReplaceDestroy.java -text
|
forge-gui/src/main/java/forge/game/replacement/ReplaceDestroy.java -text
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
Name:Corpsejack Menace
|
Name:Corpsejack Menace
|
||||||
ManaCost:2 B G
|
ManaCost:2 B G
|
||||||
Types:Creature Fungus
|
Types:Creature Fungus
|
||||||
Text:If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead.
|
|
||||||
PT:4/4
|
PT:4/4
|
||||||
|
R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCard$ Creature.YouCtrl | ValidCounterType$ P1P1 | ReplaceWith$ AddDoubleCounters | Description$ If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead.
|
||||||
|
SVar:AddDoubleCounters:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ ReplacedCounterType | CounterNum$ X | References$ X
|
||||||
|
SVar:X:ReplaceCount$CounterNum/Twice
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/corpsejack_menace.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/corpsejack_menace.jpg
|
||||||
Oracle:If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead.
|
Oracle:If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead.
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
Name:Doubling Season
|
Name:Doubling Season
|
||||||
ManaCost:4 G
|
ManaCost:4 G
|
||||||
Types:Enchantment
|
Types:Enchantment
|
||||||
Text:If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead.\r\nIf an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead.
|
Text:If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead.
|
||||||
|
R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCard$ Permanent.YouCtrl | EffectOnly$ True | ReplaceWith$ AddDoubleCounters | Description$ If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead.
|
||||||
|
SVar:AddDoubleCounters:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ ReplacedCounterType | CounterNum$ X | References$ X
|
||||||
|
SVar:X:ReplaceCount$CounterNum/Twice
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/doubling_season.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/doubling_season.jpg
|
||||||
Oracle:If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead.\nIf an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead.
|
Oracle:If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead.\nIf an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead.
|
||||||
9
forge-gui/res/cardsfolder/p/primal_vigor.txt
Normal file
9
forge-gui/res/cardsfolder/p/primal_vigor.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Name:Primal Vigor
|
||||||
|
ManaCost:4 G
|
||||||
|
Types:Enchantment
|
||||||
|
Text:If one or more tokens would be put onto the battlefield, twice that many of those tokens are put onto the battlefield instead.
|
||||||
|
R:Event$ AddCounter | ActiveZones$ Battlefield | ValidCard$ Creature | ValidCounterType$ P1P1 | ReplaceWith$ AddDoubleP1P1Counters | Description$ If one or more +1/+1 counters would be placed on a creature, twice that many +1/+1 counters are placed on that creature instead.
|
||||||
|
SVar:AddDoubleP1P1Counters:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ ReplacedCounterType | CounterNum$ X | References$ X
|
||||||
|
SVar:X:ReplaceCount$CounterNum/Twice
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/primal_vigor.jpg
|
||||||
|
Oracle:If one or more tokens would be put onto the battlefield, twice that many of those tokens are put onto the battlefield instead.\nIf one or more +1/+1 counters would be placed on a creature, twice that many +1/+1 counters are placed on that creature instead.
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
Name:Selesnya Loft Gardens
|
Name:Selesnya Loft Gardens
|
||||||
ManaCost:no cost
|
ManaCost:no cost
|
||||||
Types:Plane Ravnica
|
Types:Plane Ravnica
|
||||||
Text:If an effect would put one or more tokens onto the battlefield, it puts twice that many of those tokens onto the battlefield instead.\r\nIf an effect would place one or more counters on a permanent, it places twice that many of those counters on that permanent instead.
|
Text:If an effect would put one or more tokens onto the battlefield, it puts twice that many of those tokens onto the battlefield instead.
|
||||||
|
R:Event$ AddCounter | ActiveZones$ Command | ValidCard$ Permanent | EffectOnly$ True | ReplaceWith$ AddDoubleCounters | Description$ If an effect would place one or more counters on a permanent, it places twice that many of those counters on that permanent instead.
|
||||||
|
SVar:AddDoubleCounters:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ ReplacedCounterType | CounterNum$ X | References$ X
|
||||||
|
SVar:X:ReplaceCount$CounterNum/Twice
|
||||||
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll {C}, until end of turn, whenever you tap a land for mana, add one mana to your mana pool of any type that land produced.
|
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll {C}, until end of turn, whenever you tap a land for mana, add one mana to your mana pool of any type that land produced.
|
||||||
SVar:RolledChaos:AB$ Effect | Cost$ 0 | AILogic$ Always | Triggers$ TrigTapForMana | SVars$ TrigMana
|
SVar:RolledChaos:AB$ Effect | Cost$ 0 | AILogic$ Always | Triggers$ TrigTapForMana | SVars$ TrigMana
|
||||||
SVar:TrigTapForMana:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.YouCtrl | Execute$ TrigMana | Static$ True | TriggerDescription$ Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced.
|
SVar:TrigTapForMana:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.YouCtrl | Execute$ TrigMana | Static$ True | TriggerDescription$ Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced.
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
public static CounterType getCounterType(String name, SpellAbility sa) throws Exception {
|
public static CounterType getCounterType(String name, SpellAbility sa) throws Exception {
|
||||||
CounterType counterType;
|
CounterType counterType;
|
||||||
|
if ("ReplacedCounterType".equals(name)) {
|
||||||
|
name = (String) sa.getReplacingObject("CounterType");
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
counterType = CounterType.getType(name);
|
counterType = CounterType.getType(name);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
final Zone zone = tgtCard.getGame().getZoneOf(tgtCard);
|
final Zone zone = tgtCard.getGame().getZoneOf(tgtCard);
|
||||||
if (zone == null || zone.is(ZoneType.Battlefield) || zone.is(ZoneType.Stack)) {
|
if (zone == null || zone.is(ZoneType.Battlefield) || zone.is(ZoneType.Stack)) {
|
||||||
if (remember) {
|
if (remember) {
|
||||||
final int value = tgtCard.getTotalCountersToAdd(counterType, counterAmount, true);
|
final int value = tgtCard.getTotalCountersToAdd();
|
||||||
tgtCard.addCountersAddedBy(card, counterType, value);
|
tgtCard.addCountersAddedBy(card, counterType, value);
|
||||||
}
|
}
|
||||||
tgtCard.addCounter(counterType, counterAmount, true);
|
tgtCard.addCounter(counterType, counterAmount, true);
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
// Zone-changing spells should store card's zone here
|
// Zone-changing spells should store card's zone here
|
||||||
private Zone currentZone = null;
|
private Zone currentZone = null;
|
||||||
|
|
||||||
|
private int countersAdded = 0;
|
||||||
|
|
||||||
// Enumeration for CMC request types
|
// Enumeration for CMC request types
|
||||||
public enum SplitCMCMode {
|
public enum SplitCMCMode {
|
||||||
CurrentSideCMC,
|
CurrentSideCMC,
|
||||||
@@ -1128,22 +1130,37 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getTotalCountersToAdd(final CounterType counterType, final int baseAmount, final boolean applyMultiplier) {
|
public final int getTotalCountersToAdd() {
|
||||||
if (this.canReceiveCounters(counterType)) {
|
return countersAdded;
|
||||||
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
}
|
||||||
int result = multiplier * baseAmount;
|
|
||||||
if (counterType == CounterType.DREAM && this.hasKeyword("CARDNAME can't have more than seven dream counters on it.")) {
|
public final void setTotalCountersToAdd(int value) {
|
||||||
result = Math.min(7 - this.getCounters(CounterType.DREAM), result);
|
countersAdded = value;
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addCounter(final CounterType counterType, final int n, final boolean applyMultiplier) {
|
public final void addCounter(final CounterType counterType, final int n, final boolean applyMultiplier) {
|
||||||
final int addAmount = getTotalCountersToAdd(counterType, n, applyMultiplier);
|
int addAmount = n;
|
||||||
if (addAmount == 0)
|
final HashMap<String, Object> repParams = new HashMap<String, Object>();
|
||||||
|
repParams.put("Event", "AddCounter");
|
||||||
|
repParams.put("Affected", this);
|
||||||
|
repParams.put("CounterType", counterType);
|
||||||
|
repParams.put("CounterNum", addAmount);
|
||||||
|
repParams.put("EffectOnly", applyMultiplier);
|
||||||
|
if (this.getGame().getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
if (this.canReceiveCounters(counterType)) {
|
||||||
|
if (counterType == CounterType.DREAM && this.hasKeyword("CARDNAME can't have more than seven dream counters on it.")) {
|
||||||
|
addAmount = Math.min(7 - this.getCounters(CounterType.DREAM), addAmount);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
addAmount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addAmount == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setTotalCountersToAdd(addAmount);
|
||||||
|
|
||||||
Integer oldValue = this.counters.get(counterType);
|
Integer oldValue = this.counters.get(counterType);
|
||||||
int newValue = addAmount + (oldValue == null ? 0 : oldValue.intValue());
|
int newValue = addAmount + (oldValue == null ? 0 : oldValue.intValue());
|
||||||
|
|||||||
@@ -2857,19 +2857,11 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
return CardLists.filter(getCardsIn(ZoneType.Battlefield), CardPredicates.isColor(MagicColor.fromName(color)));
|
return CardLists.filter(getCardsIn(ZoneType.Battlefield), CardPredicates.isColor(MagicColor.fromName(color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCounterDoublersMagnitude(final CounterType type) {
|
|
||||||
int counterDoublers = getCardsIn(ZoneType.Battlefield, "Doubling Season").size()
|
|
||||||
+ CardLists.filter(getGame().getCardsIn(ZoneType.Command),
|
|
||||||
CardPredicates.nameEquals("Selesnya Loft Gardens")).size();
|
|
||||||
if (type == CounterType.P1P1) {
|
|
||||||
counterDoublers += getCardsIn(ZoneType.Battlefield, "Corpsejack Menace").size();
|
|
||||||
}
|
|
||||||
return 1 << counterDoublers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTokenDoublersMagnitude() {
|
public int getTokenDoublersMagnitude() {
|
||||||
final int tokenDoublers = getCardsIn(ZoneType.Battlefield, "Parallel Lives").size()
|
final int tokenDoublers = getCardsIn(ZoneType.Battlefield, "Parallel Lives").size()
|
||||||
+ getCardsIn(ZoneType.Battlefield, "Doubling Season").size()
|
+ getCardsIn(ZoneType.Battlefield, "Doubling Season").size()
|
||||||
|
+ CardLists.filter(getGame().getCardsIn(ZoneType.Battlefield),
|
||||||
|
CardPredicates.nameEquals("Primal Vigor")).size()
|
||||||
+ CardLists.filter(getGame().getCardsIn(ZoneType.Command),
|
+ CardLists.filter(getGame().getCardsIn(ZoneType.Command),
|
||||||
CardPredicates.nameEquals("Selesnya Loft Gardens")).size();;
|
CardPredicates.nameEquals("Selesnya Loft Gardens")).size();;
|
||||||
return 1 << tokenDoublers; // pow(a,0) = 1; pow(a,1) = a
|
return 1 << tokenDoublers; // pow(a,0) = 1; pow(a,1) = a
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package forge.game.replacement;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import forge.game.card.Card;
|
||||||
|
import forge.game.card.CounterType;
|
||||||
|
import forge.game.spellability.SpellAbility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: Write javadoc for this type.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ReplaceAddCounter extends ReplacementEffect {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* ReplaceProduceMana.
|
||||||
|
* @param mapParams   HashMap<String, String>
|
||||||
|
* @param host   Card
|
||||||
|
*/
|
||||||
|
public ReplaceAddCounter(final Map<String, String> mapParams, final Card host, final boolean intrinsic) {
|
||||||
|
super(mapParams, host, intrinsic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see forge.card.replacement.ReplacementEffect#canReplace(java.util.HashMap)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean canReplace(Map<String, Object> runParams) {
|
||||||
|
if (!runParams.get("Event").equals("AddCounter")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapParams.containsKey("EffectOnly")) {
|
||||||
|
final Boolean effectOnly = (Boolean) runParams.get("EffectOnly");
|
||||||
|
if (!effectOnly) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
|
if (!matchesValid(runParams.get("Affected"), this.getMapParams().get("ValidCard").split(","), this.getHostCard())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapParams.containsKey("ValidCounterType")) {
|
||||||
|
String type = this.getMapParams().get("ValidCounterType");
|
||||||
|
if (CounterType.getType(type) != runParams.get("CounterType")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see forge.card.replacement.ReplacementEffect#setReplacingObjects(java.util.HashMap, forge.card.spellability.SpellAbility)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setReplacingObjects(Map<String, Object> runParams, SpellAbility sa) {
|
||||||
|
sa.setReplacingObject("CounterNum", runParams.get("CounterNum"));
|
||||||
|
sa.setReplacingObject("CounterType", ((CounterType) runParams.get("CounterType")).getName());
|
||||||
|
sa.setReplacingObject("Card", runParams.get("Affected"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ import forge.game.card.Card;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum ReplacementType {
|
public enum ReplacementType {
|
||||||
|
AddCounter(ReplaceAddCounter.class),
|
||||||
Counter(ReplaceCounter.class),
|
Counter(ReplaceCounter.class),
|
||||||
DamageDone(ReplaceDamage.class),
|
DamageDone(ReplaceDamage.class),
|
||||||
Destroy(ReplaceDestroy.class),
|
Destroy(ReplaceDestroy.class),
|
||||||
|
|||||||
Reference in New Issue
Block a user