mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Card: store activations in Card
This commit is contained in:
committed by
Michael Kamensky
parent
8f0457f0fa
commit
8e5e8e1759
@@ -1255,7 +1255,7 @@ public class ComputerUtil {
|
||||
|
||||
// returns true if the AI should stop using the ability
|
||||
public static boolean preventRunAwayActivations(final SpellAbility sa) {
|
||||
int activations = sa.getRestrictions().getNumberTurnActivations();
|
||||
int activations = sa.getActivationsThisTurn();
|
||||
|
||||
if (sa.isTemporary()) {
|
||||
return MyRandom.getRandom().nextFloat() >= .95; // Abilities created by static abilities have no memory
|
||||
|
||||
@@ -20,7 +20,6 @@ import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.player.PlayerActionConfirmMode;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityRestriction;
|
||||
import forge.game.spellability.TargetRestrictions;
|
||||
import forge.game.staticability.StaticAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
@@ -288,9 +287,8 @@ public class PumpAi extends PumpAiBase {
|
||||
}
|
||||
|
||||
if (sa.hasParam("ActivationNumberSacrifice")) {
|
||||
final SpellAbilityRestriction restrict = sa.getRestrictions();
|
||||
final int sacActivations = Integer.parseInt(sa.getParam("ActivationNumberSacrifice").substring(2));
|
||||
final int activations = restrict.getNumberTurnActivations();
|
||||
final int activations = sa.getActivationsThisTurn();
|
||||
// don't risk sacrificing a creature just to pump it
|
||||
if (activations >= sacActivations - 1) {
|
||||
return false;
|
||||
|
||||
@@ -324,12 +324,12 @@ public class GameCopier {
|
||||
if (c.isPlaneswalker()) {
|
||||
for (SpellAbility sa : c.getAllSpellAbilities()) {
|
||||
SpellAbilityRestriction restrict = sa.getRestrictions();
|
||||
if (sa.isPwAbility() && restrict.getNumberTurnActivations() > 0) {
|
||||
int active = sa.getActivationsThisTurn();
|
||||
if (sa.isPwAbility() && active > 0) {
|
||||
SpellAbility newSa = findSAInCard(sa, newCard);
|
||||
if (newSa != null) {
|
||||
for (int i = 0; i < restrict.getNumberTurnActivations(); i++) {
|
||||
newSa.getRestrictions().abilityActivated();
|
||||
newCard.addPlaneswalkerAbilityActivated();
|
||||
for (int i = 0; i < active; i++) {
|
||||
newCard.addAbilityActivated(newSa);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user