mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Fix wasCastByYou (#2788)
Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
This commit is contained in:
@@ -33,10 +33,10 @@ public class CountersProliferateEffect extends SpellAbilityEffect {
|
||||
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
int num = sa.hasParam("Amount") ? AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("Amount"), sa) : 1;
|
||||
final Player p = sa.getActivatingPlayer();
|
||||
final Card host = sa.getHostCard();
|
||||
final Game game = host.getGame();
|
||||
int num = sa.hasParam("Amount") ? AbilityUtils.calculateAmount(host, sa.getParam("Amount"), sa) : 1;
|
||||
|
||||
final Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(p);
|
||||
repParams.put(AbilityKey.Source, sa);
|
||||
|
||||
@@ -6955,8 +6955,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
etbCounters.clear();
|
||||
}
|
||||
|
||||
public final Set<Table.Cell<Player, CounterType, Integer>> getEtbCounters() {
|
||||
return etbCounters.cellSet();
|
||||
public final Table<Player, CounterType, Integer> getEtbCounters() {
|
||||
return etbCounters;
|
||||
}
|
||||
|
||||
public final void putEtbCounters(GameEntityCounterTable table) {
|
||||
|
||||
@@ -1873,7 +1873,7 @@ public class CardProperty {
|
||||
}
|
||||
final ZoneType realZone = ZoneType.smartValueOf(strZone);
|
||||
if (card.getCastFrom() == null || (zoneOwner != null && !card.getCastFrom().getPlayer().equals(zoneOwner))
|
||||
|| (byYou && !controller.equals(card.getCastSA().getActivatingPlayer()))
|
||||
|| (byYou && !sourceController.equals(card.getCastSA().getActivatingPlayer()))
|
||||
|| realZone != card.getCastFrom().getZoneType()) {
|
||||
return false;
|
||||
}
|
||||
@@ -1894,7 +1894,7 @@ public class CardProperty {
|
||||
}
|
||||
final ZoneType realZone = ZoneType.smartValueOf(strZone);
|
||||
if (card.getCastFrom() != null && (zoneOwner == null || card.getCastFrom().getPlayer().equals(zoneOwner))
|
||||
&& (!byYou || controller.equals(card.getCastSA().getActivatingPlayer()))
|
||||
&& (!byYou || sourceController.equals(card.getCastSA().getActivatingPlayer()))
|
||||
&& realZone == card.getCastFrom().getZoneType()) {
|
||||
return false;
|
||||
}
|
||||
@@ -1902,7 +1902,7 @@ public class CardProperty {
|
||||
if (!card.wasCast()) {
|
||||
return false;
|
||||
}
|
||||
if (property.contains("ByYou") && !controller.equals(card.getCastSA().getActivatingPlayer())) {
|
||||
if (property.contains("ByYou") && !sourceController.equals(card.getCastSA().getActivatingPlayer())) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("wasNotCast")) {
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.collect.Table;
|
||||
|
||||
import forge.ImageKeys;
|
||||
import forge.card.CardStateName;
|
||||
@@ -283,9 +282,7 @@ public final class CardUtil {
|
||||
newCopy.setChosenNumber(in.getChosenNumber());
|
||||
}
|
||||
|
||||
for (Table.Cell<Player, CounterType, Integer> cl : in.getEtbCounters()) {
|
||||
newCopy.addEtbCounter(cl.getColumnKey(), cl.getValue(), cl.getRowKey());
|
||||
}
|
||||
newCopy.getEtbCounters().putAll(in.getEtbCounters());
|
||||
|
||||
newCopy.setUnearthed(in.isUnearthed());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user