TriggerCounterPlayerAddedAll: new Trigger that triggers when a player puts more counters on one object

This commit is contained in:
Hans Mackowiak
2021-04-10 18:43:40 +02:00
parent 183209baa3
commit d8b665f64f
12 changed files with 159 additions and 69 deletions

View File

@@ -0,0 +1,8 @@
Name:Bold Plagiarist
ManaCost:3 B
Types:Creature Vampire Rogue
PT:2/2
K:Flash
T:Mode$ CounterPlayerAddedAll | ValidSource$ Opponent | ValidObjectToSource$ Creature.YouCtrl | Execute$ TrigCounter | TriggerDescription$ Whenever an opponent puts one or more counters on a creature they control, they put the same number and kind of counters on CARDNAME.
SVar:TrigCounter:DB$ PutCounter | Defined$ Self | Placer$ TriggeredSource | TriggeredCounterMap$ True
Oracle:Flash\nWhenever an opponent puts one or more counters on a creature they control, they put the same number and kind of counters on Bold Plagiarist.

View File

@@ -861,11 +861,11 @@ public class HumanCostDecision extends CostDecisionMakerBase {
return false;
}
if (c.getCounters(cType) <= counterTable.get(c, cType)) {
if (c.getCounters(cType) <= counterTable.get(null, c, cType)) {
return false;
}
counterTable.put(c, cType, 1);
counterTable.put(null, c, cType, 1);
onSelectStateChanged(c, true);
refresh();
@@ -878,13 +878,13 @@ public class HumanCostDecision extends CostDecisionMakerBase {
return null;
}
if (counterType != null) {
if (c.getCounters(counterType) <= counterTable.get(c, counterType)) {
if (c.getCounters(counterType) <= counterTable.get(null, c, counterType)) {
return null;
}
} else {
boolean found = false;
for (Map.Entry<CounterType, Integer> e : c.getCounters().entrySet()) {
if (e.getValue() > counterTable.get(c, e.getKey())) {
if (e.getValue() > counterTable.get(null, c, e.getKey())) {
found = true;
break;
}
@@ -915,13 +915,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
}
private int getDistibutedCounters() {
int sum = 0;
for (Integer v : this.counterTable.values()) {
sum += v;
}
return sum;
return counterTable.totalValues();
}
protected final boolean isValidChoice(final GameEntity choice) {
@@ -934,7 +928,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
@Override
public Collection<GameEntity> getSelected() {
return counterTable.rowKeySet();
return counterTable.columnKeySet();
}
}