mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Move Altar of the Pantheon to its own static (#6760)
This commit is contained in:
@@ -1159,6 +1159,9 @@ public class GameAction {
|
||||
}
|
||||
}
|
||||
staticAbilities.addAll(toAdd);
|
||||
for (Player p : game.getPlayers()) {
|
||||
p.afterStaticAbilityLayer(layer);
|
||||
}
|
||||
}
|
||||
|
||||
for (final CardCollectionView affected : affectedPerAbility.values()) {
|
||||
|
||||
@@ -1938,8 +1938,8 @@ public class AbilityUtils {
|
||||
colorOccurrences++;
|
||||
}
|
||||
}
|
||||
colorOccurrences += c0.getAmountOfKeyword("Your devotion to each color and each combination of colors is increased by one.");
|
||||
}
|
||||
colorOccurrences += player.getDevotionMod();
|
||||
return doXMath(colorOccurrences, expr, c, ctb);
|
||||
}
|
||||
} // end ctb != null
|
||||
|
||||
@@ -114,6 +114,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
private int venturedThisTurn;
|
||||
private int descended;
|
||||
private int numRingTemptedYou;
|
||||
private int devotionMod;
|
||||
private boolean revolt = false;
|
||||
private Card ringBearer, theRing;
|
||||
|
||||
@@ -4017,4 +4018,16 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
.flatMap(Collection::stream)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public int getDevotionMod() {
|
||||
return devotionMod;
|
||||
}
|
||||
|
||||
public void afterStaticAbilityLayer(StaticAbilityLayer layer) {
|
||||
if (layer != StaticAbilityLayer.TEXT) {
|
||||
return;
|
||||
}
|
||||
|
||||
devotionMod = StaticAbilityDevotion.getDevotionMod(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package forge.game.staticability;
|
||||
|
||||
import forge.game.Game;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
public class StaticAbilityDevotion {
|
||||
|
||||
static String MODE = "Devotion";
|
||||
|
||||
public static int getDevotionMod(final Player player) {
|
||||
int i = 0;
|
||||
final Game game = player.getGame();
|
||||
for (final Card ca : game.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) {
|
||||
for (final StaticAbility stAb : ca.getStaticAbilities()) {
|
||||
if (!stAb.checkConditions(MODE)) {
|
||||
continue;
|
||||
}
|
||||
if (!stAb.matchesValidParam("ValidPlayer", player)) {
|
||||
continue;
|
||||
}
|
||||
int t = Integer.parseInt(stAb.getParamOrDefault("Value", "1"));
|
||||
i = i + t;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Altar of the Pantheon
|
||||
ManaCost:3
|
||||
Types:Artifact
|
||||
K:Your devotion to each color and each combination of colors is increased by one.
|
||||
S:Mode$ Devotion | ValidPlayer$ You | Description$ Your devotion to each color and each combination of colors is increased by one.
|
||||
A:AB$ Mana | Cost$ T | Produced$ Any | SubAbility$ DBGainLife | SpellDescription$ Add one mana of any color. If you control a God, a Demigod, or a legendary enchantment, you gain 1 life.
|
||||
SVar:DBGainLife:DB$ GainLife | LifeAmount$ 1 | ConditionPresent$ God.YouCtrl,Demigod.YouCtrl,Enchantment.YouCtrl+Legendary
|
||||
DeckHas:Ability$LifeGain
|
||||
|
||||
Reference in New Issue
Block a user