(final Card c, final SpellAbility sa, final boolean effect, Map<AbilityKey, Object> params)
| 1428 | } |
| 1429 | |
| 1430 | public final Card discard(final Card c, final SpellAbility sa, final boolean effect, Map<AbilityKey, Object> params) { |
| 1431 | if (!c.canBeDiscardedBy(sa, effect)) { |
| 1432 | return null; |
| 1433 | } |
| 1434 | |
| 1435 | discardedThisTurn.add(CardCopyService.getLKICopy(c)); |
| 1436 | |
| 1437 | params.put(AbilityKey.Discard, true); |
| 1438 | params.put(AbilityKey.EffectOnly, effect); |
| 1439 | final Card newCard = game.getAction().moveToGraveyard(c, sa, params); |
| 1440 | |
| 1441 | StringBuilder sb = new StringBuilder(); |
| 1442 | sb.append(this).append(" discards ").append(c); |
| 1443 | //sb.append(" to the library"); |
| 1444 | //sb.append(" with Madness"); |
| 1445 | sb.append("."); |
| 1446 | // Play the Discard sound |
| 1447 | game.fireEvent(new GameEventAddLog(GameLogEntryType.DISCARD, sb.toString(), c)); |
| 1448 | |
| 1449 | newCard.setDiscarded(true); |
| 1450 | |
| 1451 | if (sa != null && sa.hasParam("RememberDiscarded")) { |
| 1452 | sa.getHostCard().addRemembered(newCard); |
| 1453 | } |
| 1454 | final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(this); |
| 1455 | runParams.put(AbilityKey.Card, c); |
| 1456 | runParams.put(AbilityKey.Cause, sa); |
| 1457 | runParams.putAll(params); |
| 1458 | game.getTriggerHandler().runTrigger(TriggerType.Discarded, runParams, false); |
| 1459 | |
| 1460 | return newCard; |
| 1461 | } |
| 1462 | |
| 1463 | public final void addTokensCreatedThisTurn(Card token) { |
| 1464 | numTokenCreatedThisTurn++; |
no test coverage detected