-add support to AF_GainControl to destroy target on certain conditions.

-add Merieke Ri Berit (from Ice Age)
This commit is contained in:
jendave
2011-08-06 11:06:28 +00:00
parent 2ebd8ed001
commit 50bf5ca9db
3 changed files with 65 additions and 2 deletions

1
.gitattributes vendored
View File

@@ -2881,6 +2881,7 @@ res/cardsfolder/merfolk_of_the_pearl_trident.txt -text svneol=native#text/plain
res/cardsfolder/merfolk_seastalkers.txt -text svneol=native#text/plain
res/cardsfolder/merfolk_seer.txt -text svneol=native#text/plain
res/cardsfolder/merfolk_sovereign.txt -text svneol=native#text/plain
res/cardsfolder/merieke_ri_berit.txt -text svneol=native#text/plain
res/cardsfolder/merrow_grimeblotter.txt -text svneol=native#text/plain
res/cardsfolder/merrow_harbinger.txt -text svneol=native#text/plain
res/cardsfolder/merrow_levitator.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,10 @@
Name:Merieke Ri Berit
ManaCost:W U B
Types:Legendary Creature Human
Text:no text
PT:1/1
K:CARDNAME doesn't untap during your untap step.
A:AB$GainControl|Cost$T|Tgt$TgtC|LoseControl$LeavesPlay,LoseControl|DestroyTgt$LeavesPlay,LoseControl,Untap|NoRegen$True|SpellDescription$Gain control of target creature for as long as you control CARDNAME. When CARDNAME leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/merieke_ri_berit.jpg
End

View File

@@ -4,16 +4,19 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
//AB:GainControl|ValidTgts$Creature|TgtPrompt$Select target legendary creature|LoseControl$[Untap],[PowerGT],[LoseControl]|UntilEOT$True|SpellDescription$Gain control of target xxxxxxx
//AB:GainControl|ValidTgts$Creature|TgtPrompt$Select target legendary creature|LoseControl$Untap,LoseControl|UntilEOT$True|SpellDescription$Gain control of target xxxxxxx
//GainControl specific params:
// LoseControl - the lose control conditions (as a comma separated list)
// -Untap - source card becomes untapped
// -LoseControl - you lose control of source card
// -LeavesPlay - source card leaves the battlefield
// -PowerGT - (not implemented yet for Old Man of the Sea)
// AddKWs - Keywords to add to the controlled card (as a "&"-separated list; like Haste, Sacrifice CARDNAME at EOT, any standard keyword)
// OppChoice - set to True if opponent chooses creature (for Preacher) - not implemented yet
// Untap - set to True if target card should untap when control is taken
// DestroyTgt - actions upon which the tgt should be destroyed. same list as LoseControl
// NoRegen - set if destroyed creature can't be regenerated. used only with DestroyTgt
public class AbilityFactory_GainControl {
@@ -23,6 +26,8 @@ public class AbilityFactory_GainControl {
private HashMap<String,String> params = null;
private Card hostCard = null;
private ArrayList<String> lose = null;
private ArrayList<String> destroyOn = null;
private boolean bNoRegen = false;
private boolean bUntap = false;
private boolean bTapOnLose = false;
private ArrayList<String> kws = null;
@@ -43,6 +48,12 @@ public class AbilityFactory_GainControl {
if(params.containsKey("AddKWs")) {
kws = new ArrayList<String>(Arrays.asList(params.get("AddKWs").split(" & ")));
}
if (params.containsKey("DestroyTgt")) {
destroyOn = new ArrayList<String>(Arrays.asList(params.get("DestroyTgt").split(",")));
}
if(params.containsKey("NoRegen")) {
bNoRegen = true;
}
}
public SpellAbility getSpell() {
@@ -208,7 +219,7 @@ public class AbilityFactory_GainControl {
if(lose.contains("Untap")) {
hostCard.addUntapCommand(getLoseControlCommand(j));
}
if(lose.contains("ChangeController")) {
if(lose.contains("LoseControl")) {
hostCard.addChangeControllerCommand(getLoseControlCommand(j));
}
if(lose.contains("EOT")) {
@@ -216,6 +227,18 @@ public class AbilityFactory_GainControl {
}
}
if (destroyOn != null){
if(destroyOn.contains("LeavesPlay")) {
hostCard.addLeavesPlayCommand(getDestroyCommand(j));
}
if(destroyOn.contains("Untap")) {
hostCard.addUntapCommand(getDestroyCommand(j));
}
if(destroyOn.contains("LoseControl")) {
hostCard.addChangeControllerCommand(getDestroyCommand(j));
}
}
}//end foreach target
//drawbacks are not implemented
@@ -230,6 +253,35 @@ public class AbilityFactory_GainControl {
}
private Command getDestroyCommand(final int i) {
final Command destroy = new Command() {
private static final long serialVersionUID = 878543373519872418L;
public void execute() {
final Card c = movedCards[i];
Ability ability = new Ability(hostCard, "0") {
public void resolve() {
if(bNoRegen) {
AllZone.GameAction.destroyNoRegeneration(c);
}
else {
AllZone.GameAction.destroy(c);
}
}
};
StringBuilder sb = new StringBuilder();
sb.append(hostCard).append(" - destroy ").append(c.getName()).append(".");
if(bNoRegen) sb.append(" It can't be regenerated.");
ability.setStackDescription(sb.toString());
AllZone.Stack.add(ability);
}
};
return destroy;
}
private Command getLoseControlCommand(final int i) {
final Command loseControl = new Command() {
private static final long serialVersionUID = 878543373519872418L;