mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[WHO] Implement Everybody Lives! (#13369)
also adjust Courageous Resolve --------- Co-authored-by: xenohedron <12538125+xenohedron@users.noreply.github.com>
This commit is contained in:
parent
0e179ccc1f
commit
f94e570f6d
3 changed files with 122 additions and 17 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.MageObject;
|
||||
|
|
@ -15,9 +14,7 @@ import mage.abilities.keyword.ProtectionAbility;
|
|||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -46,9 +43,9 @@ public final class CourageousResolve extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("Draw a card. <i>(It can't be blocked, targeted, dealt damage, enchanted, or equipped by anything controlled by those players.)</i>"));
|
||||
|
||||
|
||||
//Fateful hour — If you have 5 or less life, you can't lose life this turn, you can't lose the game this turn,
|
||||
// Fateful hour — If you have 5 or less life, you can't lose life this turn, you can't lose the game this turn,
|
||||
// and your opponents can't win the game this turn.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new CantLoseLifeEffect(), FatefulHourCondition.instance, "<br><i>Fateful hour</i> — If you have 5 or less life, you can't lose life this turn"));
|
||||
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new CourageousResolveCantLoseLifeEffect(), FatefulHourCondition.instance, "<br><i>Fateful hour</i> — If you have 5 or less life, you can't lose life this turn"));
|
||||
this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(new CourageousResolveWinLoseEffect(), FatefulHourCondition.instance));
|
||||
|
||||
|
||||
|
|
@ -132,19 +129,19 @@ class CourageousResolveProtectionAbility extends ProtectionAbility {
|
|||
}
|
||||
}
|
||||
|
||||
class CantLoseLifeEffect extends ContinuousEffectImpl {
|
||||
class CourageousResolveCantLoseLifeEffect extends ContinuousEffectImpl {
|
||||
|
||||
public CantLoseLifeEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Benefit);
|
||||
CourageousResolveCantLoseLifeEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit);
|
||||
}
|
||||
|
||||
protected CantLoseLifeEffect(final CantLoseLifeEffect effect) {
|
||||
protected CourageousResolveCantLoseLifeEffect(final CourageousResolveCantLoseLifeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CantLoseLifeEffect copy() {
|
||||
return new CantLoseLifeEffect(this);
|
||||
public CourageousResolveCantLoseLifeEffect copy() {
|
||||
return new CourageousResolveCantLoseLifeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -154,7 +151,7 @@ class CantLoseLifeEffect extends ContinuousEffectImpl {
|
|||
player.setCanLoseLife(false);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
108
Mage.Sets/src/mage/cards/e/EverybodyLives.java
Normal file
108
Mage.Sets/src/mage/cards/e/EverybodyLives.java
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author padfoot
|
||||
*/
|
||||
public final class EverybodyLives extends CardImpl {
|
||||
|
||||
public EverybodyLives(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
|
||||
// All creatures gain hexproof and indestructible until end of turn.
|
||||
this.getSpellAbility().addEffect(new GainAbilityAllEffect(
|
||||
HexproofAbility.getInstance(),
|
||||
Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_PERMANENT_ALL_CREATURES
|
||||
).setText("all creatures gain hexproof"));
|
||||
this.getSpellAbility().addEffect(new GainAbilityAllEffect(
|
||||
IndestructibleAbility.getInstance(),
|
||||
Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_PERMANENT_ALL_CREATURES
|
||||
).setText("and indestructible until end of turn"));
|
||||
|
||||
// Players gain hexproof until end of turn. Players can't lose life this turn and players can't lose the game or win the game this turn.
|
||||
this.getSpellAbility().addEffect(new EverybodyLivesPlayerEffect());
|
||||
this.getSpellAbility().addEffect(new EverybodyLivesCantLoseOrWinGameEffect());
|
||||
}
|
||||
|
||||
private EverybodyLives(final EverybodyLives card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EverybodyLives copy() {
|
||||
return new EverybodyLives(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EverybodyLivesPlayerEffect extends ContinuousEffectImpl {
|
||||
|
||||
EverybodyLivesPlayerEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PlayerEffects, SubLayer.NA, Outcome.AddAbility);
|
||||
this.staticText = "Players gain hexproof until end of turn. Players can't lose life this turn";
|
||||
}
|
||||
|
||||
private EverybodyLivesPlayerEffect(final EverybodyLivesPlayerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EverybodyLivesPlayerEffect copy() {
|
||||
return new EverybodyLivesPlayerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.addAbility(HexproofAbility.getInstance());
|
||||
player.setCanLoseLife(false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class EverybodyLivesCantLoseOrWinGameEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
EverybodyLivesCantLoseOrWinGameEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Benefit, false, false);
|
||||
staticText = "and players can't lose the game or win the game this turn";
|
||||
}
|
||||
|
||||
private EverybodyLivesCantLoseOrWinGameEffect(final EverybodyLivesCantLoseOrWinGameEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EverybodyLivesCantLoseOrWinGameEffect copy() {
|
||||
return new EverybodyLivesCantLoseOrWinGameEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return (event.getType() == GameEvent.EventType.LOSES || event.getType() == GameEvent.EventType.WINS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -295,10 +295,10 @@ public final class DoctorWho extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Ensnared by the Mara", 689, Rarity.RARE, mage.cards.e.EnsnaredByTheMara.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ensnared by the Mara", 84, Rarity.RARE, mage.cards.e.EnsnaredByTheMara.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ensnared by the Mara", 975, Rarity.RARE, mage.cards.e.EnsnaredByTheMara.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Everybody Lives!", 18, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Everybody Lives!", 338, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Everybody Lives!", 623, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Everybody Lives!", 929, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everybody Lives!", 18, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everybody Lives!", 338, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everybody Lives!", 623, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everybody Lives!", 929, Rarity.RARE, mage.cards.e.EverybodyLives.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everything Comes to Dust", 19, Rarity.RARE, mage.cards.e.EverythingComesToDust.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everything Comes to Dust", 339, Rarity.RARE, mage.cards.e.EverythingComesToDust.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Everything Comes to Dust", 624, Rarity.RARE, mage.cards.e.EverythingComesToDust.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue