- Added BecomesBlocked abilities.

- Added Curtain of Light and Dazzling Beauty.
This commit is contained in:
Sloth
2013-04-04 12:52:52 +00:00
parent dd8a60a9af
commit cc245d2a98
5 changed files with 76 additions and 0 deletions

3
.gitattributes vendored
View File

@@ -2245,6 +2245,7 @@ res/cardsfolder/c/cursed_rack.txt svneol=native#text/plain
res/cardsfolder/c/cursed_ronin.txt svneol=native#text/plain
res/cardsfolder/c/cursed_scroll.txt svneol=native#text/plain
res/cardsfolder/c/cursed_totem.txt svneol=native#text/plain
res/cardsfolder/c/curtain_of_light.txt -text
res/cardsfolder/c/custody_battle.txt -text svneol=unset#text/plain
res/cardsfolder/c/customs_depot.txt svneol=native#text/plain
res/cardsfolder/c/cut_the_earthly_bond.txt svneol=native#text/plain
@@ -2386,6 +2387,7 @@ res/cardsfolder/d/day_of_the_dragons.txt svneol=native#text/plain
res/cardsfolder/d/daybreak_coronet.txt -text
res/cardsfolder/d/daybreak_ranger_nightfall_predator.txt -text
res/cardsfolder/d/daze.txt svneol=native#text/plain
res/cardsfolder/d/dazzling_beauty.txt -text
res/cardsfolder/d/dead_gone.txt -text
res/cardsfolder/d/dead_iron_sledge.txt svneol=native#text/plain
res/cardsfolder/d/dead_reckoning.txt -text svneol=unset#text/plain
@@ -13624,6 +13626,7 @@ src/main/java/forge/card/ability/effects/AnimateAllEffect.java -text
src/main/java/forge/card/ability/effects/AnimateEffect.java -text
src/main/java/forge/card/ability/effects/AnimateEffectBase.java svneol=native#text/plain
src/main/java/forge/card/ability/effects/AttachEffect.java -text
src/main/java/forge/card/ability/effects/BecomesBlockedEffect.java -text
src/main/java/forge/card/ability/effects/BondEffect.java -text
src/main/java/forge/card/ability/effects/ChangeZoneAllEffect.java -text
src/main/java/forge/card/ability/effects/ChangeZoneEffect.java -text

View File

@@ -0,0 +1,9 @@
Name:Curtain of Light
ManaCost:1 W
Types:Instant
Text:Cast CARDNAME only during combat after blockers are declared.
A:SP$ BecomesBlocked | Cost$ 1 W | ValidTgts$ Creature.attacking+unblocked | TgtPrompt$ Select target unblocked attacking creature | SubAbility$ Draw | ActivationPhases$ Declare Blockers - Play Instants and Abilities->EndCombat | SpellDescription$ Target unblocked attacking creature becomes blocked. (This spell works on unblockable creatures.) Draw a card.
SVar:Draw:DB$ Draw | NumCards$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/curtain_of_light.jpg
Oracle:Cast Curtain of Light only during combat after blockers are declared.\nTarget unblocked attacking creature becomes blocked. (This spell works on unblockable creatures.)\nDraw a card.
SetInfo:SOK Common

View File

@@ -0,0 +1,9 @@
Name:Dazzling Beauty
ManaCost:2 W
Types:Instant
Text:Cast CARDNAME only during combat after blockers are declared.
A:SP$ BecomesBlocked | Cost$ 2 W | ValidTgts$ Creature.attacking+unblocked | TgtPrompt$ Select target unblocked attacking creature | SubAbility$ Draw | ActivationPhases$ Declare Blockers - Play Instants and Abilities->EndCombat | SpellDescription$ Target unblocked attacking creature becomes blocked. (This spell works on unblockable creatures.) Draw a card at the beginning of the next turn's upkeep.
SVar:Draw:DB$ Draw | NumCards$ 1 | NextUpkeep$ True
SVar:Picture:http://www.wizards.com/global/images/magic/general/dazzling_beauty.jpg
Oracle:Cast Dazzling Beauty only during the declare blockers step.\nTarget unblocked attacking creature becomes blocked. (This spell works on unblockable creatures.)\nDraw a card at the beginning of the next turn's upkeep.
SetInfo:MIR Common

View File

@@ -112,6 +112,7 @@ public enum ApiType {
Animate (AnimateEffect.class, AnimateAi.class),
AnimateAll (AnimateAllEffect.class, AnimateAllAi.class),
Attach (AttachEffect.class, AttachAi.class),
BecomesBlocked (BecomesBlockedEffect.class, CannotPlayAi.class),
Bond (BondEffect.class, BondAi.class),
ChangeZone(ChangeZoneEffect.class, ChangeZoneAi.class),
ChangeZoneAll(ChangeZoneAllEffect.class, ChangeZoneAllAi.class),

View File

@@ -0,0 +1,54 @@
package forge.card.ability.effects;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import forge.Card;
import forge.Singletons;
import forge.card.ability.SpellAbilityEffect;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.spellability.Ability;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.Target;
import forge.card.trigger.TriggerType;
public class BecomesBlockedEffect extends SpellAbilityEffect {
@Override
protected String getStackDescription(SpellAbility sa) {
final StringBuilder sb = new StringBuilder();
final List<Card> tgtCards = getTargetCards(sa);
sb.append(StringUtils.join(tgtCards, ", "));
sb.append(" becomes blocked.");
return sb.toString();
}
@Override
public void resolve(SpellAbility sa) {
final Target tgt = sa.getTarget();
for (final Card c : getTargetCards(sa)) {
if ((tgt == null) || c.canBeTargetedBy(sa)) {
Singletons.getModel().getGame().getCombat().setBlocked(c);
if (!c.getDamageHistory().getCreatureGotBlockedThisCombat()) {
final HashMap<String, Object> runParams = new HashMap<String, Object>();
runParams.put("Attacker", c);
runParams.put("Blocker", null);
runParams.put("NumBlockers", 0);
Singletons.getModel().getGame().getTriggerHandler().runTrigger(TriggerType.AttackerBlocked, runParams, false);
// Bushido
for (final Ability ab : CardFactoryUtil.getBushidoEffects(c)) {
Singletons.getModel().getGame().getStack().add(ab);
}
}
}
}
}
}