mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Address PR comments
This commit is contained in:
parent
e17f423c41
commit
430d50af63
2 changed files with 12 additions and 3 deletions
|
|
@ -137,8 +137,17 @@ class CaseOfThePilferedProofReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
if (event instanceof CreateTokenEvent) {
|
||||
CreateTokenEvent tokenEvent = (CreateTokenEvent) event;
|
||||
ClueArtifactToken clueToken = null;
|
||||
Map<Token, Integer> tokens = tokenEvent.getTokens();
|
||||
tokens.put(new ClueArtifactToken(), 1);
|
||||
for (Map.Entry<Token, Integer> entry : tokens.entrySet()) {
|
||||
if (entry.getKey() instanceof ClueArtifactToken) {
|
||||
clueToken = (ClueArtifactToken) entry.getKey();
|
||||
}
|
||||
}
|
||||
if (clueToken == null) {
|
||||
clueToken = new ClueArtifactToken();
|
||||
}
|
||||
tokens.put(clueToken, tokens.getOrDefault(clueToken, 0) + 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ public class CaseAbility extends SimpleStaticAbility {
|
|||
if (!(effect instanceof ConditionalContinuousEffect ||
|
||||
effect instanceof ConditionalAsThoughEffect ||
|
||||
effect instanceof ConditionalReplacementEffect)) {
|
||||
throw new IllegalArgumentException("solvedAbility must be one of ConditionalActivatedAbility, " +
|
||||
throw new IllegalArgumentException("Wrong code usage: solvedAbility must be one of ConditionalActivatedAbility, " +
|
||||
"ConditionalTriggeredAbility, or StaticAbility with conditional effects.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("solvedAbility must be one of ConditionalActivatedAbility, " +
|
||||
throw new IllegalArgumentException("Wrong code usage: solvedAbility must be one of ConditionalActivatedAbility, " +
|
||||
"ConditionalTriggeredAbility, or StaticAbility with conditional effects.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue