- Added the first global rule change: "Damage can't be prevented.".

- Converted Leyline of Punishment and Everlasting Torment.
This commit is contained in:
Sloth
2012-11-14 11:25:52 +00:00
parent 13aab262fe
commit ab68980856
6 changed files with 37 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
Name:Everlasting Torment Name:Everlasting Torment
ManaCost:2 BR ManaCost:2 BR
Types:Enchantment Types:Enchantment
Text:Damage can't be prevented. All damage is dealt as though it's source had wither. (A source with wither deals damage to creatures in the form of -1/-1 counters.) Text:All damage is dealt as though it's source had wither. (A source with wither deals damage to creatures in the form of -1/-1 counters.)
S:Mode$ Continuous | Affected$ Player | AddKeyword$ You can't gain life. | Description$ Players can't gain life. S:Mode$ Continuous | Affected$ Player | AddKeyword$ You can't gain life. | Description$ Players can't gain life.
S:Mode$ Continuous | GlobalRule$ Damage can't be prevented. | Description$ Damage can't be prevented.
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/everlasting_torment.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/everlasting_torment.jpg

View File

@@ -1,8 +1,9 @@
Name:Leyline of Punishment Name:Leyline of Punishment
ManaCost:2 R R ManaCost:2 R R
Types:Enchantment Types:Enchantment
Text:If Leyline of Punishment is in your opening hand, you may begin the game with it on the battlefield. Damage can't be prevented. Text:If Leyline of Punishment is in your opening hand, you may begin the game with it on the battlefield.
S:Mode$ Continuous | Affected$ Player | AddKeyword$ You can't gain life. | Description$ Players can't gain life. S:Mode$ Continuous | Affected$ Player | AddKeyword$ You can't gain life. | Description$ Players can't gain life.
S:Mode$ Continuous | GlobalRule$ Damage can't be prevented. | Description$ Damage can't be prevented.
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/leyline_of_punishment.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/leyline_of_punishment.jpg

View File

@@ -7931,8 +7931,7 @@ public class Card extends GameEntity implements Comparable<Card> {
public final int staticDamagePrevention(final int damage, final int possiblePrvenetion, final Card source, public final int staticDamagePrevention(final int damage, final int possiblePrvenetion, final Card source,
final boolean isCombat) { final boolean isCombat) {
if (Singletons.getModel().getGame().isCardInPlay("Leyline of Punishment") if (Singletons.getModel().getGame().getStaticEffects().isNoPrevention()) {
|| Singletons.getModel().getGame().isCardInPlay("Everlasting Torment")) {
return damage; return damage;
} }
@@ -7961,8 +7960,7 @@ public class Card extends GameEntity implements Comparable<Card> {
@Override @Override
public final int staticDamagePrevention(final int damageIn, final Card source, final boolean isCombat) { public final int staticDamagePrevention(final int damageIn, final Card source, final boolean isCombat) {
if (Singletons.getModel().getGame().isCardInPlay("Leyline of Punishment") if (Singletons.getModel().getGame().getStaticEffects().isNoPrevention()) {
|| Singletons.getModel().getGame().isCardInPlay("Everlasting Torment")) {
return damageIn; return damageIn;
} }
@@ -8078,8 +8076,7 @@ public class Card extends GameEntity implements Comparable<Card> {
@Override @Override
public final int preventDamage(final int damage, final Card source, final boolean isCombat) { public final int preventDamage(final int damage, final Card source, final boolean isCombat) {
if (Singletons.getModel().getGame().isCardInPlay("Leyline of Punishment") if (Singletons.getModel().getGame().getStaticEffects().isNoPrevention()
|| Singletons.getModel().getGame().isCardInPlay("Everlasting Torment")
|| source.hasKeyword("Damage that would be dealt by CARDNAME can't be prevented.")) { || source.hasKeyword("Damage that would be dealt by CARDNAME can't be prevented.")) {
return damage; return damage;
} }

View File

@@ -45,11 +45,16 @@ public class StaticEffects {
* staticEffects. * staticEffects.
*/ */
private ArrayList<StaticEffect> staticEffects; private ArrayList<StaticEffect> staticEffects;
//Global rule changes
private boolean noPrevention = false;
/** /**
* clearStaticEffect. TODO Write javadoc for this method. * clearStaticEffect. TODO Write javadoc for this method.
*/ */
public final void clearStaticEffects() { public final void clearStaticEffects() {
noPrevention = false;
// remove all static effects // remove all static effects
for (int i = 0; i < this.staticEffects.size(); i++) { for (int i = 0; i < this.staticEffects.size(); i++) {
this.removeStaticEffect(this.staticEffects.get(i)); this.removeStaticEffect(this.staticEffects.get(i));
@@ -59,6 +64,20 @@ public class StaticEffects {
Singletons.getModel().getGame().getTriggerHandler().cleanUpTemporaryTriggers(); Singletons.getModel().getGame().getTriggerHandler().cleanUpTemporaryTriggers();
} }
/**
* @param noPrevent the noPrevention to set
*/
public void setNoPrevention(boolean noPrevent) {
this.noPrevention = noPrevent;
}
/**
* @return the noPrevention
*/
public boolean isNoPrevention() {
return noPrevention;
}
/** /**
* addStaticEffect. TODO Write javadoc for this method. * addStaticEffect. TODO Write javadoc for this method.
* *

View File

@@ -28,6 +28,7 @@ import forge.Singletons;
import forge.CardLists; import forge.CardLists;
import forge.CardUtil; import forge.CardUtil;
import forge.StaticEffect; import forge.StaticEffect;
import forge.StaticEffects;
import forge.card.abilityfactory.AbilityFactory; import forge.card.abilityfactory.AbilityFactory;
import forge.card.cardfactory.CardFactoryUtil; import forge.card.cardfactory.CardFactoryUtil;
import forge.card.replacement.ReplacementEffect; import forge.card.replacement.ReplacementEffect;
@@ -89,6 +90,14 @@ public class StaticAbilityContinuous {
boolean removeCardTypes = false; boolean removeCardTypes = false;
boolean removeSubTypes = false; boolean removeSubTypes = false;
boolean removeCreatureTypes = false; boolean removeCreatureTypes = false;
//Global rules changes
if (params.containsKey("GlobalRule")) {
final StaticEffects effects = Singletons.getModel().getGame().getStaticEffects();
if (params.get("GlobalRule").equals("Damage can't be prevented.")) {
effects.setNoPrevention(true);
}
}
if (params.containsKey("SetPower")) { if (params.containsKey("SetPower")) {
setP = params.get("SetPower"); setP = params.get("SetPower");

View File

@@ -603,7 +603,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
@Override @Override
public final int staticDamagePrevention(final int damage, final Card source, final boolean isCombat) { public final int staticDamagePrevention(final int damage, final Card source, final boolean isCombat) {
if (game.isCardInPlay("Leyline of Punishment") || game.isCardInPlay("Everlasting Torment")) { if (Singletons.getModel().getGame().getStaticEffects().isNoPrevention()) {
return damage; return damage;
} }
@@ -816,7 +816,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
@Override @Override
public final int preventDamage(final int damage, final Card source, final boolean isCombat) { public final int preventDamage(final int damage, final Card source, final boolean isCombat) {
if (game.isCardInPlay("Leyline of Punishment") || game.isCardInPlay("Everlasting Torment") if (Singletons.getModel().getGame().getStaticEffects().isNoPrevention()
|| source.hasKeyword("Damage that would be dealt by CARDNAME can't be prevented.")) { || source.hasKeyword("Damage that would be dealt by CARDNAME can't be prevented.")) {
return damage; return damage;
} }