mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 15:32:08 -08:00
* Ravnica: City of Guilds - Added 5 cards.
This commit is contained in:
parent
ee129e2251
commit
833237e09b
8 changed files with 622 additions and 9 deletions
|
|
@ -9,21 +9,25 @@ import mage.game.permanent.Permanent;
|
|||
|
||||
public class CountersSourceCount implements DynamicValue {
|
||||
|
||||
private final CounterType counter;
|
||||
private final String counterName;
|
||||
|
||||
public CountersSourceCount(CounterType counter) {
|
||||
this.counter = counter;
|
||||
this.counterName = counter.getName();
|
||||
}
|
||||
|
||||
public CountersSourceCount(String counterName) {
|
||||
this.counterName = counterName;
|
||||
}
|
||||
|
||||
public CountersSourceCount(final CountersSourceCount countersCount) {
|
||||
this.counter = countersCount.counter;
|
||||
this.counterName = countersCount.counterName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(sourceAbility.getSourceId());
|
||||
if (permanent != null) {
|
||||
return permanent.getCounters(game).getCount(counter);
|
||||
return permanent.getCounters(game).getCount(counterName);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -40,6 +44,6 @@ public class CountersSourceCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return counter.getName() + " counter on {this}";
|
||||
return counterName + " counter on {this}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue