mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
[LCI] Implement Ojer Taq, Deepest Foundation
This commit is contained in:
parent
79013a880a
commit
b6cedee854
7 changed files with 184 additions and 5 deletions
|
|
@ -44,7 +44,7 @@ public class CreateTwiceThatManyTokensEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
if (event instanceof CreateTokenEvent) {
|
||||
((CreateTokenEvent) event).doubleTokens();
|
||||
((CreateTokenEvent) event).multiplyTokens(2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,19 @@ public class CreateTokenEvent extends GameEvent {
|
|||
return tokens;
|
||||
}
|
||||
|
||||
public void doubleTokens() {
|
||||
public void multiplyTokens(int factor) {
|
||||
multiplyTokens(factor, null);
|
||||
}
|
||||
|
||||
public interface ConditionOnToken {
|
||||
boolean apply(Token token);
|
||||
}
|
||||
|
||||
public void multiplyTokens(int factor, ConditionOnToken condition) {
|
||||
for (Map.Entry<Token, Integer> entry : tokens.entrySet()) {
|
||||
entry.setValue(entry.getValue() * 2);
|
||||
if (condition == null || condition.apply(entry.getKey())) {
|
||||
entry.setValue(entry.getValue() * factor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue