mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Converted Dunerider Outlaw and Whirling Dervish to script.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
Name:Dunerider Outlaw
|
||||
ManaCost:B B
|
||||
Types:Creature Human Rebel Rogue
|
||||
Text:At the beginning of the end step, if Dunerider Outlaw dealt damage to an opponent this turn, put a +1/+1 counter on it.
|
||||
Text:no text
|
||||
PT:1/1
|
||||
K:Protection from green
|
||||
T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ TrigPutCounter | IsPresent$ Card.Self+dealtDamageToOppThisTurn | TriggerDescription$ At the beginning of each end step, if CARDNAME dealt damage to an opponent this turn, put a +1/+1 counter on it.
|
||||
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/dunerider_outlaw.jpg
|
||||
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/86.jpg
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
Name:Whirling Dervish
|
||||
ManaCost:G G
|
||||
Types:Creature Human Monk
|
||||
Text:At the beginning of the end step, if Whirling Dervish dealt damage to an opponent this turn, put a +1/+1 counter on it.
|
||||
Text:no text
|
||||
PT:1/1
|
||||
K:Protection from black
|
||||
T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ TrigPutCounter | IsPresent$ Card.Self+dealtDamageToOppThisTurn | TriggerDescription$ At the beginning of each end step, if CARDNAME dealt damage to an opponent this turn, put a +1/+1 counter on it.
|
||||
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/whirling_dervish.jpg
|
||||
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/203.jpg
|
||||
|
||||
@@ -6922,6 +6922,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if ( !this.getDamageHistory().getThisTurnDamaged().contains(sourceController) ) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("dealtDamageToOppThisTurn")) {
|
||||
if ( !this.getDamageHistory().getThisTurnDamaged().contains(sourceController.getOpponent()) ) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("controllerWasDealtCombatDamageByThisTurn")) {
|
||||
if ( !this.getDamageHistory().getThisTurnCombatDamaged().contains(sourceController) ) {
|
||||
return false;
|
||||
|
||||
@@ -350,76 +350,6 @@ public final class GameActionUtil {
|
||||
AllZone.getStack().setResolving(bResolving);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* payCostDuringAbilityResolve.
|
||||
* </p>
|
||||
*
|
||||
* @param message
|
||||
* a {@link java.lang.String} object.
|
||||
* @param hostCard
|
||||
* a Card object.
|
||||
* @param manaCost
|
||||
* a {@link java.lang.String} object.
|
||||
* @param paid
|
||||
* a {@link forge.Command} object.
|
||||
* @param unpaid
|
||||
* a {@link forge.Command} object.
|
||||
*/
|
||||
/*public static void payCostDuringAbilityResolve(final String message, Card hostCard, final String manaCost,
|
||||
final Command paid, final Command unpaid) {
|
||||
if (manaCost.startsWith("PayLife")) {
|
||||
String amountString = manaCost.split("<")[1].split(">")[0];
|
||||
int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||
: CardFactoryUtil.xCount(hostCard, hostCard.getSVar(amountString));
|
||||
if (AllZone.getHumanPlayer().canPayLife(amount) && showYesNoDialog(hostCard, "Do you want to pay "
|
||||
+ amount + " life?")) {
|
||||
AllZone.getHumanPlayer().payLife(amount, null);
|
||||
paid.execute();
|
||||
} else {
|
||||
unpaid.execute();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (manaCost.startsWith("AddCounter")) {
|
||||
String amountString = manaCost.split("<")[1].split("\\/")[0];
|
||||
String counterName = manaCost.split("<")[1].split("\\/")[1].split(">")[0];
|
||||
Counters counterType = Counters.valueOf(counterName);
|
||||
int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||
: CardFactoryUtil.xCount(hostCard, hostCard.getSVar(amountString));
|
||||
String plural = amount > 1 ? "s" : "";
|
||||
if (showYesNoDialog(hostCard, "Do you want to put " + amount + " " + counterType.getName()
|
||||
+ " counter" + plural + " on " + hostCard + "?")) {
|
||||
if (hostCard.canHaveCountersPlacedOnIt(counterType)) {
|
||||
hostCard.addCounterFromNonEffect(counterType, amount);
|
||||
paid.execute();
|
||||
} else {
|
||||
unpaid.execute();
|
||||
AllZone.getGameLog().add("ResolveStack", "Trying to pay upkeep for " + hostCard + " but it can't have "
|
||||
+ counterType.getName() + " counters put on it.", 2);
|
||||
}
|
||||
} else {
|
||||
unpaid.execute();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (manaCost.equals("0")) {
|
||||
if (showYesNoDialog(hostCard, "Do you want to pay 0?")) {
|
||||
paid.execute();
|
||||
} else {
|
||||
unpaid.execute();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// temporarily disable the Resolve flag, so the user can payMana for the
|
||||
// resolving Ability
|
||||
final boolean bResolving = AllZone.getStack().getResolving();
|
||||
AllZone.getStack().setResolving(false);
|
||||
AllZone.getInputControl().setInput(new InputPayManaCostAbility(message, manaCost, paid, unpaid));
|
||||
AllZone.getStack().setResolving(bResolving);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* payCostDuringAbilityResolve.
|
||||
@@ -626,78 +556,6 @@ public final class GameActionUtil {
|
||||
return winFlip;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* executeLandfallEffects.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
*//*
|
||||
public static void executeLandfallEffects(final Card c) {
|
||||
if (c.getName().equals("Lotus Cobra")) {
|
||||
GameActionUtil.landfallLotusCobra(c);
|
||||
}
|
||||
}
|
||||
|
||||
*//**
|
||||
* <p>
|
||||
* showLandfallDialog.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
* @return a boolean.
|
||||
*//*
|
||||
private static boolean showLandfallDialog(final Card c) {
|
||||
CMatchUI.SINGLETON_INSTANCE.setCard(c);
|
||||
final String[] choices = { "Yes", "No" };
|
||||
|
||||
Object q = null;
|
||||
|
||||
q = GuiUtils.chooseOneOrNone("Use " + c + " Landfall?", choices);
|
||||
|
||||
return (q != null) && q.equals("Yes");
|
||||
}
|
||||
|
||||
*//**
|
||||
* <p>
|
||||
* landfallLotusCobra.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
*//*
|
||||
private static void landfallLotusCobra(final Card c) {
|
||||
final Ability ability = new Ability(c, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
String color = "";
|
||||
|
||||
final String o = GuiUtils.chooseOne("Choose mana color", Constant.Color.ONLY_COLORS);
|
||||
color = InputPayManaCostUtil.getShortColorString(o);
|
||||
|
||||
final AbilityMana abMana = new AbilityMana(c, "0", color) {
|
||||
private static final long serialVersionUID = -2182129023960978132L;
|
||||
};
|
||||
abMana.produceMana();
|
||||
}
|
||||
};
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(c.getName()).append(" - add one mana of any color to your mana pool.");
|
||||
ability.setStackDescription(sb.toString());
|
||||
|
||||
if (c.getController().isHuman()) {
|
||||
if (GameActionUtil.showLandfallDialog(c)) {
|
||||
AllZone.getStack().addSimultaneousStackEntry(ability);
|
||||
}
|
||||
} else {
|
||||
// TODO once AI has a mana pool he should choose add Ability and
|
||||
// choose a mana as appropriate
|
||||
}
|
||||
}*/
|
||||
|
||||
// not restricted to combat damage, not restricted to dealing damage to
|
||||
// creatures/players
|
||||
/**
|
||||
@@ -867,11 +725,6 @@ public final class GameActionUtil {
|
||||
AllZone.getStack().addSimultaneousStackEntry(ability);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (c.getName().equals("Whirling Dervish") || c.getName().equals("Dunerider Outlaw")) {
|
||||
GameActionUtil.playerCombatDamageWhirlingDervish(c);
|
||||
}
|
||||
|
||||
c.getDamageHistory().registerDamage(player);
|
||||
}
|
||||
@@ -989,44 +842,6 @@ public final class GameActionUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* playerCombatDamageWhirlingDervish.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
*/
|
||||
private static void playerCombatDamageWhirlingDervish(final Card c) {
|
||||
final int power = c.getNetAttack();
|
||||
final Card card = c;
|
||||
|
||||
if (power > 0) {
|
||||
final Ability ability2 = new Ability(c, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.addCounter(Counters.P1P1, 1);
|
||||
}
|
||||
}; // ability2
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(c.getName()).append(" - gets a +1/+1 counter.");
|
||||
ability2.setStackDescription(sb.toString());
|
||||
|
||||
final Command dealtDmg = new Command() {
|
||||
private static final long serialVersionUID = 2200679209414069339L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
AllZone.getStack().addSimultaneousStackEntry(ability2);
|
||||
|
||||
}
|
||||
};
|
||||
AllZone.getEndOfTurn().addAt(dealtDmg);
|
||||
|
||||
} // if
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* playerCombatDamageScalpelexis.
|
||||
|
||||
Reference in New Issue
Block a user