Merge pull request #77 from magefree/master

merge
This commit is contained in:
theelk801 2017-09-19 10:32:28 -04:00 committed by GitHub
commit 2d577287d1
82 changed files with 1979 additions and 181 deletions

View file

@ -43,17 +43,30 @@ import mage.players.Player;
*/
public class CopyTargetSpellEffect extends OneShotEffect {
private boolean useLKI = false;
public CopyTargetSpellEffect() {
super(Outcome.Copy);
}
public CopyTargetSpellEffect(boolean useLKI) {
super(Outcome.Copy);
this.useLKI = useLKI;
}
public CopyTargetSpellEffect(final CopyTargetSpellEffect effect) {
super(effect);
this.useLKI = effect.useLKI;
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
Spell spell;
if (useLKI) {
spell = game.getSpellOrLKIStack(targetPointer.getFirst(game, source));
} else {
spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
}
if (spell == null) {
spell = (Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK);
}

View file

@ -5,12 +5,11 @@
*/
package mage.abilities.keyword;
import java.io.ObjectStreamException;
import mage.abilities.Ability;
import mage.abilities.EvasionAbility;
import mage.abilities.MageSingleton;
import mage.abilities.StaticAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -18,31 +17,26 @@ import mage.game.permanent.Permanent;
*
* @author LevelX2
*/
public class SkulkAbility extends EvasionAbility implements MageSingleton {
public class SkulkAbility extends StaticAbility {
private static final SkulkAbility instance = new SkulkAbility();
private Object readResolve() throws ObjectStreamException {
return instance;
public SkulkAbility() {
super(Zone.BATTLEFIELD, new SkulkEffect(Duration.WhileOnBattlefield));
}
public static SkulkAbility getInstance() {
return instance;
}
private SkulkAbility() {
this.addEffect(new SkulkEffect(Duration.WhileOnBattlefield));
public SkulkAbility(final SkulkAbility ability) {
super(ability);
}
@Override
public Ability copy() {
return instance;
return new SkulkAbility(this);
}
@Override
public String getRule() {
return "Skulk <i>(This creature can't be blocked by creatures with greater power.)</i>";
}
}
class SkulkEffect extends RestrictionEffect {

View file

@ -58,7 +58,7 @@ public enum CardRepository {
// raise this if db structure was changed
private static final long CARD_DB_VERSION = 51;
// raise this if new cards were added to the server
private static final long CARD_CONTENT_VERSION = 91;
private static final long CARD_CONTENT_VERSION = 92;
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;

View file

@ -87,6 +87,7 @@ public enum CounterType {
M1M1(new BoostCounter(-1, -1).name),
M2M1(new BoostCounter(-2, -1).name),
M2M2(new BoostCounter(-2, -2).name),
MINE("mine"),
MINING("mining"),
MIRE("mire"),
MUSTER("muster"),

View file

@ -57,6 +57,7 @@ import mage.game.match.MatchType;
import mage.game.permanent.Battlefield;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import mage.game.stack.Spell;
import mage.game.stack.SpellStack;
import mage.game.turn.Phase;
import mage.game.turn.Step;
@ -106,6 +107,10 @@ public interface Game extends MageItem, Serializable {
UUID getOwnerId(MageObject object);
Spell getSpell(UUID spellId);
Spell getSpellOrLKIStack(UUID spellId);
Permanent getPermanent(UUID permanentId);
Permanent getPermanentOrLKIBattlefield(UUID permanentId);

View file

@ -445,6 +445,20 @@ public abstract class GameImpl implements Game, Serializable {
return null;
}
@Override
public Spell getSpell(UUID spellId) {
return state.getStack().getSpell(spellId);
}
@Override
public Spell getSpellOrLKIStack(UUID spellId) {
Spell spell = state.getStack().getSpell(spellId);
if (spell == null) {
spell = (Spell) this.getLastKnownInformation(spellId, Zone.STACK);
}
return spell;
}
@Override
public Permanent getPermanent(UUID permanentId) {
return state.getPermanent(permanentId);

View file

@ -0,0 +1,17 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
public class GeminiEngineTwinToken extends Token {
public GeminiEngineTwinToken(int power, int toughness) {
super("Twin", "colorless Construct artifact creature token named Twin that's attacking. Its power is equal to Gemini Engine's power and its toughness is equal to Gemini Engine's toughness.");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.CONSTRUCT);
this.power = new MageInt(power);
this.toughness = new MageInt(toughness);
}
}