mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
[KTK] Added 4 golden, 1 green (not finished), 10 land cards.
This commit is contained in:
parent
21d4d4cfb7
commit
9b4637b002
20 changed files with 1435 additions and 15 deletions
119
Mage/src/mage/abilities/effects/AsTurnedFaceUpEffect.java
Normal file
119
Mage/src/mage/abilities/effects/AsTurnedFaceUpEffect.java
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class AsTurnedFaceUpEffect extends ReplacementEffectImpl {
|
||||
|
||||
protected Effects baseEffects = new Effects();
|
||||
protected boolean optional;
|
||||
|
||||
public AsTurnedFaceUpEffect(Effect baseEffect, boolean optional) {
|
||||
super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), true);
|
||||
this.baseEffects.add(baseEffect);
|
||||
this.optional = optional;
|
||||
}
|
||||
|
||||
public AsTurnedFaceUpEffect(final AsTurnedFaceUpEffect effect) {
|
||||
super(effect);
|
||||
this.baseEffects = effect.baseEffects.copy();
|
||||
this.optional = effect.optional;
|
||||
}
|
||||
|
||||
public void addEffect(Effect effect) {
|
||||
baseEffects.add(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.TURNFACEUP) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
if (optional) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (controller == null || object == null) {
|
||||
return false;
|
||||
}
|
||||
if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append("?").toString(), game)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (Effect effect: baseEffects) {
|
||||
if (source.activate(game, false)) {
|
||||
if (effect instanceof ContinuousEffect) {
|
||||
game.addEffect((ContinuousEffect) effect, source);
|
||||
}
|
||||
else {
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "As {this} is turned face up, " + baseEffects.getText(mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsTurnedFaceUpEffect copy() {
|
||||
return new AsTurnedFaceUpEffect(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -49,6 +50,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
private boolean tapped;
|
||||
private boolean attacking;
|
||||
private UUID lastAddedTokenId;
|
||||
private ArrayList<UUID> lastAddedTokenIds = new ArrayList<>();
|
||||
|
||||
public CreateTokenEffect(Token token) {
|
||||
this(token, new StaticValue(1));
|
||||
|
|
@ -82,6 +84,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
this.tapped = effect.tapped;
|
||||
this.attacking = effect.attacking;
|
||||
this.lastAddedTokenId = effect.lastAddedTokenId;
|
||||
this.lastAddedTokenIds.addAll(effect.lastAddedTokenIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -96,6 +99,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
tokenCopy.getAbilities().newId(); // neccessary if token has ability like DevourAbility()
|
||||
tokenCopy.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId(), tapped, attacking);
|
||||
this.lastAddedTokenId = tokenCopy.getLastAddedToken();
|
||||
this.lastAddedTokenIds = tokenCopy.getLastAddedTokenIds();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +107,10 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
return lastAddedTokenId;
|
||||
}
|
||||
|
||||
public ArrayList<UUID> getLastAddedTokenIds() {
|
||||
return lastAddedTokenIds;
|
||||
}
|
||||
|
||||
private void setText() {
|
||||
StringBuilder sb = new StringBuilder("put ");
|
||||
if (amount.toString().equals("1")) {
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -39,7 +38,12 @@ import mage.ObjectColor;
|
|||
public class SnakeToken extends Token {
|
||||
|
||||
public SnakeToken() {
|
||||
this("ZEN");
|
||||
}
|
||||
|
||||
public SnakeToken(String setCode) {
|
||||
super("Snake", "1/1 green Snake creature token");
|
||||
setOriginalExpansionSetCode(setCode);
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setGreen(true);
|
||||
subtype.add("Snake");
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -49,6 +50,7 @@ import mage.util.CardUtil;
|
|||
public class Token extends MageObjectImpl {
|
||||
|
||||
protected String description;
|
||||
private ArrayList<UUID> lastAddedTokenIds = new ArrayList<>();
|
||||
private UUID lastAddedTokenId;
|
||||
private int tokenType;
|
||||
private int originalCardNumber;
|
||||
|
|
@ -91,6 +93,7 @@ public class Token extends MageObjectImpl {
|
|||
this.description = token.description;
|
||||
this.tokenType = token.tokenType;
|
||||
this.lastAddedTokenId = token.lastAddedTokenId;
|
||||
this.lastAddedTokenIds.addAll(token.lastAddedTokenIds);
|
||||
this.originalCardNumber = token.originalCardNumber;
|
||||
this.originalExpansionSetCode = token.originalExpansionSetCode;
|
||||
}
|
||||
|
|
@ -103,6 +106,12 @@ public class Token extends MageObjectImpl {
|
|||
return lastAddedTokenId;
|
||||
}
|
||||
|
||||
public ArrayList<UUID> getLastAddedTokenIds() {
|
||||
ArrayList<UUID> ids = new ArrayList<>();
|
||||
ids.addAll(lastAddedTokenIds);
|
||||
return ids;
|
||||
}
|
||||
|
||||
public void addAbility(Ability ability) {
|
||||
ability.setSourceId(this.getId());
|
||||
abilities.add(ability);
|
||||
|
|
@ -122,6 +131,7 @@ public class Token extends MageObjectImpl {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
lastAddedTokenIds.clear();
|
||||
Card source = game.getCard(sourceId);
|
||||
String setCode;
|
||||
if (this.getOriginalExpansionSetCode() != null && !this.getOriginalExpansionSetCode().isEmpty()) {
|
||||
|
|
@ -139,6 +149,7 @@ public class Token extends MageObjectImpl {
|
|||
if (tapped) {
|
||||
newToken.setTapped(true);
|
||||
}
|
||||
this.lastAddedTokenIds.add(newToken.getId());
|
||||
this.lastAddedTokenId = newToken.getId();
|
||||
game.setScopeRelevant(true);
|
||||
game.applyEffects();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue