mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
commit
6936a8ef51
5 changed files with 348 additions and 192 deletions
|
|
@ -52,7 +52,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
private Command onHover = null;
|
||||
private Color textColor = Color.white;
|
||||
private final Rectangle centerTextArea = new Rectangle(5, 18, 75, 40);
|
||||
private Color centerTextColor = Color.YELLOW;
|
||||
private Color centerTextColor = new Color(200, 190, 0, 180);
|
||||
private final Color textBGColor = Color.black;
|
||||
|
||||
static final Font textFont = new Font("Arial", Font.PLAIN, 12);
|
||||
|
|
|
|||
|
|
@ -202,10 +202,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
if (playerLife > pastLife) {
|
||||
if (faderGainLife == null && doGainFade) {
|
||||
doGainFade = false;
|
||||
faderGainLife = new Timer(25, new ActionListener() {
|
||||
faderGainLife = new Timer(50, new ActionListener() {
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
gainX++;
|
||||
avatar.setCenterColor(new Color(2 * gainX, 190, 255, 250 - gainX));
|
||||
int alpha = Math.max(250 - gainX, 180);
|
||||
avatar.setCenterColor(new Color(2 * gainX, 190, 255, alpha));
|
||||
avatar.repaint();
|
||||
if (gainX >= 100) {
|
||||
avatar.setCenterColor(new Color(200, 190, 0, 180));
|
||||
|
|
@ -227,10 +228,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
} else if (playerLife < pastLife) {
|
||||
if (faderLoseLife == null && doLoseFade) {
|
||||
doLoseFade = false;
|
||||
faderLoseLife = new Timer(25, new ActionListener() {
|
||||
faderLoseLife = new Timer(50, new ActionListener() {
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
loseX++;
|
||||
avatar.setCenterColor(new Color(250 - loseX / 2, 140 + loseX / 2, 0, 250 - loseX));
|
||||
int alpha = Math.max(250 - loseX, 180);
|
||||
avatar.setCenterColor(new Color(250 - loseX / 2, 140 + loseX / 2, 0, alpha));
|
||||
avatar.repaint();
|
||||
if (loseX >= 100) {
|
||||
avatar.setCenterColor(new Color(200, 190, 0, 180));
|
||||
|
|
|
|||
152
Mage.Sets/src/mage/cards/r/Retribution.java
Normal file
152
Mage.Sets/src/mage/cards/r/Retribution.java
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
/*
|
||||
* 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.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class Retribution extends CardImpl {
|
||||
|
||||
public Retribution(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
|
||||
|
||||
// Choose two target creatures an opponent controls. That player chooses and sacrifices one of those creatures. Put a -1/-1 counter on the other.
|
||||
this.getSpellAbility().addEffect(new RetributionEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentOpponentSameController(2, 2, StaticFilters.FILTER_PERMANENT_CREATURE, false));
|
||||
|
||||
}
|
||||
|
||||
public Retribution(final Retribution card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Retribution copy() {
|
||||
return new Retribution(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RetributionEffect extends OneShotEffect {
|
||||
|
||||
public RetributionEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "Choose two target creatures an opponent controls. That player chooses and sacrifices one of those creatures. Put a -1/-1 counter on the other";
|
||||
}
|
||||
|
||||
public RetributionEffect(final RetributionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RetributionEffect copy() {
|
||||
return new RetributionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null) {
|
||||
boolean sacrificeDone = false;
|
||||
int count = 0;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
if (creature != null) {
|
||||
Player controllerOfCreature = game.getPlayer(creature.getControllerId());
|
||||
if ((count == 0
|
||||
&& controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game))
|
||||
|| (count == 1
|
||||
&& !sacrificeDone)) {
|
||||
creature.sacrifice(source.getId(), game);
|
||||
sacrificeDone = true;
|
||||
} else {
|
||||
creature.addCounters(CounterType.M1M1.createInstance(), source, game);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class TargetCreaturePermanentOpponentSameController extends TargetCreaturePermanent {
|
||||
|
||||
public TargetCreaturePermanentOpponentSameController(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
}
|
||||
|
||||
public TargetCreaturePermanentOpponentSameController(final TargetCreaturePermanentOpponentSameController target) {
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
|
||||
if (super.canTarget(controllerId, id, source, game)) {
|
||||
Permanent firstTargetPermanent = game.getPermanent(id);
|
||||
if (firstTargetPermanent != null
|
||||
&& game.getOpponents(controllerId).contains(firstTargetPermanent.getControllerId())) {
|
||||
for (Object object : getTargets()) {
|
||||
UUID targetId = (UUID) object;
|
||||
Permanent targetPermanent = game.getPermanent(targetId);
|
||||
if (targetPermanent != null) {
|
||||
if (!firstTargetPermanent.getId().equals(targetPermanent.getId())) {
|
||||
if (!firstTargetPermanent.getControllerId().equals(targetPermanent.getOwnerId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetCreaturePermanentOpponentSameController copy() {
|
||||
return new TargetCreaturePermanentOpponentSameController(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -156,6 +156,7 @@ public class Homelands extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Reef Pirates", 45, Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Reef Pirates", 46, Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Renewal", 66, Rarity.COMMON, mage.cards.r.Renewal.class));
|
||||
cards.add(new SetCardInfo("Retribution", 99, Rarity.UNCOMMON, mage.cards.r.Retribution.class));
|
||||
cards.add(new SetCardInfo("Reveka, Wizard Savant", 47, Rarity.RARE, mage.cards.r.RevekaWizardSavant.class));
|
||||
cards.add(new SetCardInfo("Roots", 68, Rarity.UNCOMMON, mage.cards.r.Roots.class));
|
||||
cards.add(new SetCardInfo("Root Spider", 67, Rarity.UNCOMMON, mage.cards.r.RootSpider.class));
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ public class MastersEditionII extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Red Cliffs Armada", 62, Rarity.COMMON, mage.cards.r.RedCliffsArmada.class));
|
||||
cards.add(new SetCardInfo("Reinforcements", 28, Rarity.COMMON, mage.cards.r.Reinforcements.class));
|
||||
cards.add(new SetCardInfo("Reprisal", 29, Rarity.COMMON, mage.cards.r.Reprisal.class));
|
||||
cards.add(new SetCardInfo("Retribution", 148, Rarity.UNCOMMON, mage.cards.r.Retribution.class));
|
||||
cards.add(new SetCardInfo("Righteous Fury", 30, Rarity.RARE, mage.cards.r.RighteousFury.class));
|
||||
cards.add(new SetCardInfo("Ritual of Subdual", 174, Rarity.RARE, mage.cards.r.RitualOfSubdual.class));
|
||||
cards.add(new SetCardInfo("Ritual of the Machine", 109, Rarity.RARE, mage.cards.r.RitualOfTheMachine.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue