mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
Implemented Chandra, Fire Artisan
This commit is contained in:
parent
41d3cb7558
commit
785917deb6
5 changed files with 153 additions and 6 deletions
|
|
@ -720,6 +720,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
|
||||
@Override
|
||||
public void removeCounters(String name, int amount, Game game) {
|
||||
int finalAmount = 0;
|
||||
for (int i = 0; i < amount; i++) {
|
||||
if (!getCounters(game).removeCounter(name, 1)) {
|
||||
break;
|
||||
|
|
@ -727,7 +728,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.COUNTER_REMOVED, objectId, getControllerOrOwner());
|
||||
event.setData(name);
|
||||
game.fireEvent(event);
|
||||
finalAmount++;
|
||||
}
|
||||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.COUNTERS_REMOVED, objectId, getControllerOrOwner());
|
||||
event.setData(name);
|
||||
event.setAmount(finalAmount);
|
||||
game.fireEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ public class GameEvent implements Serializable {
|
|||
UNATTACH, UNATTACHED,
|
||||
ADD_COUNTER, COUNTER_ADDED,
|
||||
ADD_COUNTERS, COUNTERS_ADDED,
|
||||
COUNTER_REMOVED,
|
||||
COUNTER_REMOVED, COUNTERS_REMOVED,
|
||||
LOSE_CONTROL,
|
||||
/* LOST_CONTROL
|
||||
targetId id of the creature that lost control
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ import java.io.Serializable;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class PlayerImpl implements Player, Serializable {
|
||||
|
||||
|
|
@ -184,7 +183,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
put(PhaseStep.DECLARE_ATTACKERS, Step.StepPart.PRE).build();
|
||||
|
||||
|
||||
|
||||
public PlayerImpl(String name, RangeOfInfluence range) {
|
||||
this(UUID.randomUUID());
|
||||
this.name = name;
|
||||
|
|
@ -739,9 +737,9 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
TargetDiscard target = new TargetDiscard(possibleAmount, possibleAmount, new FilterCard(CardUtil.numberToText(possibleAmount, "a") + " card" + (possibleAmount > 1 ? "s" : "")), playerId);
|
||||
choose(Outcome.Discard, target, source == null ? null : source.getSourceId(), game);
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
if(discard(this.getHand().get(cardId, game), source, game)) {
|
||||
discardedCards.add(cardId);
|
||||
}
|
||||
if (discard(this.getHand().get(cardId, game), source, game)) {
|
||||
discardedCards.add(cardId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return discardedCards;
|
||||
|
|
@ -2046,6 +2044,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
|
||||
@Override
|
||||
public void removeCounters(String name, int amount, Ability source, Game game) {
|
||||
int finalAmount = 0;
|
||||
for (int i = 0; i < amount; i++) {
|
||||
if (!counters.removeCounter(name, 1)) {
|
||||
break;
|
||||
|
|
@ -2055,7 +2054,13 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
event.setData(name);
|
||||
event.setAmount(1);
|
||||
game.fireEvent(event);
|
||||
finalAmount++;
|
||||
}
|
||||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.COUNTERS_REMOVED,
|
||||
getId(), (source == null ? null : source.getSourceId()), (source == null ? null : source.getControllerId()));
|
||||
event.setData(name);
|
||||
event.setAmount(finalAmount);
|
||||
game.fireEvent(event);
|
||||
}
|
||||
|
||||
protected boolean canDamage(MageObject source, Game game) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue