mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Gather Specimens, simplified replacement effect, some other minor changes.
This commit is contained in:
parent
3d7c2c32bf
commit
5d13559ef1
5 changed files with 45 additions and 71 deletions
|
|
@ -109,6 +109,7 @@ public interface Card extends MageObject {
|
|||
boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId);
|
||||
boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId);
|
||||
boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped);
|
||||
boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, ArrayList<UUID> appliedEffects);
|
||||
List<Mana> getMana();
|
||||
|
||||
void build();
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
case PICK:
|
||||
break;
|
||||
default:
|
||||
logger.fatal("invalid zone for card - " + fromZone);
|
||||
logger.fatal(new StringBuilder("Invalid from zone [").append(fromZone).append("] for card [").append(this.getName()).toString());
|
||||
break;
|
||||
}
|
||||
game.rememberLKI(objectId, event.getFromZone(), this);
|
||||
|
|
@ -342,7 +342,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
event.setTarget(permanent);
|
||||
break;
|
||||
default:
|
||||
logger.fatal("invalid zone for card - " + toZone);
|
||||
logger.fatal(new StringBuilder("Invalid from zone [").append(toZone).append("] for card [").append(this.getName()).toString());
|
||||
return false;
|
||||
}
|
||||
setControllerId(ownerId);
|
||||
|
|
@ -435,13 +435,18 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId) {
|
||||
return putOntoBattlefield(game, fromZone, sourceId, controllerId, false);
|
||||
return this.putOntoBattlefield(game, fromZone, sourceId, controllerId, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped){
|
||||
return this.putOntoBattlefield(game, fromZone, sourceId, controllerId, tapped, null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped){
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, controllerId, fromZone, Zone.BATTLEFIELD);
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, ArrayList<UUID> appliedEffects){
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, controllerId, fromZone, Zone.BATTLEFIELD, appliedEffects, tapped);
|
||||
if (!game.replaceEvent(event)) {
|
||||
if (fromZone != null) {
|
||||
boolean removed = false;
|
||||
|
|
@ -476,7 +481,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
game.addPermanent(permanent);
|
||||
game.setZone(objectId, Zone.BATTLEFIELD);
|
||||
game.setScopeRelevant(true);
|
||||
game.applyEffects(); // magenoxx: this causes bugs - LevelX2: but it's neccessary for casting e.g. Kird Ape which must trigger evolve
|
||||
game.applyEffects();
|
||||
permanent.setTapped(tapped);
|
||||
permanent.entersBattlefield(sourceId, game, event.getFromZone(), true);
|
||||
game.setScopeRelevant(false);
|
||||
|
|
|
|||
|
|
@ -67,12 +67,17 @@ public class ZoneChangeEvent extends GameEvent {
|
|||
}
|
||||
|
||||
public ZoneChangeEvent(UUID targetId, UUID sourceId, UUID playerId, Zone fromZone, Zone toZone, ArrayList<UUID> appliedEffects) {
|
||||
this(targetId, sourceId, playerId, fromZone, toZone, appliedEffects, false);
|
||||
}
|
||||
|
||||
public ZoneChangeEvent(UUID targetId, UUID sourceId, UUID playerId, Zone fromZone, Zone toZone, ArrayList<UUID> appliedEffects, boolean comesIntoPlayTapped) {
|
||||
super(EventType.ZONE_CHANGE, targetId, sourceId, playerId);
|
||||
this.fromZone = fromZone;
|
||||
this.toZone = toZone;
|
||||
if (appliedEffects != null) {
|
||||
this.appliedEffects = appliedEffects;
|
||||
}
|
||||
this.flag = comesIntoPlayTapped;
|
||||
}
|
||||
|
||||
public ZoneChangeEvent(Permanent target, UUID playerId, Zone fromZone, Zone toZone) {
|
||||
|
|
@ -106,4 +111,9 @@ public class ZoneChangeEvent extends GameEvent {
|
|||
public boolean isDiesEvent() {
|
||||
return (toZone == Zone.GRAVEYARD && fromZone == Zone.BATTLEFIELD);
|
||||
}
|
||||
|
||||
public boolean comesIntoPlayTapped() {
|
||||
return this.flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -522,16 +522,22 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId) {
|
||||
throw new UnsupportedOperationException("Unsupported operation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, ArrayList<UUID> appliedEffects) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCardNumber() {
|
||||
return card.getCardNumber();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue